Ignore:
Timestamp:
May 16, 2012, 3:02:58 PM (7 years ago)
Author:
ksherdy
Message:

Added bit / byte strategy. Added length test to hash table.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/symbol_table/demo_strms.py

    r2103 r2106  
    44import logbase2_group_strms
    55import div2_logbase2_group_strms
     6import bit_byte_group_strms
    67import sys
    78
     
    9798        ('groups.follows_0', bitstream2string(groups.follows_0, lgth))])
    9899
     100def Demo_bit_byte(u8data, basis_bits):
     101
     102    lgth = len(u8data)
     103
     104    markers = marker_strms.Markers()
     105    marker_strms.Classify_markers(basis_bits, markers)
     106    marker_strms.Generate_markers(markers)
     107
     108    groups = bit_byte_group_strms.Groups()
     109    groups.starts = markers.starts
     110    groups.follows = markers.follows
     111    bit_byte_group_strms.Gen_lgth_groups(groups)
     112
     113    print_aligned_streams([('Input Data', u8data),
     114        ('markers.spans', bitstream2string(markers.spans, lgth)),
     115        ('markers.starts', bitstream2string(markers.starts, lgth)),
     116        ('markers.follows', bitstream2string(markers.follows, lgth)),
     117        ('groups.starts', bitstream2string(groups.starts, lgth)),
     118        ('groups.follows', bitstream2string(groups.follows, lgth)),
     119        ('groups.follows_7', bitstream2string(groups.follows_7, lgth)),
     120        ('groups.follows_0', bitstream2string(groups.follows_0, lgth))])
     121
    99122if __name__ == "__main__":
    100123
     
    119142    # Demo_div2(u8data, basis_bits)
    120143    # Demo_logbase2(u8data, basis_bits)
    121     Demo_div2_logbase2(u8data, basis_bits)
     144    # Demo_div2_logbase2(u8data, basis_bits)
     145    Demo_bit_byte(u8data, basis_bits)
    122146
Note: See TracChangeset for help on using the changeset viewer.