From 042f7c0ba928c8e7be02c4ace28ffd2a039c37f0 Mon Sep 17 00:00:00 2001 From: "Chris M. Hostetter" Date: Wed, 9 Sep 2009 04:41:33 +0000 Subject: [PATCH] ant stub-factories: PersianNormalizationFilterFactory, signature cleanup of TrieTokenizerFactory, exclusion rule for SnowballFilter git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@812768 13f79535-47bb-0310-9956-ffa450edef68 --- build.xml | 4 +++ .../PersianNormalizationFilterFactory.java | 32 +++++++++++++++++++ .../solr/analysis/TrieTokenizerFactory.java | 4 +-- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 src/java/org/apache/solr/analysis/PersianNormalizationFilterFactory.java diff --git a/build.xml b/build.xml index 43e6b1d34f5..23fd020d9bc 100644 --- a/build.xml +++ b/build.xml @@ -300,6 +300,10 @@ + + + + diff --git a/src/java/org/apache/solr/analysis/PersianNormalizationFilterFactory.java b/src/java/org/apache/solr/analysis/PersianNormalizationFilterFactory.java new file mode 100644 index 00000000000..981f8f18113 --- /dev/null +++ b/src/java/org/apache/solr/analysis/PersianNormalizationFilterFactory.java @@ -0,0 +1,32 @@ + +/** + * 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. + */ + + +package org.apache.solr.analysis; +import org.apache.lucene.analysis.fa.*; +import java.io.IOException; +import org.apache.lucene.analysis.TokenFilter; +import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.analysis.tokenattributes.TermAttribute; +import java.util.Map; +public class PersianNormalizationFilterFactory extends BaseTokenFilterFactory { + public PersianNormalizationFilter create(TokenStream input) { + return new PersianNormalizationFilter(input); + } +} + diff --git a/src/java/org/apache/solr/analysis/TrieTokenizerFactory.java b/src/java/org/apache/solr/analysis/TrieTokenizerFactory.java index e975a4876a6..24aaf0cff98 100644 --- a/src/java/org/apache/solr/analysis/TrieTokenizerFactory.java +++ b/src/java/org/apache/solr/analysis/TrieTokenizerFactory.java @@ -47,7 +47,7 @@ public class TrieTokenizerFactory extends BaseTokenizerFactory { this.precisionStep = precisionStep; } - public Tokenizer create(Reader input) { + public TrieTokenizer create(Reader input) { return new TrieTokenizer(input, type, precisionStep, TrieTokenizer.getNumericTokenStream(precisionStep)); } } @@ -115,4 +115,4 @@ class TrieTokenizer extends Tokenizer { public boolean incrementToken() throws IOException { return ts.incrementToken(); } -} \ No newline at end of file +}