File: test8.py

package info (click to toggle)
hfst 3.16.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,532 kB
  • sloc: cpp: 101,875; sh: 6,717; python: 5,225; yacc: 4,985; lex: 2,900; makefile: 2,017; xml: 6
file content (12 lines) | stat: -rw-r--r-- 402 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
import libhfst
tr = libhfst.read_att_string('0 1 @0@ foo \n\
1 2 ' + libhfst.UNKNOWN + ' ' + libhfst.UNKNOWN + '\n\
2')
print('lookup with output formats tuple, text, raw:')
print(tr.lookup('b', output='tuple'))
print(tr.lookup('b', output='text'))
print(tr.lookup('b', output='raw'))

print(tr.extract_paths(output='dict'))
print(tr.extract_paths(output='text'))
print(tr.extract_paths(output='raw'))