Commit a8abd160dcbb0de106f8a09be2e428e509218a78
1 parent
4a94bb68
dodanie pliku separatorChars.py
git-svn-id: svn://svn.nlp.ipipan.waw.pl/morfeusz/morfeusz@148 ff4e3ee1-f430-4e82-ade0-24591c43f1fd
Showing
1 changed file
with
21 additions
and
0 deletions
fsabuilder/morfeuszbuilder/segrules/separatorChars.py
0 → 100644
1 | +''' | |
2 | +Created on 3 kwi 2014 | |
3 | + | |
4 | +@author: mlenart | |
5 | +''' | |
6 | + | |
7 | +from morfeuszbuilder.utils import exceptions | |
8 | + | |
9 | +def parseSeparatorChars(segtypesConfigFile): | |
10 | + res = [] | |
11 | + for lineNum, line in segtypesConfigFile.enumerateLinesInSection('separator chars', ignoreComments=True): | |
12 | + try: | |
13 | + cp = int(line) | |
14 | + res.append(cp) | |
15 | + except ValueError as ex: | |
16 | + raise exceptions.ConfigFileException( | |
17 | + segtypesConfigFile.filename, | |
18 | + lineNum, | |
19 | + str(ex)) | |
20 | + return res | |
21 | + | |
0 | 22 | \ No newline at end of file |
... | ... |