You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2010/08/29 00:42:26 UTC
svn commit: r990459 [1/3] - in /lucene/dev/trunk: lucene/contrib/
modules/analysis/common/src/java/org/apache/lucene/analysis/ca/
modules/analysis/common/src/java/org/apache/lucene/analysis/eu/
modules/analysis/common/src/java/org/apache/lucene/analysi...
Author: rmuir
Date: Sat Aug 28 22:42:25 2010
New Revision: 990459
URL: http://svn.apache.org/viewvc?rev=990459&view=rev
Log:
LUCENE-2624: add armenian, basque, catalan analyzers from snowball
Added:
lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/ca/
lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/ca/CatalanAnalyzer.java (with props)
lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/ca/package.html (with props)
lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/eu/
lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/eu/BasqueAnalyzer.java (with props)
lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/eu/package.html (with props)
lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/hy/
lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/hy/ArmenianAnalyzer.java (with props)
lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/hy/package.html (with props)
lucene/dev/trunk/modules/analysis/common/src/java/org/tartarus/snowball/ext/ArmenianStemmer.java (with props)
lucene/dev/trunk/modules/analysis/common/src/java/org/tartarus/snowball/ext/BasqueStemmer.java (with props)
lucene/dev/trunk/modules/analysis/common/src/java/org/tartarus/snowball/ext/CatalanStemmer.java (with props)
lucene/dev/trunk/modules/analysis/common/src/resources/org/apache/lucene/analysis/ca/
lucene/dev/trunk/modules/analysis/common/src/resources/org/apache/lucene/analysis/ca/stopwords.txt (with props)
lucene/dev/trunk/modules/analysis/common/src/resources/org/apache/lucene/analysis/eu/
lucene/dev/trunk/modules/analysis/common/src/resources/org/apache/lucene/analysis/eu/stopwords.txt (with props)
lucene/dev/trunk/modules/analysis/common/src/resources/org/apache/lucene/analysis/hy/
lucene/dev/trunk/modules/analysis/common/src/resources/org/apache/lucene/analysis/hy/stopwords.txt (with props)
lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/ca/
lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/ca/TestCatalanAnalyzer.java (with props)
lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/eu/
lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/eu/TestBasqueAnalyzer.java (with props)
lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/hy/
lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/hy/TestArmenianAnalyzer.java (with props)
Modified:
lucene/dev/trunk/lucene/contrib/CHANGES.txt
Modified: lucene/dev/trunk/lucene/contrib/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/CHANGES.txt?rev=990459&r1=990458&r2=990459&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/contrib/CHANGES.txt Sat Aug 28 22:42:25 2010
@@ -220,6 +220,9 @@ New features
* LUCENE-2581: FastVectorHighlighter: add Encoder to FragmentsBuilder.
(Koji Sekiguchi)
+ * LUCENE-2624: Add Analyzers for Armenian, Basque, and Catalan, from snowball.
+ (Robert Muir)
+
Build
* LUCENE-2124: Moved the JDK-based collation support from contrib/collation
Added: lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/ca/CatalanAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/ca/CatalanAnalyzer.java?rev=990459&view=auto
==============================================================================
--- lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/ca/CatalanAnalyzer.java (added)
+++ lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/ca/CatalanAnalyzer.java Sat Aug 28 22:42:25 2010
@@ -0,0 +1,130 @@
+package org.apache.lucene.analysis.ca;
+
+/**
+ * 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.
+ */
+
+import java.io.IOException;
+import java.io.Reader;
+import java.util.Set;
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.core.LowerCaseFilter;
+import org.apache.lucene.analysis.core.StopFilter;
+import org.apache.lucene.analysis.miscellaneous.KeywordMarkerFilter;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.analysis.Tokenizer;
+import org.apache.lucene.analysis.snowball.SnowballFilter;
+import org.apache.lucene.analysis.standard.StandardFilter;
+import org.apache.lucene.analysis.standard.StandardTokenizer;
+import org.apache.lucene.analysis.util.CharArraySet;
+import org.apache.lucene.analysis.util.StopwordAnalyzerBase;
+import org.apache.lucene.util.Version;
+import org.tartarus.snowball.ext.CatalanStemmer;
+
+/**
+ * {@link Analyzer} for Catalan.
+ */
+public final class CatalanAnalyzer extends StopwordAnalyzerBase {
+ private final Set<?> stemExclusionSet;
+
+ /** File containing default Catalan stopwords. */
+ public final static String DEFAULT_STOPWORD_FILE = "stopwords.txt";
+
+ /**
+ * Returns an unmodifiable instance of the default stop words set.
+ * @return default stop words set.
+ */
+ public static Set<?> getDefaultStopSet(){
+ return DefaultSetHolder.DEFAULT_STOP_SET;
+ }
+
+ /**
+ * Atomically loads the DEFAULT_STOP_SET in a lazy fashion once the outer class
+ * accesses the static final set the first time.;
+ */
+ private static class DefaultSetHolder {
+ static final Set<?> DEFAULT_STOP_SET;
+
+ static {
+ try {
+ DEFAULT_STOP_SET = loadStopwordSet(false,
+ CatalanAnalyzer.class, DEFAULT_STOPWORD_FILE, "#");
+ } catch (IOException ex) {
+ // default set should always be present as it is part of the
+ // distribution (JAR)
+ throw new RuntimeException("Unable to load default stopword set");
+ }
+ }
+ }
+
+ /**
+ * Builds an analyzer with the default stop words: {@link #DEFAULT_STOPWORD_FILE}.
+ */
+ public CatalanAnalyzer(Version matchVersion) {
+ this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET);
+ }
+
+ /**
+ * Builds an analyzer with the given stop words.
+ *
+ * @param matchVersion lucene compatibility version
+ * @param stopwords a stopword set
+ */
+ public CatalanAnalyzer(Version matchVersion, Set<?> stopwords) {
+ this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
+ }
+
+ /**
+ * Builds an analyzer with the given stop words. If a non-empty stem exclusion set is
+ * provided this analyzer will add a {@link KeywordMarkerFilter} before
+ * stemming.
+ *
+ * @param matchVersion lucene compatibility version
+ * @param stopwords a stopword set
+ * @param stemExclusionSet a set of terms not to be stemmed
+ */
+ public CatalanAnalyzer(Version matchVersion, Set<?> stopwords, Set<?> stemExclusionSet) {
+ super(matchVersion, stopwords);
+ this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(
+ matchVersion, stemExclusionSet));
+ }
+
+ /**
+ * Creates a
+ * {@link org.apache.lucene.analysis.util.ReusableAnalyzerBase.TokenStreamComponents}
+ * which tokenizes all the text in the provided {@link Reader}.
+ *
+ * @return A
+ * {@link org.apache.lucene.analysis.util.ReusableAnalyzerBase.TokenStreamComponents}
+ * built from an {@link StandardTokenizer} filtered with
+ * {@link StandardFilter}, {@link LowerCaseFilter}, {@link StopFilter}
+ * , {@link KeywordMarkerFilter} if a stem exclusion set is
+ * provided and {@link SnowballFilter}.
+ */
+ @Override
+ protected TokenStreamComponents createComponents(String fieldName,
+ Reader reader) {
+ final Tokenizer source = new StandardTokenizer(matchVersion, reader);
+ TokenStream result = new StandardFilter(source);
+ result = new LowerCaseFilter(matchVersion, result);
+ result = new StopFilter(matchVersion, result, stopwords);
+ if(!stemExclusionSet.isEmpty())
+ result = new KeywordMarkerFilter(result, stemExclusionSet);
+ result = new SnowballFilter(result, new CatalanStemmer());
+ return new TokenStreamComponents(source, result);
+ }
+}
Propchange: lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/ca/CatalanAnalyzer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/ca/package.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/ca/package.html?rev=990459&view=auto
==============================================================================
--- lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/ca/package.html (added)
+++ lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/ca/package.html Sat Aug 28 22:42:25 2010
@@ -0,0 +1,22 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<!--
+ 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.
+-->
+<html><head></head>
+<body>
+Analyzer for Catalan.
+</body>
+</html>
Propchange: lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/ca/package.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/eu/BasqueAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/eu/BasqueAnalyzer.java?rev=990459&view=auto
==============================================================================
--- lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/eu/BasqueAnalyzer.java (added)
+++ lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/eu/BasqueAnalyzer.java Sat Aug 28 22:42:25 2010
@@ -0,0 +1,130 @@
+package org.apache.lucene.analysis.eu;
+
+/**
+ * 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.
+ */
+
+import java.io.IOException;
+import java.io.Reader;
+import java.util.Set;
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.core.LowerCaseFilter;
+import org.apache.lucene.analysis.core.StopFilter;
+import org.apache.lucene.analysis.miscellaneous.KeywordMarkerFilter;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.analysis.Tokenizer;
+import org.apache.lucene.analysis.snowball.SnowballFilter;
+import org.apache.lucene.analysis.standard.StandardFilter;
+import org.apache.lucene.analysis.standard.StandardTokenizer;
+import org.apache.lucene.analysis.util.CharArraySet;
+import org.apache.lucene.analysis.util.StopwordAnalyzerBase;
+import org.apache.lucene.util.Version;
+import org.tartarus.snowball.ext.BasqueStemmer;
+
+/**
+ * {@link Analyzer} for Basque.
+ */
+public final class BasqueAnalyzer extends StopwordAnalyzerBase {
+ private final Set<?> stemExclusionSet;
+
+ /** File containing default Basque stopwords. */
+ public final static String DEFAULT_STOPWORD_FILE = "stopwords.txt";
+
+ /**
+ * Returns an unmodifiable instance of the default stop words set.
+ * @return default stop words set.
+ */
+ public static Set<?> getDefaultStopSet(){
+ return DefaultSetHolder.DEFAULT_STOP_SET;
+ }
+
+ /**
+ * Atomically loads the DEFAULT_STOP_SET in a lazy fashion once the outer class
+ * accesses the static final set the first time.;
+ */
+ private static class DefaultSetHolder {
+ static final Set<?> DEFAULT_STOP_SET;
+
+ static {
+ try {
+ DEFAULT_STOP_SET = loadStopwordSet(false,
+ BasqueAnalyzer.class, DEFAULT_STOPWORD_FILE, "#");
+ } catch (IOException ex) {
+ // default set should always be present as it is part of the
+ // distribution (JAR)
+ throw new RuntimeException("Unable to load default stopword set");
+ }
+ }
+ }
+
+ /**
+ * Builds an analyzer with the default stop words: {@link #DEFAULT_STOPWORD_FILE}.
+ */
+ public BasqueAnalyzer(Version matchVersion) {
+ this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET);
+ }
+
+ /**
+ * Builds an analyzer with the given stop words.
+ *
+ * @param matchVersion lucene compatibility version
+ * @param stopwords a stopword set
+ */
+ public BasqueAnalyzer(Version matchVersion, Set<?> stopwords) {
+ this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
+ }
+
+ /**
+ * Builds an analyzer with the given stop words. If a non-empty stem exclusion set is
+ * provided this analyzer will add a {@link KeywordMarkerFilter} before
+ * stemming.
+ *
+ * @param matchVersion lucene compatibility version
+ * @param stopwords a stopword set
+ * @param stemExclusionSet a set of terms not to be stemmed
+ */
+ public BasqueAnalyzer(Version matchVersion, Set<?> stopwords, Set<?> stemExclusionSet) {
+ super(matchVersion, stopwords);
+ this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(
+ matchVersion, stemExclusionSet));
+ }
+
+ /**
+ * Creates a
+ * {@link org.apache.lucene.analysis.util.ReusableAnalyzerBase.TokenStreamComponents}
+ * which tokenizes all the text in the provided {@link Reader}.
+ *
+ * @return A
+ * {@link org.apache.lucene.analysis.util.ReusableAnalyzerBase.TokenStreamComponents}
+ * built from an {@link StandardTokenizer} filtered with
+ * {@link StandardFilter}, {@link LowerCaseFilter}, {@link StopFilter}
+ * , {@link KeywordMarkerFilter} if a stem exclusion set is
+ * provided and {@link SnowballFilter}.
+ */
+ @Override
+ protected TokenStreamComponents createComponents(String fieldName,
+ Reader reader) {
+ final Tokenizer source = new StandardTokenizer(matchVersion, reader);
+ TokenStream result = new StandardFilter(source);
+ result = new LowerCaseFilter(matchVersion, result);
+ result = new StopFilter(matchVersion, result, stopwords);
+ if(!stemExclusionSet.isEmpty())
+ result = new KeywordMarkerFilter(result, stemExclusionSet);
+ result = new SnowballFilter(result, new BasqueStemmer());
+ return new TokenStreamComponents(source, result);
+ }
+}
Propchange: lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/eu/BasqueAnalyzer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/eu/package.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/eu/package.html?rev=990459&view=auto
==============================================================================
--- lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/eu/package.html (added)
+++ lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/eu/package.html Sat Aug 28 22:42:25 2010
@@ -0,0 +1,22 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<!--
+ 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.
+-->
+<html><head></head>
+<body>
+Analyzer for Basque.
+</body>
+</html>
Propchange: lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/eu/package.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/hy/ArmenianAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/hy/ArmenianAnalyzer.java?rev=990459&view=auto
==============================================================================
--- lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/hy/ArmenianAnalyzer.java (added)
+++ lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/hy/ArmenianAnalyzer.java Sat Aug 28 22:42:25 2010
@@ -0,0 +1,130 @@
+package org.apache.lucene.analysis.hy;
+
+/**
+ * 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.
+ */
+
+import java.io.IOException;
+import java.io.Reader;
+import java.util.Set;
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.core.LowerCaseFilter;
+import org.apache.lucene.analysis.core.StopFilter;
+import org.apache.lucene.analysis.miscellaneous.KeywordMarkerFilter;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.analysis.Tokenizer;
+import org.apache.lucene.analysis.snowball.SnowballFilter;
+import org.apache.lucene.analysis.standard.StandardFilter;
+import org.apache.lucene.analysis.standard.StandardTokenizer;
+import org.apache.lucene.analysis.util.CharArraySet;
+import org.apache.lucene.analysis.util.StopwordAnalyzerBase;
+import org.apache.lucene.util.Version;
+import org.tartarus.snowball.ext.ArmenianStemmer;
+
+/**
+ * {@link Analyzer} for Armenian.
+ */
+public final class ArmenianAnalyzer extends StopwordAnalyzerBase {
+ private final Set<?> stemExclusionSet;
+
+ /** File containing default Armenian stopwords. */
+ public final static String DEFAULT_STOPWORD_FILE = "stopwords.txt";
+
+ /**
+ * Returns an unmodifiable instance of the default stop words set.
+ * @return default stop words set.
+ */
+ public static Set<?> getDefaultStopSet(){
+ return DefaultSetHolder.DEFAULT_STOP_SET;
+ }
+
+ /**
+ * Atomically loads the DEFAULT_STOP_SET in a lazy fashion once the outer class
+ * accesses the static final set the first time.;
+ */
+ private static class DefaultSetHolder {
+ static final Set<?> DEFAULT_STOP_SET;
+
+ static {
+ try {
+ DEFAULT_STOP_SET = loadStopwordSet(false,
+ ArmenianAnalyzer.class, DEFAULT_STOPWORD_FILE, "#");
+ } catch (IOException ex) {
+ // default set should always be present as it is part of the
+ // distribution (JAR)
+ throw new RuntimeException("Unable to load default stopword set");
+ }
+ }
+ }
+
+ /**
+ * Builds an analyzer with the default stop words: {@link #DEFAULT_STOPWORD_FILE}.
+ */
+ public ArmenianAnalyzer(Version matchVersion) {
+ this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET);
+ }
+
+ /**
+ * Builds an analyzer with the given stop words.
+ *
+ * @param matchVersion lucene compatibility version
+ * @param stopwords a stopword set
+ */
+ public ArmenianAnalyzer(Version matchVersion, Set<?> stopwords) {
+ this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
+ }
+
+ /**
+ * Builds an analyzer with the given stop words. If a non-empty stem exclusion set is
+ * provided this analyzer will add a {@link KeywordMarkerFilter} before
+ * stemming.
+ *
+ * @param matchVersion lucene compatibility version
+ * @param stopwords a stopword set
+ * @param stemExclusionSet a set of terms not to be stemmed
+ */
+ public ArmenianAnalyzer(Version matchVersion, Set<?> stopwords, Set<?> stemExclusionSet) {
+ super(matchVersion, stopwords);
+ this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(
+ matchVersion, stemExclusionSet));
+ }
+
+ /**
+ * Creates a
+ * {@link org.apache.lucene.analysis.util.ReusableAnalyzerBase.TokenStreamComponents}
+ * which tokenizes all the text in the provided {@link Reader}.
+ *
+ * @return A
+ * {@link org.apache.lucene.analysis.util.ReusableAnalyzerBase.TokenStreamComponents}
+ * built from an {@link StandardTokenizer} filtered with
+ * {@link StandardFilter}, {@link LowerCaseFilter}, {@link StopFilter}
+ * , {@link KeywordMarkerFilter} if a stem exclusion set is
+ * provided and {@link SnowballFilter}.
+ */
+ @Override
+ protected TokenStreamComponents createComponents(String fieldName,
+ Reader reader) {
+ final Tokenizer source = new StandardTokenizer(matchVersion, reader);
+ TokenStream result = new StandardFilter(source);
+ result = new LowerCaseFilter(matchVersion, result);
+ result = new StopFilter(matchVersion, result, stopwords);
+ if(!stemExclusionSet.isEmpty())
+ result = new KeywordMarkerFilter(result, stemExclusionSet);
+ result = new SnowballFilter(result, new ArmenianStemmer());
+ return new TokenStreamComponents(source, result);
+ }
+}
Propchange: lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/hy/ArmenianAnalyzer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/hy/package.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/hy/package.html?rev=990459&view=auto
==============================================================================
--- lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/hy/package.html (added)
+++ lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/hy/package.html Sat Aug 28 22:42:25 2010
@@ -0,0 +1,22 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<!--
+ 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.
+-->
+<html><head></head>
+<body>
+Analyzer for Armenian.
+</body>
+</html>
Propchange: lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/hy/package.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: lucene/dev/trunk/modules/analysis/common/src/java/org/tartarus/snowball/ext/ArmenianStemmer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/analysis/common/src/java/org/tartarus/snowball/ext/ArmenianStemmer.java?rev=990459&view=auto
==============================================================================
--- lucene/dev/trunk/modules/analysis/common/src/java/org/tartarus/snowball/ext/ArmenianStemmer.java (added)
+++ lucene/dev/trunk/modules/analysis/common/src/java/org/tartarus/snowball/ext/ArmenianStemmer.java Sat Aug 28 22:42:25 2010
@@ -0,0 +1,516 @@
+// This file was generated automatically by the Snowball to Java compiler
+
+package org.tartarus.snowball.ext;
+
+import org.tartarus.snowball.Among;
+import org.tartarus.snowball.SnowballProgram;
+
+ /**
+ * This class was automatically generated by a Snowball to Java compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+public class ArmenianStemmer extends SnowballProgram {
+
+private static final long serialVersionUID = 1L;
+
+ private final static ArmenianStemmer methodObject = new ArmenianStemmer ();
+
+ private final static Among a_0[] = {
+ new Among ( "\u0580\u0578\u0580\u0564", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u0580\u0578\u0580\u0564", 0, 1, "", methodObject ),
+ new Among ( "\u0561\u056C\u056B", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u056F\u056B", -1, 1, "", methodObject ),
+ new Among ( "\u0578\u0580\u0561\u056F", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u0572", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u056F\u0561\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0580\u0561\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u056F\u0565\u0576", 8, 1, "", methodObject ),
+ new Among ( "\u0565\u0580\u0565\u0576", 8, 1, "", methodObject ),
+ new Among ( "\u0578\u0580\u0567\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u056B\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u0563\u056B\u0576", 12, 1, "", methodObject ),
+ new Among ( "\u0578\u057E\u056B\u0576", 12, 1, "", methodObject ),
+ new Among ( "\u056C\u0561\u0575\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u057E\u0578\u0582\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u057A\u0565\u057D", -1, 1, "", methodObject ),
+ new Among ( "\u056B\u057E", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u057F", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u057E\u0565\u057F", -1, 1, "", methodObject ),
+ new Among ( "\u056F\u0578\u057F", -1, 1, "", methodObject ),
+ new Among ( "\u0562\u0561\u0580", -1, 1, "", methodObject )
+ };
+
+ private final static Among a_1[] = {
+ new Among ( "\u0561", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u0561", 0, 1, "", methodObject ),
+ new Among ( "\u0565\u0581\u0561", 0, 1, "", methodObject ),
+ new Among ( "\u057E\u0565", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u0580\u056B", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u056B", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u0581\u056B", -1, 1, "", methodObject ),
+ new Among ( "\u057E\u0565\u0581\u056B", 6, 1, "", methodObject ),
+ new Among ( "\u0561\u056C", -1, 1, "", methodObject ),
+ new Among ( "\u0568\u0561\u056C", 8, 1, "", methodObject ),
+ new Among ( "\u0561\u0576\u0561\u056C", 8, 1, "", methodObject ),
+ new Among ( "\u0565\u0576\u0561\u056C", 8, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u0576\u0561\u056C", 8, 1, "", methodObject ),
+ new Among ( "\u0565\u056C", -1, 1, "", methodObject ),
+ new Among ( "\u0568\u0565\u056C", 13, 1, "", methodObject ),
+ new Among ( "\u0576\u0565\u056C", 13, 1, "", methodObject ),
+ new Among ( "\u0581\u0576\u0565\u056C", 15, 1, "", methodObject ),
+ new Among ( "\u0565\u0581\u0576\u0565\u056C", 16, 1, "", methodObject ),
+ new Among ( "\u0579\u0565\u056C", 13, 1, "", methodObject ),
+ new Among ( "\u057E\u0565\u056C", 13, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u057E\u0565\u056C", 19, 1, "", methodObject ),
+ new Among ( "\u0565\u0581\u057E\u0565\u056C", 19, 1, "", methodObject ),
+ new Among ( "\u057F\u0565\u056C", 13, 1, "", methodObject ),
+ new Among ( "\u0561\u057F\u0565\u056C", 22, 1, "", methodObject ),
+ new Among ( "\u0578\u057F\u0565\u056C", 22, 1, "", methodObject ),
+ new Among ( "\u056F\u0578\u057F\u0565\u056C", 24, 1, "", methodObject ),
+ new Among ( "\u057E\u0561\u056E", -1, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u0574", -1, 1, "", methodObject ),
+ new Among ( "\u057E\u0578\u0582\u0574", 27, 1, "", methodObject ),
+ new Among ( "\u0561\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u0581\u0561\u0576", 29, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u0561\u0576", 30, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u0580\u056B\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u056B\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u0581\u056B\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u057E\u0565\u0581\u056B\u0576", 34, 1, "", methodObject ),
+ new Among ( "\u0561\u056C\u056B\u057D", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u056C\u056B\u057D", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u057E", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u0561\u057E", 38, 1, "", methodObject ),
+ new Among ( "\u0565\u0581\u0561\u057E", 38, 1, "", methodObject ),
+ new Among ( "\u0561\u056C\u0578\u057E", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u056C\u0578\u057E", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0580", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u0561\u0580", 43, 1, "", methodObject ),
+ new Among ( "\u0565\u0581\u0561\u0580", 43, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u0580\u056B\u0580", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u056B\u0580", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u0581\u056B\u0580", -1, 1, "", methodObject ),
+ new Among ( "\u057E\u0565\u0581\u056B\u0580", 48, 1, "", methodObject ),
+ new Among ( "\u0561\u0581", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u0581", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u0580\u0565\u0581", 51, 1, "", methodObject ),
+ new Among ( "\u0561\u056C\u0578\u0582\u0581", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u056C\u0578\u0582\u0581", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u056C\u0578\u0582", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u056C\u0578\u0582", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0584", -1, 1, "", methodObject ),
+ new Among ( "\u0581\u0561\u0584", 57, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u0561\u0584", 58, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u0580\u056B\u0584", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u056B\u0584", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u0581\u056B\u0584", -1, 1, "", methodObject ),
+ new Among ( "\u057E\u0565\u0581\u056B\u0584", 62, 1, "", methodObject ),
+ new Among ( "\u0561\u0576\u0584", -1, 1, "", methodObject ),
+ new Among ( "\u0581\u0561\u0576\u0584", 64, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u0561\u0576\u0584", 65, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u0580\u056B\u0576\u0584", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0581\u056B\u0576\u0584", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u0581\u056B\u0576\u0584", -1, 1, "", methodObject ),
+ new Among ( "\u057E\u0565\u0581\u056B\u0576\u0584", 69, 1, "", methodObject )
+ };
+
+ private final static Among a_2[] = {
+ new Among ( "\u0578\u0580\u0564", -1, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u0575\u0569", -1, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u0570\u056B", -1, 1, "", methodObject ),
+ new Among ( "\u0581\u056B", -1, 1, "", methodObject ),
+ new Among ( "\u056B\u056C", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u056F", -1, 1, "", methodObject ),
+ new Among ( "\u0575\u0561\u056F", 5, 1, "", methodObject ),
+ new Among ( "\u0561\u0576\u0561\u056F", 5, 1, "", methodObject ),
+ new Among ( "\u056B\u056F", -1, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u056F", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u057A\u0561\u0576", 10, 1, "", methodObject ),
+ new Among ( "\u057D\u057F\u0561\u0576", 10, 1, "", methodObject ),
+ new Among ( "\u0561\u0580\u0561\u0576", 10, 1, "", methodObject ),
+ new Among ( "\u0565\u0572\u0567\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u0575\u0578\u0582\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u0569\u0575\u0578\u0582\u0576", 15, 1, "", methodObject ),
+ new Among ( "\u0561\u056E\u0578", -1, 1, "", methodObject ),
+ new Among ( "\u056B\u0579", -1, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u057D", -1, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u057D\u057F", -1, 1, "", methodObject ),
+ new Among ( "\u0563\u0561\u0580", -1, 1, "", methodObject ),
+ new Among ( "\u057E\u0578\u0580", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u057E\u0578\u0580", 22, 1, "", methodObject ),
+ new Among ( "\u0578\u0581", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0576\u0585\u0581", -1, 1, "", methodObject ),
+ new Among ( "\u0578\u0582", -1, 1, "", methodObject ),
+ new Among ( "\u0584", -1, 1, "", methodObject ),
+ new Among ( "\u0579\u0565\u0584", 27, 1, "", methodObject ),
+ new Among ( "\u056B\u0584", 27, 1, "", methodObject ),
+ new Among ( "\u0561\u056C\u056B\u0584", 29, 1, "", methodObject ),
+ new Among ( "\u0561\u0576\u056B\u0584", 29, 1, "", methodObject ),
+ new Among ( "\u057E\u0561\u056E\u0584", 27, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u0575\u0584", 27, 1, "", methodObject ),
+ new Among ( "\u0565\u0576\u0584", 27, 1, "", methodObject ),
+ new Among ( "\u0578\u0576\u0584", 27, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u0576\u0584", 27, 1, "", methodObject ),
+ new Among ( "\u0574\u0578\u0582\u0576\u0584", 36, 1, "", methodObject ),
+ new Among ( "\u056B\u0579\u0584", 27, 1, "", methodObject ),
+ new Among ( "\u0561\u0580\u0584", 27, 1, "", methodObject )
+ };
+
+ private final static Among a_3[] = {
+ new Among ( "\u057D\u0561", -1, 1, "", methodObject ),
+ new Among ( "\u057E\u0561", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0574\u0562", -1, 1, "", methodObject ),
+ new Among ( "\u0564", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0576\u0564", 3, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u0569\u0575\u0561\u0576\u0564", 4, 1, "", methodObject ),
+ new Among ( "\u057E\u0561\u0576\u0564", 4, 1, "", methodObject ),
+ new Among ( "\u0578\u057B\u0564", 3, 1, "", methodObject ),
+ new Among ( "\u0565\u0580\u0564", 3, 1, "", methodObject ),
+ new Among ( "\u0576\u0565\u0580\u0564", 8, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u0564", 3, 1, "", methodObject ),
+ new Among ( "\u0568", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0576\u0568", 11, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u0569\u0575\u0561\u0576\u0568", 12, 1, "", methodObject ),
+ new Among ( "\u057E\u0561\u0576\u0568", 12, 1, "", methodObject ),
+ new Among ( "\u0578\u057B\u0568", 11, 1, "", methodObject ),
+ new Among ( "\u0565\u0580\u0568", 11, 1, "", methodObject ),
+ new Among ( "\u0576\u0565\u0580\u0568", 16, 1, "", methodObject ),
+ new Among ( "\u056B", -1, 1, "", methodObject ),
+ new Among ( "\u057E\u056B", 18, 1, "", methodObject ),
+ new Among ( "\u0565\u0580\u056B", 18, 1, "", methodObject ),
+ new Among ( "\u0576\u0565\u0580\u056B", 20, 1, "", methodObject ),
+ new Among ( "\u0561\u0576\u0578\u0582\u0574", -1, 1, "", methodObject ),
+ new Among ( "\u0565\u0580\u0578\u0582\u0574", -1, 1, "", methodObject ),
+ new Among ( "\u0576\u0565\u0580\u0578\u0582\u0574", 23, 1, "", methodObject ),
+ new Among ( "\u0576", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0576", 25, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u0569\u0575\u0561\u0576", 26, 1, "", methodObject ),
+ new Among ( "\u057E\u0561\u0576", 26, 1, "", methodObject ),
+ new Among ( "\u056B\u0576", 25, 1, "", methodObject ),
+ new Among ( "\u0565\u0580\u056B\u0576", 29, 1, "", methodObject ),
+ new Among ( "\u0576\u0565\u0580\u056B\u0576", 30, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u0569\u0575\u0561\u0576\u0576", 25, 1, "", methodObject ),
+ new Among ( "\u0565\u0580\u0576", 25, 1, "", methodObject ),
+ new Among ( "\u0576\u0565\u0580\u0576", 33, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u0576", 25, 1, "", methodObject ),
+ new Among ( "\u0578\u057B", -1, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u0569\u0575\u0561\u0576\u057D", -1, 1, "", methodObject ),
+ new Among ( "\u057E\u0561\u0576\u057D", -1, 1, "", methodObject ),
+ new Among ( "\u0578\u057B\u057D", -1, 1, "", methodObject ),
+ new Among ( "\u0578\u057E", -1, 1, "", methodObject ),
+ new Among ( "\u0561\u0576\u0578\u057E", 40, 1, "", methodObject ),
+ new Among ( "\u057E\u0578\u057E", 40, 1, "", methodObject ),
+ new Among ( "\u0565\u0580\u0578\u057E", 40, 1, "", methodObject ),
+ new Among ( "\u0576\u0565\u0580\u0578\u057E", 43, 1, "", methodObject ),
+ new Among ( "\u0565\u0580", -1, 1, "", methodObject ),
+ new Among ( "\u0576\u0565\u0580", 45, 1, "", methodObject ),
+ new Among ( "\u0581", -1, 1, "", methodObject ),
+ new Among ( "\u056B\u0581", 47, 1, "", methodObject ),
+ new Among ( "\u057E\u0561\u0576\u056B\u0581", 48, 1, "", methodObject ),
+ new Among ( "\u0578\u057B\u056B\u0581", 48, 1, "", methodObject ),
+ new Among ( "\u057E\u056B\u0581", 48, 1, "", methodObject ),
+ new Among ( "\u0565\u0580\u056B\u0581", 48, 1, "", methodObject ),
+ new Among ( "\u0576\u0565\u0580\u056B\u0581", 52, 1, "", methodObject ),
+ new Among ( "\u0581\u056B\u0581", 48, 1, "", methodObject ),
+ new Among ( "\u0578\u0581", 47, 1, "", methodObject ),
+ new Among ( "\u0578\u0582\u0581", 47, 1, "", methodObject )
+ };
+
+ private static final char g_v[] = {209, 4, 128, 0, 18 };
+
+ private int I_p2;
+ private int I_pV;
+
+ private void copy_from(ArmenianStemmer other) {
+ I_p2 = other.I_p2;
+ I_pV = other.I_pV;
+ super.copy_from(other);
+ }
+
+ private boolean r_mark_regions() {
+ int v_1;
+ // (, line 58
+ I_pV = limit;
+ I_p2 = limit;
+ // do, line 62
+ v_1 = cursor;
+ lab0: do {
+ // (, line 62
+ // gopast, line 63
+ golab1: while(true)
+ {
+ lab2: do {
+ if (!(in_grouping(g_v, 1377, 1413)))
+ {
+ break lab2;
+ }
+ break golab1;
+ } while (false);
+ if (cursor >= limit)
+ {
+ break lab0;
+ }
+ cursor++;
+ }
+ // setmark pV, line 63
+ I_pV = cursor;
+ // gopast, line 63
+ golab3: while(true)
+ {
+ lab4: do {
+ if (!(out_grouping(g_v, 1377, 1413)))
+ {
+ break lab4;
+ }
+ break golab3;
+ } while (false);
+ if (cursor >= limit)
+ {
+ break lab0;
+ }
+ cursor++;
+ }
+ // gopast, line 64
+ golab5: while(true)
+ {
+ lab6: do {
+ if (!(in_grouping(g_v, 1377, 1413)))
+ {
+ break lab6;
+ }
+ break golab5;
+ } while (false);
+ if (cursor >= limit)
+ {
+ break lab0;
+ }
+ cursor++;
+ }
+ // gopast, line 64
+ golab7: while(true)
+ {
+ lab8: do {
+ if (!(out_grouping(g_v, 1377, 1413)))
+ {
+ break lab8;
+ }
+ break golab7;
+ } while (false);
+ if (cursor >= limit)
+ {
+ break lab0;
+ }
+ cursor++;
+ }
+ // setmark p2, line 64
+ I_p2 = cursor;
+ } while (false);
+ cursor = v_1;
+ return true;
+ }
+
+ private boolean r_R2() {
+ if (!(I_p2 <= cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ private boolean r_adjective() {
+ int among_var;
+ // (, line 72
+ // [, line 73
+ ket = cursor;
+ // substring, line 73
+ among_var = find_among_b(a_0, 23);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 73
+ bra = cursor;
+ switch(among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 98
+ // delete, line 98
+ slice_del();
+ break;
+ }
+ return true;
+ }
+
+ private boolean r_verb() {
+ int among_var;
+ // (, line 102
+ // [, line 103
+ ket = cursor;
+ // substring, line 103
+ among_var = find_among_b(a_1, 71);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 103
+ bra = cursor;
+ switch(among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 176
+ // delete, line 176
+ slice_del();
+ break;
+ }
+ return true;
+ }
+
+ private boolean r_noun() {
+ int among_var;
+ // (, line 180
+ // [, line 181
+ ket = cursor;
+ // substring, line 181
+ among_var = find_among_b(a_2, 40);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 181
+ bra = cursor;
+ switch(among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 223
+ // delete, line 223
+ slice_del();
+ break;
+ }
+ return true;
+ }
+
+ private boolean r_ending() {
+ int among_var;
+ // (, line 227
+ // [, line 228
+ ket = cursor;
+ // substring, line 228
+ among_var = find_among_b(a_3, 57);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 228
+ bra = cursor;
+ // call R2, line 228
+ if (!r_R2())
+ {
+ return false;
+ }
+ switch(among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 287
+ // delete, line 287
+ slice_del();
+ break;
+ }
+ return true;
+ }
+
+ public boolean stem() {
+ int v_1;
+ int v_2;
+ int v_3;
+ int v_4;
+ int v_5;
+ int v_6;
+ int v_7;
+ // (, line 292
+ // do, line 294
+ v_1 = cursor;
+ lab0: do {
+ // call mark_regions, line 294
+ if (!r_mark_regions())
+ {
+ break lab0;
+ }
+ } while (false);
+ cursor = v_1;
+ // backwards, line 295
+ limit_backward = cursor; cursor = limit;
+ // setlimit, line 295
+ v_2 = limit - cursor;
+ // tomark, line 295
+ if (cursor < I_pV)
+ {
+ return false;
+ }
+ cursor = I_pV;
+ v_3 = limit_backward;
+ limit_backward = cursor;
+ cursor = limit - v_2;
+ // (, line 295
+ // do, line 296
+ v_4 = limit - cursor;
+ lab1: do {
+ // call ending, line 296
+ if (!r_ending())
+ {
+ break lab1;
+ }
+ } while (false);
+ cursor = limit - v_4;
+ // do, line 297
+ v_5 = limit - cursor;
+ lab2: do {
+ // call verb, line 297
+ if (!r_verb())
+ {
+ break lab2;
+ }
+ } while (false);
+ cursor = limit - v_5;
+ // do, line 298
+ v_6 = limit - cursor;
+ lab3: do {
+ // call adjective, line 298
+ if (!r_adjective())
+ {
+ break lab3;
+ }
+ } while (false);
+ cursor = limit - v_6;
+ // do, line 299
+ v_7 = limit - cursor;
+ lab4: do {
+ // call noun, line 299
+ if (!r_noun())
+ {
+ break lab4;
+ }
+ } while (false);
+ cursor = limit - v_7;
+ limit_backward = v_3;
+ cursor = limit_backward; return true;
+ }
+
+ public boolean equals( Object o ) {
+ return o instanceof ArmenianStemmer;
+ }
+
+ public int hashCode() {
+ return ArmenianStemmer.class.getName().hashCode();
+ }
+
+
+
+}
+
Propchange: lucene/dev/trunk/modules/analysis/common/src/java/org/tartarus/snowball/ext/ArmenianStemmer.java
------------------------------------------------------------------------------
svn:eol-style = native