Commit 7235407f39fd6d503409715d8117a58066e5ea31
1 parent
f6ac96aa
poprawienie błędu w typach segmentów
git-svn-id: svn://svn.nlp.ipipan.waw.pl/morfeusz/morfeusz@122 ff4e3ee1-f430-4e82-ade0-24591c43f1fd
Showing
1 changed file
with
6 additions
and
1 deletions
fsabuilder/morfeuszbuilder/tagset/segtypes.py
... | ... | @@ -99,7 +99,12 @@ class Segtypes(object): |
99 | 99 | |
100 | 100 | def _readLexemes(self, segrulesConfigFile): |
101 | 101 | for lineNum, line in segrulesConfigFile.enumerateLinesInSection('lexemes'): |
102 | - segtype, pattern = line.strip().split('\t') | |
102 | + split = re.split(re.escape('\s+'), line.strip()) | |
103 | + self._validate( | |
104 | + u'Line in [lexemes] section must contain exactly two fields - segment type and lexeme pattern', | |
105 | + lineNum, | |
106 | + len(split) == 2) | |
107 | + segtype, pattern = split | |
103 | 108 | self._validate( |
104 | 109 | u'Undeclared segment type: "%s"' % segtype, |
105 | 110 | lineNum, |
... | ... |