SergeyKotyushkin opened a new issue #418:
URL: https://github.com/apache/lucenenet/issues/418


   Hello!
   
   Our hunspell aff file contains some rules for suffixes and prefixes that 
corrupt at the parsing.
   For example:
   ```
   SFX AA a b [c]d
   ```
   
   The condition `[c]d` is a correct regex expression but this rule does not 
work.
   The prblem is found in the hunspell dictionary class in the ParseAffix 
method ([place in 
code](https://github.com/apache/lucenenet/blob/f5cca0b1a7c855f2fe44a5cdd27763aab7acdf22/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs#L463)).
   
   We can see that if affix's condition starts with `[` and not ends with `]` 
then the `]` adds at the end of condition. So the condition become incorrect 
regex expression `[c]d]`.
   
   Maybe there the `!condition.EndsWith("]", StringComparison.Ordinal)` check 
should be replaced with the `condition.IndexOf("]", StringComparison.Ordinal) 
== -1` check. But I don't know about reasons of current version code. So I can 
be wrong.
   
   
   


----------------------------------------------------------------
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]


Reply via email to