| Index: lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java |
| =================================================================== |
| --- lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java (revision 1603002) |
| +++ lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java (working copy) |
| @@ -420,7 +420,7 @@ |
| |
| String condition = ruleArgs.length > 4 ? ruleArgs[4] : "."; |
| // at least the gascon affix file has this issue |
| - if (condition.startsWith("[") && !condition.endsWith("]")) { |
| + if (condition.startsWith("[") && condition.indexOf(']') == -1) { |
| condition = condition + "]"; |
| } |
| // "dash hasn't got special meaning" (we must escape it) |
| Index: lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestCondition2.java |
| =================================================================== |
| --- lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestCondition2.java (revision 0) |
| +++ lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestCondition2.java (working copy) |
| @@ -0,0 +1,32 @@ |
| +package org.apache.lucene.analysis.hunspell; |
| + |
| +import org.junit.BeforeClass; |
| + |
| +/* |
| + * Licensed to the Apache Software Foundation (ASF) under one or more |
| + * contributor license agreements. See the NOTICE file distributed with |
| + * this work for additional information regarding copyright ownership. |
| + * The ASF licenses this file to You under the Apache License, Version 2.0 |
| + * (the "License"); you may not use this file except in compliance with |
| + * the License. You may obtain a copy of the License at |
| + * |
| + * http://www.apache.org/licenses/LICENSE-2.0 |
| + * |
| + * Unless required by applicable law or agreed to in writing, software |
| + * distributed under the License is distributed on an "AS IS" BASIS, |
| + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| + * See the License for the specific language governing permissions and |
| + * limitations under the License. |
| + */ |
| + |
| +public class TestCondition2 extends StemmerTestBase { |
| + |
| + @BeforeClass |
| + public static void beforeClass() throws Exception { |
| + init("condition2.aff", "condition2.dic"); |
| + } |
| + |
| + public void testStemming() { |
| + assertStemsTo("monopolies", "monopoly"); |
| + } |
| +} |
| |
| Property changes on: lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestCondition2.java |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| ## -0,0 +1 ## |
| +native |
| \ No newline at end of property |
| Index: lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/condition2.aff |
| =================================================================== |
| --- lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/condition2.aff (revision 0) |
| +++ lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/condition2.aff (working copy) |
| @@ -0,0 +1,5 @@ |
| +SET ISO8859-1 |
| +TRY esianrtolcdugmphbyfvkwzESIANRTOLCDUGMPHBYFVKWZ' |
| + |
| +SFX S Y 1 |
| +SFX S y ies [^aeiou]y |
| Index: lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/condition2.dic |
| =================================================================== |
| --- lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/condition2.dic (revision 0) |
| +++ lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/condition2.dic (working copy) |
| @@ -0,0 +1,2 @@ |
| +1 |
| +monopoly/S |