0c325338a11b09ac8e2284d2446cf5ee9b9cf619,lexos/processors/prepare/cutter.py,,cut_list_with_overlap,#,10

Before Change


    // get the distance between starts of each two adjacent segments
    seg_start_distance = norm_seg_size - overlap

    input_list_length = len(input_list)

    // get the number of segments excluding the last segment.
    // it determines by the length without the last segment divided by the
    // distance between each start-point
    num_seg_start = \
        (input_list_length - norm_seg_size * last_prop) / seg_start_distance

    // define the number segment based on the number of ending-point
    // the number of stop-point plus last segment(one) equals segment number
    // let it equals to one if only one segment (no stop point within the list)
    if num_seg_start > 0:
        num_segment = int(num_seg_start) + 1
    else:
        num_segment = 1

    def get_single_seg(index: int, is_last_prop: bool) -> List[List[str]]:
        Helper to get one single segment with index.

        This function first evaluate whether the segment is the last one and

After Change


    seg_start_distance = norm_seg_size - overlap

    // the length of the list excluding the last segment
    length_exclude_last = len(input_list) - norm_seg_size * last_prop

    // the total number of segments after cut
    // the `+ 1` is to add back the last segments
    num_segment = \
        int(length_exclude_last / seg_start_distance) + 1

    // need at least one segment
    if num_segment < 1:
        num_segment = 1
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: WheatonCS/Lexos
Commit Name: 0c325338a11b09ac8e2284d2446cf5ee9b9cf619
Time: 2017-08-15
Author: darias0826@gmail.com
File Name: lexos/processors/prepare/cutter.py
Class Name:
Method Name: cut_list_with_overlap


Project Name: WheatonCS/Lexos
Commit Name: acadd6b044bc07cbfed6db0eb7c4af603a8ee460
Time: 2017-08-09
Author: darias0826@gmail.com
File Name: lexos/processors/prepare/cutter.py
Class Name:
Method Name: cut_list_with_overlap


Project Name: WheatonCS/Lexos
Commit Name: 6befe3b27d85c8c8906b48eedf5a772771f38cd8
Time: 2017-08-15
Author: darias0826@gmail.com
File Name: lexos/processors/prepare/cutter.py
Class Name:
Method Name: cut_list_with_overlap