From 9ee498d4e773d4d09a26f393dc915208b4eea4a0 Mon Sep 17 00:00:00 2001 From: Paul Irwin Date: Mon, 28 Oct 2024 16:52:35 -0600 Subject: [PATCH] Add LUCENENET-specific backport comment --- .../Analysis/CommonGrams/CommonGramsFilterFactory.cs | 5 +++-- .../Analysis/Commongrams/TestCommonGramsFilterFactory.cs | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Lucene.Net.Analysis.Common/Analysis/CommonGrams/CommonGramsFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/CommonGrams/CommonGramsFilterFactory.cs index b18756c2ce..670151703d 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/CommonGrams/CommonGramsFilterFactory.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/CommonGrams/CommonGramsFilterFactory.cs @@ -71,7 +71,8 @@ public virtual void Inform(IResourceLoader loader) } else { - commonWords = new CharArraySet(m_luceneMatchVersion,StopAnalyzer.ENGLISH_STOP_WORDS_SET, ignoreCase); + // LUCENENET-specific: backported ignoreCase fix from Lucene 8.10.0 (lucene#188, LUCENE-10008) + commonWords = new CharArraySet(m_luceneMatchVersion, StopAnalyzer.ENGLISH_STOP_WORDS_SET, ignoreCase); } } @@ -85,4 +86,4 @@ public override TokenStream Create(TokenStream input) return commonGrams; } } -} \ No newline at end of file +} diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/TestCommonGramsFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/TestCommonGramsFilterFactory.cs index 5e75c52c1e..c568ffe115 100644 --- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/TestCommonGramsFilterFactory.cs +++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/TestCommonGramsFilterFactory.cs @@ -79,6 +79,7 @@ public virtual void TestDefaults() AssertTokenStreamContents(stream, new string[] { "testing", "testing_the", "the", "the_factory", "factory" }); } + // LUCENENET-specific: backported ignoreCase fix from Lucene 8.10.0 (lucene#188, LUCENE-10008) [Test] public void TestIgnoreCase() { @@ -93,8 +94,9 @@ public void TestIgnoreCase() Tokenizer tokenizer = new MockTokenizer(new StringReader("testing The factory"),MockTokenizer.WHITESPACE, false); TokenStream stream = factory.Create(tokenizer); AssertTokenStreamContents( - stream, new String[] {"testing", "testing_The", "The", "The_factory", "factory"}); + stream, new string[] {"testing", "testing_The", "The", "The_factory", "factory"}); } + /// /// Test that bogus arguments result in exception [Test] @@ -111,4 +113,4 @@ public virtual void TestBogusArguments() } } } -} \ No newline at end of file +}