SergeyKotyushkin commented on issue #418: URL: https://github.com/apache/lucenenet/issues/418#issuecomment-778261270
> Thanks for the report. > > Hunspell was one of the most difficult analyzers to port to .NET. As a result it is not clear if this problem is a bug caused during the port or if this is a preexisting Lucene bug. Could you provide a unit test or other working code example demonstrating the problem so we can port it back to Java to check whether this bug also exists in Lucene? If you allow I write scenario right here in comment. _condition-issue-418.aff_ ``` SET UTF-8 TRY esianrtolcdugmphbyfvkwzESIANRTOLCDUGMPHBYFVKWZ’ PFX A Y 1 PFX A 0 re [w]o SFX B Y 1 SFX B 0 ed [r]k ``` _condition-issue-418.dic_ ``` 1 work/AB ``` _TestConditionIssue418.cs_ (it is based on [TestCondition.cs](https://github.com/apache/lucenenet/blob/f5cca0b1a7c855f2fe44a5cdd27763aab7acdf22/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestCondition.cs)) ```cs public class TestConditionIssue418 : StemmerTestBase { [OneTimeSetUp] public override void BeforeClass() { base.BeforeClass(); Init("condition-issue-418.aff", "condition-issue-418.dic"); } [Test] public virtual void TestStemming() { AssertStemsTo("rework", "work"); AssertStemsTo("worked", "work"); } } ``` Both these test fail. But if we change [here](https://github.com/apache/lucenenet/blob/f5cca0b1a7c855f2fe44a5cdd27763aab7acdf22/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs#L463) the condition ```cs condition.StartsWith("[", StringComparison.Ordinal) && !condition.EndsWith("]", StringComparison.Ordinal) ``` on another one ```cs condition.StartsWith("[", StringComparison.Ordinal) && condition.IndexOf("]", StringComparison.Ordinal) == -1 ``` then they work. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
