Changeset 25
- Timestamp:
- 01/19/08 06:09:29 (2 years ago)
- Files:
-
- trunk/Scripts/Contributed/FontLabTokenize.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Scripts/Contributed/FontLabTokenize.py
r24 r25 7 7 lossless reverse function. Sample usage (and actual test suite): 8 8 9 tokenize('/A/B/C')9 >>> tokenize('/A/B/C') 10 10 ['/A', '/B', '/C'] 11 tokenize('abcde/B/C')11 >>> tokenize('abcde/B/C') 12 12 ['a', 'b', 'c', 'd', 'e', '/B', '/C'] 13 tokenize('foo/A.smcp/B.smcp abc')13 >>> tokenize('foo/A.smcp/B.smcp abc') 14 14 ['f', 'o', 'o', '/A.smcp', '/B.smcp', 'a', 'b', 'c'] 15 p = ['f', 'o', 'o', '/A.smcp', '/B.smcp', 'a', 'b', 'c']16 serialize(p)15 >>> p = ['f', 'o', 'o', '/A.smcp', '/B.smcp', 'a', 'b', 'c'] 16 >>> serialize(p) 17 17 'foo/A.smcp/B.smcp abc' 18 tokenize('/a /b /c')18 >>> tokenize('/a /b /c') 19 19 ['/a', '/b', '/c'] 20 tokenize('/a/b c')20 >>> tokenize('/a/b c') 21 21 ['/a', '/b', 'c'] 22 tokenize('@a@b@')22 >>> tokenize('@a@b@') 23 23 ['@', 'a', '@', 'b', '@'] 24 tokenize('abc def ghi ')24 >>> tokenize('abc def ghi ') 25 25 ['a', 'b', 'c', ' ', 'd', 'e', 'f', ' ', 'g', 'h', 'i', ' '] 26 p = ['a', 'b', 'c', ' ', 'd', 'e', 'f', ' ', 'g', 'h', 'i', ' ']27 serialize(p)26 >>> p = ['a', 'b', 'c', ' ', 'd', 'e', 'f', ' ', 'g', 'h', 'i', ' '] 27 >>> serialize(p) 28 28 'abc def ghi ' 29 serialize(['/a', 'b', '/c', 'd'])29 >>> serialize(['/a', 'b', '/c', 'd']) 30 30 '/a b/c d' 31 31 """
