Repository navigation
analyze() takes a datum (#1) - #48
Merged
Merged
Conversation
analyze(text, analyzer, datum="json") hands the string to the analyzer
as G("$datum") for that call, eg the output format the caller wants.
The engine has had NLP_ENGINE::setDatum (and nlp -DATUM) since 4.2.x;
the binding never called it, so G("$datum") was always 0 from Python.
Each call sets its own datum: None (the default) clears it.
tests/analyzers/datum echoes G("$datum") to the output buffer.
Closes #1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
package-analyzers a53e9e2 and the zone rework now split "kenethfpp at mails dot yahoo dot uk" into subdomain/domainname/cd and keep the local part of "charitysc123 at 243 dot org". The stored output predated both, so test_emailaddress_parser failed on every PR (also VisualText#47). Regenerated with nlp 4.2.48 and the pinned package-analyzers commit. 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.
Closes #1.
NLPPlus.analyze(text, analyzer, datum="json")now passes the string to the analyzer asG("$datum")for that one call, for example to choose an output format.The engine has had
NLP_ENGINE::setDatum()(andnlp -DATUM) for a while, but the binding never called it, soG("$datum")was always 0 from Python.bindings.cpp:wrap_analyzetakesdatum(default"") and callsengine.setDatum()before every analysis, so a value never carries over to the next call.Engine.analyze()and the module-levelanalyze()takedatum: Optional[str] = None.tests/analyzers/datumechoesG("$datum"), ornonewhen it is unset.DatumTestchecksjson, thenxml, then no datum.This overlaps #47 (
timeout), which also adds an argument towrap_analyzeand to bothanalyze()signatures. Whichever merges second needs a small rebase. Both arguments are keyword-style with defaults, so they don't otherwise interact.Not built locally; CI builds the wheel and runs the tests.
🤖 Generated with Claude Code