Regex et sre_compile.py : sorry, but this version only supports 100 named groups
Bonjour,
Un collegue a moi a créé un script qui contient un regex, et lorsque je le lance j'obtient l'erreur :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| Traceback (most recent call last):
File "call_analyse.py", line 12, in <module>
res = an.analysephrase('la voiture blanche', 2)
File "/path/analyse_methodes.py", line 56, in analysephrase
resultat = analyseurdephrase.parser(sent,'cfg','lc')
File "/path/nltksentparser_methodes.py", line 75, in parser
tagger = nltk.RegexpTagger(self.pattern)
File "/usr/local/lib/python2.7/dist-packages/nltk/tag/sequential.py", line 469, in __init__
self._regexs = re.compile('|'.join(['(?P<%s>%s)' % (label, regex) for regex,label in regexps_labels]))
File "/usr/lib/python2.7/re.py", line 190, in compile
return _compile(pattern, flags)
File "/usr/lib/python2.7/re.py", line 243, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib/python2.7/sre_compile.py", line 511, in compile
"sorry, but this version only supports 100 named groups"
AssertionError: sorry, but this version only supports 100 named groups |
Et je ne sais pas quoi faire.
Et il utilise la bibliothèque NLTK.
Par contre le script fonctionne sur son Windows avec python 2.6 et 2.7.3 alors que moi j'ai le 2.7.1 sous ubuntu.
Merci