File: hfst-reverse.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 (17 lines) | stat: -rw-r--r-- 385 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import hfst
import hfst_commandline

short_getopts=''
long_getopts=[]
options = hfst_commandline.hfst_getopt(short_getopts, long_getopts, 1)
istr = hfst_commandline.get_one_hfst_input_stream(options)
ostr = hfst.HfstOutputStream(type=istr.get_type())

while(not istr.is_eof()):
    tr = istr.read()
    tr.reverse()
    tr.write(ostr)
    ostr.flush()
      
istr.close()
ostr.close()