Skip to content

fix(lite): allow multiple *-full lazy dictionaries open at once (3.2.1) - #650

Merged
ddehilster merged 2 commits into
masterfrom
fix/multi-full-dictionaries
Jun 11, 2026
Merged

ddehilster merged 2 commits into
masterfrom
fix/multi-full-dictionaries

Conversation

@ddehilster

Copy link
Copy Markdown
Member

Problem

The lazy *-full dictionary loader (shipped in #649 / v3.2.0) kept a single open stream per kind — one fullDictStream_, one fullKBBStream_. Opening a second *-full.dict (e.g. en-firstnames-full.dict alongside en-full.dict) closed and replaced the first, so only the last-opened full dict stayed active. Words from the others never got their attributes attached.

Fix

Hold each kind in a std::list<FullFile> (stream + size + path + kbb root) and search across all open files, returning the first match. findFull{KBB,Dict}Word now loop over the list; the per-file binary search lives in search{KBB,Dict}File. (std::list, not vector, because std::ifstream isn't movable.)

The nested FullFile struct is declared and defined in a single access region so it compiles cleanly on GCC/Linux (the naive layout tripped MSVC C4240, which GCC rejects outright).

Verification

Ran the TestEnFullKbb analyzer with all three full files (en-full.kbb, en-full.dict, en-firstnames-full.dict) open at once:

  • David / Jim → ("name" "first") ("gender" "male") from en-firstnames-full.dict
  • ordinary words → pos + ("meaning" concept:…) from en-full.dict / en-full.kbb

Version bumped to 3.2.1.

🤖 Generated with Claude Code

ddehilster and others added 2 commits June 11, 2026 09:38
The lazy "*full" loader kept a single open stream per kind (one
fullDictStream_, one fullKBBStream_), so opening a second *-full.dict
(eg en-firstnames-full.dict alongside en-full.dict) closed and replaced
the first. Only the last-opened full dict stayed active, so words from
the others never got their attributes attached.

Hold each kind in a std::list<FullFile> (stream + size + path + kbb
root) and search across all open files, returning the first match.
findFull{KBB,Dict}Word now loop over the list; the per-file binary
search lives in search{KBB,Dict}File. Verified: David/Jim pick up
name/gender from en-firstnames-full.dict while other words still get
pos + meaning from en-full.dict/en-full.kbb.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ddehilster
ddehilster merged commit ff800d7 into master Jun 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant