|
$ ln -sf tokendefs1.txt tokendefs.txt |
|
$ ./alphaparse.py |
|
1: ['A'] |
|
|
|
11: ['AA', 'K'] |
|
|
|
111: ['AAA', 'AK', 'KA'] |
|
|
|
1111: ['AAAA', 'AAK', 'AKA', 'KAA', 'KK'] |
|
|
|
1234: ['ABCF', 'AWF', 'LCF'] |
|
|
|
$ ./alphaparse.py --verbose |
|
input: 1 |
|
output: A |
|
tokens: [('A', '1')] |
|
|
|
input: 11 |
|
output: AA |
|
tokens: [('A', '1'), ('A', '1')] |
|
output: K |
|
tokens: [('K', '11')] |
|
|
|
input: 111 |
|
output: AAA |
|
tokens: [('A', '1'), ('A', '1'), ('A', '1')] |
|
output: AK |
|
tokens: [('A', '1'), ('K', '11')] |
|
output: KA |
|
tokens: [('K', '11'), ('A', '1')] |
|
|
|
input: 1111 |
|
output: AAAA |
|
tokens: [('A', '1'), ('A', '1'), ('A', '1'), ('A', '1')] |
|
output: AAK |
|
tokens: [('A', '1'), ('A', '1'), ('K', '11')] |
|
output: AKA |
|
tokens: [('A', '1'), ('K', '11'), ('A', '1')] |
|
output: KAA |
|
tokens: [('K', '11'), ('A', '1'), ('A', '1')] |
|
output: KK |
|
tokens: [('K', '11'), ('K', '11')] |
|
|
|
input: 1234 |
|
output: ABCF |
|
tokens: [('A', '1'), ('B', '2'), ('C', '3'), ('F', '4')] |
|
output: AWF |
|
tokens: [('A', '1'), ('W', '23'), ('F', '4')] |
|
output: LCF |
|
tokens: [('L', '12'), ('C', '3'), ('F', '4')] |
|
|
|
$ ln -sf tokendefs2.txt tokendefs.txt |
|
$ ./alphaparse.py --verbose moo |
|
input: moo |
|
output: MOO |
|
tokens: [('MOO', 'moo')] |
|
output: MOO |
|
tokens: [('M', 'm'), ('O', 'o'), ('O', 'o')] |
|
output: MOO |
|
tokens: [('M', 'm'), ('OO', 'oo')] |
|
|
|
$ ./alphaparse.py --verbose moooo |
|
input: moooo |
|
output: MOO |
|
tokens: [('MOO', 'moooo')] |
|
output: MOOOO |
|
tokens: [('M', 'm'), ('O', 'o'), ('O', 'o'), ('O', 'o'), ('O', 'o')] |
|
output: MOOOO |
|
tokens: [('M', 'm'), ('O', 'o'), ('O', 'o'), ('OO', 'oo')] |
|
output: MOOOO |
|
tokens: [('M', 'm'), ('O', 'o'), ('OO', 'oo'), ('O', 'o')] |
|
output: MOOOO |
|
tokens: [('M', 'm'), ('OO', 'oo'), ('O', 'o'), ('O', 'o')] |
|
output: MOOOO |
|
tokens: [('M', 'm'), ('OO', 'oo'), ('OO', 'oo')] |
|
|
|
$ ln -sf tokendefs3.txt tokendefs.txt |
|
$ ./alphaparse.py --verbose 4242 |
|
input: 4242 |
|
output: FourTwoFourTwo |
|
tokens: [('Four', '4'), ('Two', '2'), ('Four', '4'), ('Two', '2')] |
|
output: FourTwoEureka! |
|
tokens: [('Four', '4'), ('Two', '2'), ('Eureka!', '42')] |
|
output: Eureka!FourTwo |
|
tokens: [('Eureka!', '42'), ('Four', '4'), ('Two', '2')] |
|
output: Eureka!Eureka! |
|
tokens: [('Eureka!', '42'), ('Eureka!', '42')] |