We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8bf940f commit 973bd62Copy full SHA for 973bd62
1 file changed
mempalace/palace.py
@@ -147,10 +147,12 @@ def _candidate_entity_words(text: str) -> list:
147
from .i18n import get_entity_patterns
148
149
patterns = get_entity_patterns(MempalaceConfig().entity_languages)
150
+ # candidate_patterns are pre-wrapped with boundary + capture group
151
+ # by get_entity_patterns (#932), compile directly without re-wrapping.
152
rxs = []
- for raw_pat in patterns["candidate_patterns"]:
153
+ for pat in patterns["candidate_patterns"]:
154
try:
- rxs.append(re.compile(rf"\b({raw_pat})\b"))
155
+ rxs.append(re.compile(pat))
156
except re.error:
157
continue
158
_CANDIDATE_RX_CACHE = rxs
0 commit comments