LUCENE-4877: fix minor analyzer factory issues

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1463232 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2013-04-01 18:13:15 +00:00
parent 54f8c01026
commit e26f9c49ef
3 changed files with 5 additions and 12 deletions

View File

@ -40,8 +40,8 @@ public class EdgeNGramTokenizerFactory extends TokenizerFactory {
/** Creates a new EdgeNGramTokenizerFactory */
public EdgeNGramTokenizerFactory(Map<String, String> args) {
super(args);
minGramSize = getInt(args, "minGramSize", EdgeNGramTokenFilter.DEFAULT_MIN_GRAM_SIZE);
maxGramSize = getInt(args, "maxGramSize", EdgeNGramTokenFilter.DEFAULT_MAX_GRAM_SIZE);
minGramSize = getInt(args, "minGramSize", EdgeNGramTokenizer.DEFAULT_MIN_GRAM_SIZE);
maxGramSize = getInt(args, "maxGramSize", EdgeNGramTokenizer.DEFAULT_MAX_GRAM_SIZE);
String sideArg = args.remove("side");
if (sideArg == null) {

View File

@ -71,13 +71,8 @@ public class PatternTokenizerFactory extends TokenizerFactory {
public PatternTokenizerFactory(Map<String,String> args) {
super(args);
pattern = getPattern(args, PATTERN);
group = getInt(args, GROUP, -1);
String v = args.remove(GROUP);
if (v == null) {
group = -1; // use 'split'
} else {
group = Integer.parseInt(v);
}
if (!args.isEmpty()) {
throw new IllegalArgumentException("Unknown parameters: " + args);
}

View File

@ -17,14 +17,12 @@ package org.apache.lucene.analysis.charfilter;
* limitations under the License.
*/
import java.util.HashMap;
import org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
public class TestMappingCharFilterFactory extends BaseTokenStreamFactoryTestCase {
public void testParseString() throws Exception {
MappingCharFilterFactory f = new MappingCharFilterFactory(new HashMap<String,String>());
MappingCharFilterFactory f = (MappingCharFilterFactory)charFilterFactory("Mapping");
try {
f.parseString( "\\" );