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

options = hfst_commandline.hfst_getopt('', [], 0)
istr = hfst_commandline.get_one_hfst_input_stream(options)[0]
n=1
for tr in istr:
    ostr = hfst.HfstOutputStream(filename=str(n) + ".hfst", type=tr.get_type())
    ostr.write(tr)
    ostr.flush()
    ostr.close()
    n = n + 1
istr.close()