Skip to content

NLP_ENGINE::setDatum and nlp -DATUM pass G("$datum") to analyzers (4.2.36) - #794

Merged
ddehilster merged 1 commit into
masterfrom
feature/datum-py1
Oct 15, 2026
Merged

ddehilster merged 1 commit into
masterfrom
feature/datum-py1

Conversation

@ddehilster

Copy link
Copy Markdown
Member

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::analyze has long taken a datum string that analyzers read as G("$datum"), but NLP_ENGINE never passed one. The stream API (which Python uses) hard-coded NULL, 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 as G("$datum"). An empty string means none, as before.
  • All three analyze paths pass it through.
  • nlp -DATUM value sets it from the command line, for example nlp -ANA myana -DATUM json input.txt. The usage text lists it.
  • m_datum is the last member of NLP_ENGINE, so nothing before it moves.

Without the flag, analyzers behave as before: G("$datum") reads 0, like any unset value.

Next: once this is released, the NLPPlus binding passes a datum= argument through setDatum. That PR follows the release.

Tests:

  • New fixture tests/datum with CI steps on Windows and Linux. It runs -DATUM json and -DATUM xml and checks the analyzer printed datum=[json] and datum=[xml].
  • Local: 49/50 CI steps pass. The compiled-bridge step needs $GITHUB_WORKSPACE and always fails locally.
  • Full English Test: unchanged.
  • 20 analyzers × 21 inputs: 0 differences.

🤖 Generated with Claude Code

…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>
@ddehilster
ddehilster merged commit 1784d96 into master Oct 15, 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