Repository navigation
NLP_ENGINE::setDatum and nlp -DATUM pass G("$datum") to analyzers (4.2.36) - #794
Merged
Merged
Conversation
…2.36)
NLP::analyze has always taken a datum that analyzers read as
G("$datum"), but NLP_ENGINE passed none (NULL in the stream API, the
default in the file and buffer ones). setDatum stores a string every
later analysis on that engine receives; nlp -DATUM value sets it from
the command line. For VisualText/py-package-nlpengine#1 (the caller
names the output type it wants).
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.
The engine side of VisualText/py-package-nlpengine#1 ("Add output type to NLP Engine call: use the datum feature already in the engine").
NLP::analyzehas long taken adatumstring that analyzers read asG("$datum"), butNLP_ENGINEnever passed one. The stream API (which Python uses) hard-codedNULL, and the file and buffer paths left it at the default.NLP_ENGINE::setDatum(const _TCHAR*)/getDatum(): every later analysis on that engine gets the string asG("$datum"). An empty string means none, as before.analyzepaths pass it through.nlp -DATUM valuesets it from the command line, for examplenlp -ANA myana -DATUM json input.txt. The usage text lists it.m_datumis the last member ofNLP_ENGINE, so nothing before it moves.Without the flag, analyzers behave as before:
G("$datum")reads0, like any unset value.Next: once this is released, the NLPPlus binding passes a
datum=argument throughsetDatum. That PR follows the release.Tests:
tests/datumwith CI steps on Windows and Linux. It runs-DATUM jsonand-DATUM xmland checks the analyzer printeddatum=[json]anddatum=[xml].$GITHUB_WORKSPACEand always fails locally.🤖 Generated with Claude Code