LUCENE-4044: port over icu module

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene2510@1364897 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-07-24 05:27:52 +00:00
parent 78232bf295
commit e7b30a7d8d
10 changed files with 47 additions and 15 deletions

View File

@ -1,4 +1,4 @@
package org.apache.solr.analysis;
package org.apache.lucene.analysis.icu;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.icu.ICUFoldingFilter;

View File

@ -1,4 +1,4 @@
package org.apache.solr.analysis;
package org.apache.lucene.analysis.icu;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,9 +22,8 @@ import java.util.Map;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.icu.ICUNormalizer2Filter;
import org.apache.lucene.analysis.util.AbstractAnalysisFactory;
import org.apache.lucene.analysis.util.InitializationException;
import org.apache.lucene.analysis.util.MultiTermAwareComponent;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.lucene.analysis.util.TokenFilterFactory;
import com.ibm.icu.text.FilteredNormalizer2;
@ -66,7 +65,7 @@ public class ICUNormalizer2FilterFactory extends TokenFilterFactory implements M
else if (mode.equals("decompose"))
normalizer = Normalizer2.getInstance(null, name, Normalizer2.Mode.DECOMPOSE);
else
throw new SolrException(ErrorCode.SERVER_ERROR, "Invalid mode: " + mode);
throw new InitializationException("Invalid mode: " + mode);
String filter = args.get("filter");
if (filter != null) {

View File

@ -1,4 +1,4 @@
package org.apache.solr.analysis;
package org.apache.lucene.analysis.icu;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,9 +22,8 @@ import java.util.Map;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.icu.ICUTransformFilter;
import org.apache.lucene.analysis.util.AbstractAnalysisFactory;
import org.apache.lucene.analysis.util.InitializationException;
import org.apache.lucene.analysis.util.MultiTermAwareComponent;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.lucene.analysis.util.TokenFilterFactory;
import com.ibm.icu.text.Transliterator;
@ -48,7 +47,7 @@ public class ICUTransformFilterFactory extends TokenFilterFactory implements Mul
super.init(args);
String id = args.get("id");
if (id == null) {
throw new SolrException(ErrorCode.SERVER_ERROR, "id is required.");
throw new InitializationException("id is required.");
}
int dir;
@ -58,7 +57,7 @@ public class ICUTransformFilterFactory extends TokenFilterFactory implements Mul
else if (direction.equalsIgnoreCase("reverse"))
dir = Transliterator.REVERSE;
else
throw new SolrException(ErrorCode.SERVER_ERROR, "invalid direction: " + direction);
throw new InitializationException("invalid direction: " + direction);
transliterator = Transliterator.getInstance(id, dir);
}

View File

@ -1,4 +1,4 @@
package org.apache.solr.analysis;
package org.apache.lucene.analysis.icu.segmentation;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -0,0 +1,18 @@
# 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.
org.apache.lucene.analysis.icu.ICUFoldingFilterFactory
org.apache.lucene.analysis.icu.ICUNormalizer2FilterFactory
org.apache.lucene.analysis.icu.ICUTransformFilterFactory

View File

@ -0,0 +1,16 @@
# 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.
org.apache.lucene.analysis.icu.segmentation.ICUTokenizerFactory

View File

@ -1,4 +1,4 @@
package org.apache.solr.analysis;
package org.apache.lucene.analysis.icu;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -1,4 +1,4 @@
package org.apache.solr.analysis;
package org.apache.lucene.analysis.icu;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -1,4 +1,4 @@
package org.apache.solr.analysis;
package org.apache.lucene.analysis.icu;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -1,4 +1,4 @@
package org.apache.solr.analysis;
package org.apache.lucene.analysis.icu.segmentation;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more