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

LUCENE-8933: Validate JapaneseTokenizer user dictionary entry (for 8.x) #810

Merged
merged 4 commits into from
Aug 14, 2019
Merged

LUCENE-8933: Validate JapaneseTokenizer user dictionary entry (for 8.x) #810

merged 4 commits into from
Aug 14, 2019

Conversation

mocobeta
Copy link
Contributor

Description

This adds a format check to Kuromoji user dictionary if the concatenated segment is not longer than its surface form. (For backwards compatibility, we check only segmentation length in 8.x and will add more strict equality check as of 9.0.) See https://issues.apache.org/jira/browse/LUCENE-8933

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left one comment regarding the test but the change looks good to me, thanks @mocobeta !

@@ -77,4 +78,11 @@ public void testRead() throws IOException {
UserDictionary dictionary = TestJapaneseTokenizer.readDict();
assertNotNull(dictionary);
}

@Test(expected = RuntimeException.class)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use expectThrows and check that the message is correct ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed.

@mocobeta mocobeta merged commit 0106b74 into apache:branch_8x Aug 14, 2019
@mocobeta mocobeta deleted the jira/LUCENE-8933-kuromoji-userdic-to-8x branch August 16, 2019 09:23
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.

2 participants