-
Notifications
You must be signed in to change notification settings - Fork 41
Regex cache error in ConTextMarkup.py #13
Copy link
Copy link
Open
Description
In the following py file:
https://github.com/chapmanbe/pyConTextNLP/blob/master/pyConTextNLP/ConTextMarkup.py
From line 308~323, it tries to cache the compiled regulare expressions, by looking into the "Lex"(item.getLiteral()--line 321, 323).
While the cached regex is stored in COMPILED_REGEXPRS, which is outside the ConTextMarkup class but inside "ConTextMarkup" py file. So once "ConTextMarkup" is imported, it won't clear out by itself, even if you reinitiate an new ConTextMarkup object.
That means if you only change your "Rex", but not in "Lex", the previous compiled regular expression will be directly read instead of recompile it again.
This issue could cause troubles when editting rule files in some environments, like jupyter notebook .
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels