mkhludnev commented on code in PR #16680:
URL: https://github.com/apache/lucene/pull/16680#discussion_r4053316740
##########
lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestCompoundWordTokenFilter.java:
##########
@@ -261,6 +261,34 @@ public void testDumbCompoundWordsSELongestMatch() throws
Exception {
new int[] {1, 0, 0, 0, 0, 0});
}
+ public void testTypeOnExtractedWord() throws Exception {
+ CharArraySet dict = makeDictionary("Schlüssel", "Kasten");
+
+ DictionaryCompoundWordTokenFilter tf =
+ new DictionaryCompoundWordTokenFilter(
+ whitespaceMockTokenizer("Schlüsselkasten"),
+ dict,
+ CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE,
+ CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE,
+ CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE,
+ true);
+
+ String[] output = {"Schlüsselkasten", "Schlüssel", "kasten"};
+ assertTokenStreamContents(
+ tf,
+ output,
+ new int[] {0, 0, 0},
+ new int[] {15, 15, 15},
+ new String[] {
+ "word",
+ CompoundWordTokenFilterBase.TOKEN_TYPE_SUBWORD,
+ CompoundWordTokenFilterBase.TOKEN_TYPE_SUBWORD
Review Comment:
There's a conception to substituting constant to tests that let to detect a
change in constant value which may break a client otherwise.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]