Repository navigation
Use each instrument's language for negation instead of always English (#142) - #143
Merged
woodthom2 merged 1 commit intoOct 12, 2026
Merged
Conversation
…harmonydata#142) process_questions hardcoded negate(question_text, 'en'), so the pt, es, it, fr and de rules in negator.py never ran during matching. Map each question text to its instrument's language field and pass that through, defaulting to "en". No language detection is run.
Contributor
|
Thanks so much! Feel free to submit a PR with Urdu rules |
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.
Description
process_questionshardcodednegate(question_text, 'en'), so the pt, es, it, fr and de rules innegator.pynever ran during matching. This maps each question text to its instrument'slanguagefield and passes it through, defaulting to"en". No language detection is run, so nothing is detected repeatedly on the same text.Only
matcher.pyis changed, plus one new test file. No new dependencies.Urdu negation rules will follow in a separate PR.
Fixes #142
Type of change
Testing
Added
tests/test_negation_language.py: checks that a Portuguese item is negated with Portuguese rules, and that the default stays English.Ran locally:
test_negation_language.py,test_negator.py,test_match_negative_polarity.py, 16 passed.I have not yet run the Harmony API tests.
Test Configuration
Checklist