Uh oh!
There was an error while loading. Please reload this page.
docs(help): jsonwrite and jsonparse, and rewire JsonKB to the builtin - #204
Merged
Merged
Conversation
Engine side: VisualText/nlp-engine#712. spec/KBFuncs.nlp JsonKB becomes a one-line wrapper around the jsonwrite builtin. Its output is byte-identical, so nothing downstream changes, but the pass gets about 3x faster: serializing the KB is where a knowledge-base analyzer spends most of its time. On the date-time analyzer the thirteen-line output pass that calls JsonKB and SaveKB was 43.9% of total runtime, all of it inside interpreted NLP++. Kept as a wrapper rather than editing every analyzer's output.nlp. Note that analyzers carry their OWN copy of KBFuncs.nlp, so an existing analyzer picks this up when its copy is refreshed; newly created ones get it from the template automatically. JsonKBRecurse, JsonAttributes and JsonStr are left in place, with a note saying why: an analyzer may call them directly (JsonStr is useful on its own for escaping a string), and they document exactly what the builtin reproduces byte for byte. New pages jsonwrite.md, jsonparse.md, including the two long-standing quirks the builtin reproduces deliberately for byte compatibility -- the indent for level n is max(1,n) steps, and a concept name with interior digits is split at the wrong place when deciding whether it is a counted sibling. Also records the 3.8.1 python pass fix in the version notes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ddehilster added a commit
to VisualText/nlp-engine
that referenced
this pull request
Aug 4, 2026
Bumped in this PR rather than as a follow-up, because the help pages and the KBFuncs.nlp comment in VisualText/visualtext-files#204 already name 3.8.2 as the release that introduces jsonwrite and jsonparse. Leaving the constant at 3.8.1 would have made both of those wrong. A patch bump, following this repo's convention: 3.7.10, 3.7.12, 3.7.13 and 3.7.14 all shipped new features as patch releases within a minor line. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Docs and library side of VisualText/nlp-engine#712 (
jsonwrite/jsonparsebuiltins).spec/KBFuncs.nlp— JsonKB becomes a wrapperByte-identical output, ~3× faster on the pass. Serializing the KB is where a knowledge-base analyzer spends most of its time — on
date-time, the thirteen-lineoutput.nlpthat callsJsonKBandSaveKBwas 43.9% of total runtime.Scope, stated plainly: analyzers carry their own copy of
KBFuncs.nlp(13 in the analyzers repo, 21 bundled in the extension), and those copies already differ from this template. So this gives newly created analyzers the speedup automatically; an existing analyzer gets it when its copy is refreshed. It is not a silent global upgrade.JsonKBRecurse,JsonAttributesandJsonStrare left in place with a note explaining why — an analyzer may call them directly (JsonStris independently useful for escaping), and they document exactly what the builtin reproduces.New pages
jsonwrite.mdandjsonparse.md, including the mapping table and the two quirks the builtin reproduces deliberately for byte compatibility:max(1,n)steps, not nBoth are documented rather than silently fixed, because changing either would alter existing analyzers' output files.
jsonparsealso documents why it exists beyond convenience: thejson2kbbPython pass needs Python on the machine — which the npm and pypi distributions do not provide — and it won't overwrite an existing.kbb, so editing the.jsonappears to do nothing until you delete it.Version notes also record the 3.8.1 python-pass fix.
🤖 Generated with Claude Code