v0.7.9 detection audit: inflection, domains, and collision fixes - #3
Merged
Merged
Conversation
…r-detection, offline 划词翻译
Under-detection (the dictionary was on, the words were in it, and no
card ever appeared):
- Expression inflection now covers the FIRST word as well as the last,
e-aware ("circle" -> circl(?:e|es|ed|ing)) — phrasal idioms inflect
their leading verb, so "circling back", "pushed back", "reads the
room" all used to miss unless a data author had hand-listed the
variant. The bare "-d" suffix is dropped from non-e endings (it only
ever manufactured false surfaces like "quick wind").
- Terms get light plural tolerance: lowercase headwords >=5 chars take
(?:s|es)? ("epochs", "tokens", "harnesses", "premiums"), all-caps
acronyms take a case-sensitive trailing "s" ("KPIs", "PRs"). Short
ambiguous headwords stay exact ("mean" never matches "means"). Verby
terms list their forms as explicit variants (churn, hallucinate).
- Entry-level `domains` hints (DictTermEntry/DictExpressionEntry) for
cross-domain packs: unambiguous modern-usage AI terms (RAG, MCP,
context window, ...) now count as domain-tracker evidence toward
"ml", and the pack's commonWord entries (agent, harness, wrapper,
compute, checkpoint, ...) unlock once a listed domain is active —
previously unreachable under the default all-on pack state, even in
a meeting saturated with AI vocabulary. Unambiguous core business
metrics (ARR, MRR, GTM, ...) likewise activate sales/finance, which
also strengthens multi-sense picks (team alignment, CAC, NDA) and
unlocks finance-consumer common words in funding conversations.
commonWord hits are never emitted as evidence (an everyday sense must
not activate a domain). Remote packs can carry `domains` too
(validated against DOMAIN_TAGS, capped at 4).
Detection conflicts (multiple dictionaries describing the same word):
- The expression loop gets the same F1 conflict handling terms already
had: remote packs iterate first and the first entry to match claims
the normalized key — a remote pack redefining "circle back" used to
produce TWO cards for one occurrence, with the built-in winning the
merge over the user's explicitly installed pack.
- Explicit lookups (includeAllPackMatches) collapse near-duplicate
re-authorings of the same fact — same key AND matching zh or
normalized-en gloss — so "ROI" no longer renders core's and
business-terms' near-identical cards, while genuine cross-pack sense
splits (SAM the market metric vs. SAM the alignment format) still
show every sense.
Offline 划词翻译:
- Selection lookups now translate the selected surface whenever the
language pair differs, independent of aiDetect and of a dictionary
hit — the configured provider may be fully local (system/on-device),
so lookups work with AI off and zero keys. On a hit the translation
upgrades the already-rendered entry in place; on a miss it registers
an honest 翻译所选 task. NoKeyError and provider-unavailable quietly
omit the line; a cold on-device model gets one bounded retry.
- The personal glossary (我的词典) is searched first: a personal entry
deliberately shadows the built-in dictionary inside scanDictionary,
so a word the user had saved themselves used to come back as
"词典未收录". Display-only — the transcript scan still owns emitting
and counting custom cards.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013NWYJSE7af6gYR5FciXQ3o
mianaz
force-pushed
the
claude/jargonslayer-detection-conflicts-lqyyc9
branch
from
September 1, 2026 18:58
67b9d79 to
ca4b4af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements comprehensive improvements to dictionary detection, domain tracking, and collision handling based on the v0.7.9 detection audit. The changes focus on fixing under-detection issues with phrasal idioms, improving domain-based common word suppression, and ensuring deterministic behavior when multiple packs define the same entry.
Key Changes
Expression Inflection (Under-detection Fix)
Entry-Level Domain Hints
domains?: DomainTag[]field toDictTermEntryandDictExpressionEntryto support cross-domain packs (like modern-usage) that aren't mapped inPACK_DOMAINS.Term Inflection and Pluralization
Cross-Pack Collision Resolution
Selection Lookup Improvements
Domain Tracking
domainsare now counted toward domain activation, allowing cross-domain packs to contribute evidence.Notable Implementation Details
inflectedWordPattern()function encapsulates the e-aware inflection logic for reuse across expressions.buildExpressionRegex()now applies inflection to both first and last words via a unified pattern function.shouldIncludeCommonWord()checks entry-level domains before falling back to pack-levelPACK_DOMAINS.translateSelection()implements bounded retry for cold-start scenarios (on-device model priming).clampDomains().https://claude.ai/code/session_013NWYJSE7af6gYR5FciXQ3o