Ignore:
Timestamp:
May 29, 2012, 4:10:00 PM (7 years ago)
Author:
ksherdy
Message:

Fixed template glue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/symbol_table/pablo/logbase2_group_strms.py

    r2174 r2185  
    1111        follows_0 = 0
    1212
    13 def Gen_lgth_groups(groups):
     13def Gen_lgth_groups(markers, groups):
    1414
    15     starts = groups.starts
    16     remaining_follows = groups.follows
     15                groups.starts = markers.starts
     16                groups.follows = markers.follows
    1717
    18     # Group symbols of length 1
    19     starts_1 = pablo.Advance(starts)
    20     groups.follows_1 = starts_1 & remaining_follows
    21     remaining_follows = remaining_follows & ~groups.follows_1
     18                starts = groups.starts
     19                remaining_follows = groups.follows
    2220
    23     # Group symbols of length 2
    24     starts_2 = pablo.Advance(starts_1)
    25     groups.follows_2 = starts_2 & remaining_follows
    26     remaining_follows = remaining_follows & ~groups.follows_2
     21                # Group symbols of length 1
     22                starts_1 = pablo.Advance(starts)
     23                groups.follows_1 = starts_1 & remaining_follows
     24                remaining_follows = remaining_follows & ~groups.follows_1
    2725
    28     # Group symbols of length 3 to 4
    29     temp = starts_1 | starts_2
    30     temp32 = pablo.Advance32(temp)
    31     #starts_3_to_4 = pablo.Advance(pablo.Advance(temp))
    32     starts_3_to_4 = interpose32 (temp, temp32, 2)
    33     groups.follows_4 = starts_3_to_4 & remaining_follows
    34     remaining_follows = remaining_follows & ~groups.follows_4
     26                # Group symbols of length 2
     27                starts_2 = pablo.Advance(starts_1)
     28                groups.follows_2 = starts_2 & remaining_follows
     29                remaining_follows = remaining_follows & ~groups.follows_2
    3530
    36     # Group symbols of length 5 to 8
    37     temp = temp | starts_3_to_4
    38     temp32 = pablo.Advance32(temp)
    39     #starts_5_to_8 = pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(temp))))
    40     starts_5_to_8 = interpose32 (temp, temp32, 4)
    41     groups.follows_8 = starts_5_to_8 & remaining_follows
    42     remaining_follows = remaining_follows & ~groups.follows_8
     31                # Group symbols of length 3 to 4
     32                temp = starts_1 | starts_2
     33                temp32 = pablo.Advance32(temp)
     34                #starts_3_to_4 = pablo.Advance(pablo.Advance(temp))
     35                starts_3_to_4 = interpose32 (temp, temp32, 2)
     36                groups.follows_4 = starts_3_to_4 & remaining_follows
     37                remaining_follows = remaining_follows & ~groups.follows_4
    4338
    44     # Group symbols of length 9 to 16
    45     temp = temp | starts_5_to_8
    46     temp32 = pablo.Advance32 (temp)
    47     #starts_9_16 = pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(temp))))))))
    48     starts_9_16 = interpose32 (temp, temp32, 8)
    49     groups.follows_16 = starts_9_16 & remaining_follows
    50     remaining_follows = remaining_follows & ~groups.follows_16
     39                # Group symbols of length 5 to 8
     40                temp = temp | starts_3_to_4
     41                temp32 = pablo.Advance32(temp)
     42                #starts_5_to_8 = pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(temp))))
     43                starts_5_to_8 = interpose32 (temp, temp32, 4)
     44                groups.follows_8 = starts_5_to_8 & remaining_follows
     45                remaining_follows = remaining_follows & ~groups.follows_8
    5146
    52     # Group symbols of length 17 and longer
    53     groups.follows_0 = remaining_follows
     47                # Group symbols of length 9 to 16
     48                temp = temp | starts_5_to_8
     49                temp32 = pablo.Advance32 (temp)
     50                #starts_9_16 = pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(temp))))))))
     51                starts_9_16 = interpose32 (temp, temp32, 8)
     52                groups.follows_16 = starts_9_16 & remaining_follows
     53                remaining_follows = remaining_follows & ~groups.follows_16
    5454
    55 def Main(groups):
    56         Gen_lgth_groups(groups)
     55                # Group symbols of length 17 and longer
     56                groups.follows_0 = remaining_follows
     57
     58def Main(markers, groups):
     59                Gen_lgth_groups(markers, groups)
Note: See TracChangeset for help on using the changeset viewer.