From 84b09f34ed62ade2b26ce6df76c216135dbea57b Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Tue, 3 Feb 2026 11:38:02 -0300 Subject: [PATCH] atlasbot: centralize token length --- atlasbot/engine/answerer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/atlasbot/engine/answerer.py b/atlasbot/engine/answerer.py index 7936fd1..39a6d6e 100644 --- a/atlasbot/engine/answerer.py +++ b/atlasbot/engine/answerer.py @@ -18,6 +18,7 @@ from atlasbot.state.store import ClaimStore log = logging.getLogger(__name__) FOLLOWUP_SHORT_WORDS = 6 +TOKEN_MIN_LEN = 3 NS_ENTRY_MIN_LEN = 2 DEDUP_MIN_SENTENCES = 3 TOKEN_MIN_LEN = 3 @@ -1514,7 +1515,7 @@ def _expand_tokens(tokens: list[str]) -> list[str]: if not isinstance(token, str): continue for part in re.split(r"[^a-zA-Z0-9_-]+", token.lower()): - if len(part) < 3: + if len(part) < TOKEN_MIN_LEN: continue if part not in expanded: expanded.append(part)