Repository navigation
Lazy *full.kbb keys found from any pass; << writes to absolute paths (4.2.39) - #798
Merged
ddehilster merged 2 commits intoOct 20, 2026
Merged
Conversation
The output operator appended every file name to the input's _log folder,
so an absolute path, like G("$apppath") + "/out.txt", became
<_log>/C:/.../out.txt. The open failed, nothing checked it, and every
write was dropped with no message. jsonwrite's help already says an
absolute path is used as given, and openfile() works that way.
Var::filevar now uses a path that starts with "/", "\" or a drive letter
as given. A relative name still goes in the _log folder. If the file
can't be opened, it says so once, in err.log and on stderr, and later
writes to that name do nothing. The path was also formatted into a
MAXSTR buffer with no bound; it is a std::string now.
Fixture output-path covers both kinds of path and a bad one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A *full.kbb stays on disk and is binary-searched one key at a time, but
only the tokenizer and dictfindword() reached that search. A later pass
calling findconcept() on the file's top concept found only keys the
tokenizer had happened to load, and down()/next() listed only those. An
ICD analyzer had to call dictfindword() before every lookup, and a scan
of its head words silently missed codes.
- findconcept() and getconcept() search the file on a miss under its
top concept, build the key's whole block, and return it. Misses are
remembered per file. A key with a space, which SaveKB writes quoted
("heart attack":), is found too.
- down(), and findconcept() by position, load the whole file the first
time, so every key is listed once. Keys already loaded are not built
twice.
- The tokenizer and dictfindword() search only dictionary files: a
*full.kbb whose top concept is "dictionary", or that has a same-stem
.dict twin (en-full.kbb with en-full.dict, linked as before). A domain
KB such as an ICD index is no longer searched for every token and
spelling candidate, which made a spell pass go from 0.1 s to 12 s,
and its keys are no longer registered as dictionary words.
Fixture kbb-lazy-lookup checks each of these. With the shipped
en-full.kbb, en-full.dict and en-synonyms-full.kbb, the dicttokz parse
tree of 15x doj.txt is byte-identical to 4.3.15's.
The new CI step runs kbb-lazy-lookup and output-path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ddehilster
added a commit
to VisualText/visualtext-files
that referenced
this pull request
Oct 20, 2026
… 4.2.39) lazyload.md gets a section on looking up keys from any pass. findconcept and getconcept search a lazy file for a key not in memory yet, down loads the whole file the first time, and the tokenizer and dictfindword search only dictionary files: top concept "dictionary", or a same-named .dict beside the .kbb. Its lemma example was run against the shipped en-lemmas-full.kbb. findconcept, getconcept, down and dictfindword each get a remark that links to it. fileout says an absolute path now works with <<. New_in_Current_Version gets a 4.2.39 entry. Engine PR: VisualText/nlp-engine#798. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Two fixes found while building the ICD-10 analyzers. Both used to fail silently.
Lazy
*full.kbbkeys from any passA
*full.kbbstays on disk and is searched one key at a time, but only the tokenizer anddictfindword()could reach that search. A later pass callingfindconcept()on the file's top concept found only keys the tokenizer had happened to load.down()andnext()listed only those keys, so a scan of ICD head words silently missed codes.findconcept()/getconcept(): on a miss under a lazy file's top concept, they search that file and load the key with its whole block. Misses are remembered per file. Keys with a space, whichSaveKBwrites quoted ("heart attack":), are found too.down(): the first call loads the whole file, so every key is listed once and keys already loaded aren't built twice.findconcept()by position does the same.dictfindword(): they now search a*full.kbbonly if its top concept isdictionaryor it has a same-stem.dicttwin, soen-full.kbbwithen-full.dictworks as before. A domain KB such as an ICD index is no longer searched for every token and spelling candidate; that search took a spell pass from 0.1 s to 12 s. Its keys are also no longer registered as dictionary words.dictfindword()no longer finds keys in domain files such asen-synonyms-full.kbb. Usefindconcept()on the file's top concept instead."path" << xwrites to an absolute pathThe output operator put every file name under the input's
_logfolder, soG("$apppath") + "/out.txt"became<_log>/C:/.../out.txt. The open failed, nothing checked it, and every write was dropped with no message./,\or a drive letter) is now used as given, asopenfile()already does. A relative name still goes in_log.err.logand on stderr.std::string.Tests
kbb-lazy-lookup(nine checks) andoutput-path, run by one new step on Linux, Windows and macOS. On 4.3.15,kbb-lazy-lookupfails at its first check and stops at thekilolookup.en-full.kbb,en-full.dictanden-synonyms-full.kbb, the dicttokz parse tree of 15 copies ofdoj.txtis byte-identical to 4.3.15's.🤖 Generated with Claude Code