Skip to content

Commit 1b75a26

Browse files
committed
feat(mentions): normalize plus-sign variants in token matching
1 parent d843920 commit 1b75a26

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

backend/src/null_engine/services/mention_extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
def _normalize(text: str) -> str:
2727
normalized = text.lower().strip()
28-
for token in ("-", "_", "/", ".", ",", "!", "?", ":", ";", "(", ")", "[", "]", "{", "}", "\"", "'", "&", "&"):
28+
for token in ("-", "_", "/", ".", ",", "!", "?", ":", ";", "(", ")", "[", "]", "{", "}", "\"", "'", "&", "&", "+", "+"):
2929
normalized = normalized.replace(token, " ")
3030
return " ".join(normalized.split())
3131

backend/tests/test_mention_extractor_unit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ def test_normalize_collapses_punctuation_and_spaces() -> None:
55
assert _normalize(" Roman-Empire!! ") == "roman empire"
66
assert _normalize("Dune/Prophecy") == "dune prophecy"
77
assert _normalize("Law & Order") == "law order"
8+
assert _normalize("Chaos + Order") == "chaos order"
89

910

1011
def test_fuzzy_match_handles_punctuation_variants() -> None:

0 commit comments

Comments
 (0)