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 .
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 .