Akron | b6efc73 | 2022-03-17 15:03:56 +0100 | [diff] [blame^] | 1 | import Cutter |
2 | import sys | ||||
3 | |||||
4 | sys.setrecursionlimit(100000) | ||||
5 | |||||
6 | cutter = Cutter.Cutter(profile='de') | ||||
7 | |||||
8 | sent = sys.argv[1] | ||||
9 | |||||
10 | file = open(sys.argv[2], 'r') | ||||
11 | |||||
12 | text = file.read() | ||||
13 | |||||
14 | file.close() | ||||
15 | |||||
16 | for token in cutter.cut(text): | ||||
17 | if token[0]: | ||||
18 | print(token[0]) | ||||
19 | |||||
20 | if sent == "sent": | ||||
21 | if token[1].startswith("+EOS"): | ||||
22 | print("</eos>") |