Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable MorphemeConsumerAttribute (+bug fix) #122

Merged
merged 8 commits into from
May 24, 2024

Conversation

mh-northlander
Copy link
Collaborator

fix #111, fix #116. relates to #110

Disable MorphemeConsumerAttribute.
MorphemeConsumerAttribute (MCA) suggests which sudachi-filter should set the CharTermAttribute. Only the last filter with MCA sets it.
This makes CharTermAtt empty until the last filter, thus filters like stopword-filter or synonym-filter that use termAtt doesn't work correctly when there is a filter with MCA after it.
We need to consider how MCA should behave, but for now I disabled it.

Fix MorphemeAttribute.copyTo.
copyTo method should copy current state into target attribute.

Fix POSFilter with null morpheme.
Morpheme attribute may have null morpheme (e.g. token added by synonym filter).
POSFilter should work in that case too, accepting them since no pos is available.

Copy link

sonarcloud bot commented May 24, 2024

@mh-northlander
Copy link
Collaborator Author

This will also fix #117, where synonym filter doesn't work correctly with empty term attibure caused by MCA.

@mh-northlander mh-northlander linked an issue May 24, 2024 that may be closed by this pull request
@mh-northlander mh-northlander merged commit 28d6e94 into develop May 24, 2024
25 checks passed
@mh-northlander mh-northlander deleted the feature/issue111 branch May 24, 2024 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants