lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rjer...@apache.org
Subject svn commit: r1619283 [4/11] - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/analysis/ lucene/analysis/common/src/java/org/apache/lucene/analysis/ar/ lucene/analysis/common/src/java/org/apache/lucene/analysis/bg/ lucene/analysis/common/src/java/o...
Date Thu, 21 Aug 2014 03:12:58 GMT
Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -64,7 +64,7 @@ public final class NorwegianAnalyzer ext
     static {
       try {
         DEFAULT_STOP_SET = WordlistLoader.getSnowballWordSet(IOUtils.getDecodingReader(SnowballFilter.class, 
-            DEFAULT_STOPWORD_FILE, StandardCharsets.UTF_8), Version.LUCENE_CURRENT);
+            DEFAULT_STOPWORD_FILE, StandardCharsets.UTF_8));
       } catch (IOException ex) {
         // default set should always be present as it is part of the
         // distribution (JAR)
@@ -76,6 +76,14 @@ public final class NorwegianAnalyzer ext
   /**
    * Builds an analyzer with the default stop words: {@link #DEFAULT_STOPWORD_FILE}.
    */
+  public NorwegianAnalyzer() {
+    this(DefaultSetHolder.DEFAULT_STOP_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #NorwegianAnalyzer()}
+   */
+  @Deprecated
   public NorwegianAnalyzer(Version matchVersion) {
     this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET);
   }
@@ -83,9 +91,16 @@ public final class NorwegianAnalyzer ext
   /**
    * Builds an analyzer with the given stop words.
    * 
-   * @param matchVersion lucene compatibility version
    * @param stopwords a stopword set
    */
+  public NorwegianAnalyzer(CharArraySet stopwords) {
+    this(stopwords, CharArraySet.EMPTY_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #NorwegianAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public NorwegianAnalyzer(Version matchVersion, CharArraySet stopwords) {
     this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
   }
@@ -95,10 +110,18 @@ public final class NorwegianAnalyzer ext
    * provided this analyzer will add a {@link SetKeywordMarkerFilter} before
    * stemming.
    * 
-   * @param matchVersion lucene compatibility version
    * @param stopwords a stopword set
    * @param stemExclusionSet a set of terms not to be stemmed
    */
+  public NorwegianAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) {
+    super(stopwords);
+    this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(stemExclusionSet));
+  }
+
+  /**
+   * @deprecated Use {@link #NorwegianAnalyzer(CharArraySet,CharArraySet)}
+   */
+  @Deprecated
   public NorwegianAnalyzer(Version matchVersion, CharArraySet stopwords, CharArraySet stemExclusionSet) {
     super(matchVersion, stopwords);
     this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(
@@ -120,10 +143,10 @@ public final class NorwegianAnalyzer ext
   @Override
   protected TokenStreamComponents createComponents(String fieldName,
       Reader reader) {
-    final Tokenizer source = new StandardTokenizer(matchVersion, reader);
-    TokenStream result = new StandardFilter(matchVersion, source);
-    result = new LowerCaseFilter(matchVersion, result);
-    result = new StopFilter(matchVersion, result, stopwords);
+    final Tokenizer source = new StandardTokenizer(getVersion(), reader);
+    TokenStream result = new StandardFilter(getVersion(), source);
+    result = new LowerCaseFilter(getVersion(), result);
+    result = new StopFilter(getVersion(), result, stopwords);
     if(!stemExclusionSet.isEmpty())
       result = new SetKeywordMarkerFilter(result, stemExclusionSet);
     result = new SnowballFilter(result, new NorwegianStemmer());

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/pt/PortugueseAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/pt/PortugueseAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/pt/PortugueseAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/pt/PortugueseAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -41,7 +41,7 @@ import org.tartarus.snowball.ext.Portugu
  * {@link Analyzer} for Portuguese.
  * <p>
  * <a name="version"/>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating PortugueseAnalyzer:
  * <ul>
  *   <li> As of 3.6, PortugueseLightStemFilter is used for less aggressive stemming.
@@ -71,7 +71,7 @@ public final class PortugueseAnalyzer ex
     static {
       try {
         DEFAULT_STOP_SET = WordlistLoader.getSnowballWordSet(IOUtils.getDecodingReader(SnowballFilter.class, 
-            DEFAULT_STOPWORD_FILE, StandardCharsets.UTF_8), Version.LUCENE_CURRENT);
+            DEFAULT_STOPWORD_FILE, StandardCharsets.UTF_8));
       } catch (IOException ex) {
         // default set should always be present as it is part of the
         // distribution (JAR)
@@ -83,6 +83,14 @@ public final class PortugueseAnalyzer ex
   /**
    * Builds an analyzer with the default stop words: {@link #DEFAULT_STOPWORD_FILE}.
    */
+  public PortugueseAnalyzer() {
+    this(DefaultSetHolder.DEFAULT_STOP_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #PortugueseAnalyzer()}
+   */
+  @Deprecated
   public PortugueseAnalyzer(Version matchVersion) {
     this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET);
   }
@@ -90,9 +98,16 @@ public final class PortugueseAnalyzer ex
   /**
    * Builds an analyzer with the given stop words.
    * 
-   * @param matchVersion lucene compatibility version
    * @param stopwords a stopword set
    */
+  public PortugueseAnalyzer(CharArraySet stopwords) {
+    this(stopwords, CharArraySet.EMPTY_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #PortugueseAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public PortugueseAnalyzer(Version matchVersion, CharArraySet stopwords) {
     this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
   }
@@ -102,10 +117,18 @@ public final class PortugueseAnalyzer ex
    * provided this analyzer will add a {@link SetKeywordMarkerFilter} before
    * stemming.
    * 
-   * @param matchVersion lucene compatibility version
    * @param stopwords a stopword set
    * @param stemExclusionSet a set of terms not to be stemmed
    */
+  public PortugueseAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) {
+    super(stopwords);
+    this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(stemExclusionSet));
+  }
+
+  /**
+   * @deprecated Use {@link #PortugueseAnalyzer(CharArraySet, CharArraySet)}
+   */
+  @Deprecated
   public PortugueseAnalyzer(Version matchVersion, CharArraySet stopwords, CharArraySet stemExclusionSet) {
     super(matchVersion, stopwords);
     this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(
@@ -127,13 +150,13 @@ public final class PortugueseAnalyzer ex
   @Override
   protected TokenStreamComponents createComponents(String fieldName,
       Reader reader) {
-    final Tokenizer source = new StandardTokenizer(matchVersion, reader);
-    TokenStream result = new StandardFilter(matchVersion, source);
-    result = new LowerCaseFilter(matchVersion, result);
-    result = new StopFilter(matchVersion, result, stopwords);
+    final Tokenizer source = new StandardTokenizer(getVersion(), reader);
+    TokenStream result = new StandardFilter(getVersion(), source);
+    result = new LowerCaseFilter(getVersion(), result);
+    result = new StopFilter(getVersion(), result, stopwords);
     if(!stemExclusionSet.isEmpty())
       result = new SetKeywordMarkerFilter(result, stemExclusionSet);
-    if (matchVersion.onOrAfter(Version.LUCENE_3_6)) {
+    if (getVersion().onOrAfter(Version.LUCENE_3_6_0)) {
       result = new PortugueseLightStemFilter(result);
     } else {
       result = new SnowballFilter(result, new PortugueseStemmer());

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/pt/RSLPStemmerBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/pt/RSLPStemmerBase.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/pt/RSLPStemmerBase.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/pt/RSLPStemmerBase.java Thu Aug 21 03:12:52 2014
@@ -31,7 +31,6 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import org.apache.lucene.analysis.util.CharArraySet;
-import org.apache.lucene.util.Version;
 
 import static org.apache.lucene.analysis.util.StemmerUtil.*;
 
@@ -135,8 +134,7 @@ public abstract class RSLPStemmerBase {
         if (!exceptions[i].endsWith(suffix))
           throw new RuntimeException("useless exception '" + exceptions[i] + "' does not end with '" + suffix + "'");
       }
-      this.exceptions = new CharArraySet(Version.LUCENE_CURRENT,
-           Arrays.asList(exceptions), false);
+      this.exceptions = new CharArraySet(Arrays.asList(exceptions), false);
     }
 
     @Override

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/query/QueryAutoStopWordAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/query/QueryAutoStopWordAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/query/QueryAutoStopWordAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/query/QueryAutoStopWordAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -31,7 +31,6 @@ import org.apache.lucene.index.TermsEnum
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.CharsRefBuilder;
 import org.apache.lucene.util.UnicodeUtil;
-import org.apache.lucene.util.Version;
 
 /**
  * An {@link Analyzer} used primarily at query time to wrap another analyzer and provide a layer of protection
@@ -50,23 +49,20 @@ public final class QueryAutoStopWordAnal
   //The default maximum percentage (40%) of index documents which
   //can contain a term, after which the term is considered to be a stop word.
   public static final float defaultMaxDocFreqPercent = 0.4f;
-  private final Version matchVersion;
 
   /**
    * Creates a new QueryAutoStopWordAnalyzer with stopwords calculated for all
    * indexed fields from terms with a document frequency percentage greater than
    * {@link #defaultMaxDocFreqPercent}
    *
-   * @param matchVersion Version to be used in {@link StopFilter}
    * @param delegate Analyzer whose TokenStream will be filtered
    * @param indexReader IndexReader to identify the stopwords from
    * @throws IOException Can be thrown while reading from the IndexReader
    */
   public QueryAutoStopWordAnalyzer(
-      Version matchVersion,
       Analyzer delegate,
       IndexReader indexReader) throws IOException {
-    this(matchVersion, delegate, indexReader, defaultMaxDocFreqPercent);
+    this(delegate, indexReader, defaultMaxDocFreqPercent);
   }
 
   /**
@@ -74,18 +70,16 @@ public final class QueryAutoStopWordAnal
    * indexed fields from terms with a document frequency greater than the given
    * maxDocFreq
    *
-   * @param matchVersion Version to be used in {@link StopFilter}
    * @param delegate Analyzer whose TokenStream will be filtered
    * @param indexReader IndexReader to identify the stopwords from
    * @param maxDocFreq Document frequency terms should be above in order to be stopwords
    * @throws IOException Can be thrown while reading from the IndexReader
    */
   public QueryAutoStopWordAnalyzer(
-      Version matchVersion,
       Analyzer delegate,
       IndexReader indexReader,
       int maxDocFreq) throws IOException {
-    this(matchVersion, delegate, indexReader, MultiFields.getIndexedFields(indexReader), maxDocFreq);
+    this(delegate, indexReader, MultiFields.getIndexedFields(indexReader), maxDocFreq);
   }
 
   /**
@@ -93,7 +87,6 @@ public final class QueryAutoStopWordAnal
    * indexed fields from terms with a document frequency percentage greater than
    * the given maxPercentDocs
    *
-   * @param matchVersion Version to be used in {@link StopFilter}
    * @param delegate Analyzer whose TokenStream will be filtered
    * @param indexReader IndexReader to identify the stopwords from
    * @param maxPercentDocs The maximum percentage (between 0.0 and 1.0) of index documents which
@@ -101,11 +94,10 @@ public final class QueryAutoStopWordAnal
    * @throws IOException Can be thrown while reading from the IndexReader
    */
   public QueryAutoStopWordAnalyzer(
-      Version matchVersion,
       Analyzer delegate,
       IndexReader indexReader,
       float maxPercentDocs) throws IOException {
-    this(matchVersion, delegate, indexReader, MultiFields.getIndexedFields(indexReader), maxPercentDocs);
+    this(delegate, indexReader, MultiFields.getIndexedFields(indexReader), maxPercentDocs);
   }
 
   /**
@@ -113,7 +105,6 @@ public final class QueryAutoStopWordAnal
    * given selection of fields from terms with a document frequency percentage
    * greater than the given maxPercentDocs
    *
-   * @param matchVersion Version to be used in {@link StopFilter}
    * @param delegate Analyzer whose TokenStream will be filtered
    * @param indexReader IndexReader to identify the stopwords from
    * @param fields Selection of fields to calculate stopwords for
@@ -122,12 +113,11 @@ public final class QueryAutoStopWordAnal
    * @throws IOException Can be thrown while reading from the IndexReader
    */
   public QueryAutoStopWordAnalyzer(
-      Version matchVersion,
       Analyzer delegate,
       IndexReader indexReader,
       Collection<String> fields,
       float maxPercentDocs) throws IOException {
-    this(matchVersion, delegate, indexReader, fields, (int) (indexReader.numDocs() * maxPercentDocs));
+    this(delegate, indexReader, fields, (int) (indexReader.numDocs() * maxPercentDocs));
   }
 
   /**
@@ -135,7 +125,6 @@ public final class QueryAutoStopWordAnal
    * given selection of fields from terms with a document frequency greater than
    * the given maxDocFreq
    *
-   * @param matchVersion Version to be used in {@link StopFilter}
    * @param delegate Analyzer whose TokenStream will be filtered
    * @param indexReader IndexReader to identify the stopwords from
    * @param fields Selection of fields to calculate stopwords for
@@ -143,13 +132,11 @@ public final class QueryAutoStopWordAnal
    * @throws IOException Can be thrown while reading from the IndexReader
    */
   public QueryAutoStopWordAnalyzer(
-      Version matchVersion,
       Analyzer delegate,
       IndexReader indexReader,
       Collection<String> fields,
       int maxDocFreq) throws IOException {
     super(delegate.getReuseStrategy());
-    this.matchVersion = matchVersion;
     this.delegate = delegate;
     
     for (String field : fields) {
@@ -181,8 +168,8 @@ public final class QueryAutoStopWordAnal
     if (stopWords == null) {
       return components;
     }
-    StopFilter stopFilter = new StopFilter(matchVersion, components.getTokenStream(), 
-        new CharArraySet(matchVersion, stopWords, false));
+    StopFilter stopFilter = new StopFilter(components.getTokenStream(), 
+        new CharArraySet(stopWords, false));
     return new TokenStreamComponents(components.getTokenizer(), stopFilter);
   }
 

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/reverse/ReverseStringFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/reverse/ReverseStringFilter.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/reverse/ReverseStringFilter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/reverse/ReverseStringFilter.java Thu Aug 21 03:12:52 2014
@@ -73,10 +73,17 @@ public final class ReverseStringFilter e
    * <p>
    * The reversed tokens will not be marked. 
    * </p>
-   * 
-   * @param matchVersion See <a href="#version">above</a>
+   *
    * @param in {@link TokenStream} to filter
    */
+  public ReverseStringFilter(TokenStream in) {
+    this(in, NOMARKER);
+  }
+
+  /**
+   * @deprecated Use {@link #ReverseStringFilter(TokenStream)}
+   */
+  @Deprecated
   public ReverseStringFilter(Version matchVersion, TokenStream in) {
     this(matchVersion, in, NOMARKER);
   }
@@ -88,11 +95,20 @@ public final class ReverseStringFilter e
    * The reversed tokens will be prepended (marked) by the <code>marker</code>
    * character.
    * </p>
-   * 
-   * @param matchVersion See <a href="#version">above</a>
+   *
    * @param in {@link TokenStream} to filter
    * @param marker A character used to mark reversed tokens
    */
+  public ReverseStringFilter(TokenStream in, char marker) {
+    super(in);
+    this.matchVersion = Version.LATEST;
+    this.marker = marker;
+  }
+
+  /**
+   * @deprecated Use {@link #ReverseStringFilter(TokenStream,char)}
+   */
+  @Deprecated
   public ReverseStringFilter(Version matchVersion, TokenStream in, char marker) {
     super(in);
     this.matchVersion = matchVersion;
@@ -118,11 +134,18 @@ public final class ReverseStringFilter e
 
   /**
    * Reverses the given input string
-   * 
-   * @param matchVersion See <a href="#version">above</a>
+   *
    * @param input the string to reverse
    * @return the given input string in reversed order
    */
+  public static String reverse(final String input ){
+    return reverse(Version.LATEST, input);
+  }
+
+  /**
+   * @deprecated Use {@link #reverse(String)}
+   */
+  @Deprecated
   public static String reverse( Version matchVersion, final String input ){
     final char[] charInput = input.toCharArray();
     reverse( matchVersion, charInput, 0, charInput.length );
@@ -131,9 +154,16 @@ public final class ReverseStringFilter e
   
   /**
    * Reverses the given input buffer in-place
-   * @param matchVersion See <a href="#version">above</a>
    * @param buffer the input char array to reverse
    */
+  public static void reverse(final char[] buffer) {
+    reverse(Version.LATEST, buffer, 0, buffer.length);
+  }
+
+  /**
+   * @deprecated Use {@link #reverse(char[])}
+   */
+  @Deprecated
   public static void reverse(Version matchVersion, final char[] buffer) {
     reverse(matchVersion, buffer, 0, buffer.length);
   }
@@ -141,11 +171,19 @@ public final class ReverseStringFilter e
   /**
    * Partially reverses the given input buffer in-place from offset 0
    * up to the given length.
-   * @param matchVersion See <a href="#version">above</a>
    * @param buffer the input char array to reverse
    * @param len the length in the buffer up to where the
    *        buffer should be reversed
    */
+  public static void reverse(final char[] buffer,
+                             final int len) {
+    reverse(Version.LATEST, buffer, 0, len );
+  }
+
+  /**
+   * @deprecated Use {@link #reverse(char[],int)}
+   */
+  @Deprecated
   public static void reverse(Version matchVersion, final char[] buffer,
       final int len) {
     reverse( matchVersion, buffer, 0, len );
@@ -168,12 +206,20 @@ public final class ReverseStringFilter e
   /**
    * Partially reverses the given input buffer in-place from the given offset
    * up to the given length.
-   * @param matchVersion See <a href="#version">above</a>
    * @param buffer the input char array to reverse
    * @param start the offset from where to reverse the buffer
    * @param len the length in the buffer up to where the
    *        buffer should be reversed
    */
+  public static void reverse(final char[] buffer,
+                             final int start, final int len) {
+    reverse(Version.LATEST, buffer, start, len);
+  }
+
+  /**
+   * @deprecated Use {@link #reverse(char[],int,int)}
+   */
+  @Deprecated
   public static void reverse(Version matchVersion, final char[] buffer,
       final int start, final int len) {
     if (!matchVersion.onOrAfter(Version.LUCENE_3_1)) {

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/reverse/ReverseStringFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/reverse/ReverseStringFilterFactory.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/reverse/ReverseStringFilterFactory.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/reverse/ReverseStringFilterFactory.java Thu Aug 21 03:12:52 2014
@@ -40,7 +40,6 @@ public class ReverseStringFilterFactory 
   /** Creates a new ReverseStringFilterFactory */
   public ReverseStringFilterFactory(Map<String,String> args) {
     super(args);
-    assureMatchVersion();
     if (!args.isEmpty()) {
       throw new IllegalArgumentException("Unknown parameters: " + args);
     }
@@ -48,6 +47,9 @@ public class ReverseStringFilterFactory 
   
   @Override
   public ReverseStringFilter create(TokenStream in) {
+    if (luceneMatchVersion == null) {
+      return new ReverseStringFilter(in);
+    }
     return new ReverseStringFilter(luceneMatchVersion,in);
   }
 }

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/ro/RomanianAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/ro/RomanianAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/ro/RomanianAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/ro/RomanianAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -78,6 +78,14 @@ public final class RomanianAnalyzer exte
   /**
    * Builds an analyzer with the default stop words: {@link #DEFAULT_STOPWORD_FILE}.
    */
+  public RomanianAnalyzer() {
+    this(DefaultSetHolder.DEFAULT_STOP_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #RomanianAnalyzer()}
+   */
+  @Deprecated
   public RomanianAnalyzer(Version matchVersion) {
     this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET);
   }
@@ -85,9 +93,16 @@ public final class RomanianAnalyzer exte
   /**
    * Builds an analyzer with the given stop words.
    * 
-   * @param matchVersion lucene compatibility version
    * @param stopwords a stopword set
    */
+  public RomanianAnalyzer(CharArraySet stopwords) {
+    this(stopwords, CharArraySet.EMPTY_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #RomanianAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public RomanianAnalyzer(Version matchVersion, CharArraySet stopwords) {
     this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
   }
@@ -97,10 +112,18 @@ public final class RomanianAnalyzer exte
    * provided this analyzer will add a {@link SetKeywordMarkerFilter} before
    * stemming.
    * 
-   * @param matchVersion lucene compatibility version
    * @param stopwords a stopword set
    * @param stemExclusionSet a set of terms not to be stemmed
    */
+  public RomanianAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) {
+    super(stopwords);
+    this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(stemExclusionSet));
+  }
+
+  /**
+   * @deprecated Use {@link #RomanianAnalyzer(CharArraySet,CharArraySet)}
+   */
+  @Deprecated
   public RomanianAnalyzer(Version matchVersion, CharArraySet stopwords, CharArraySet stemExclusionSet) {
     super(matchVersion, stopwords);
     this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(
@@ -122,10 +145,10 @@ public final class RomanianAnalyzer exte
   @Override
   protected TokenStreamComponents createComponents(String fieldName,
       Reader reader) {
-    final Tokenizer source = new StandardTokenizer(matchVersion, reader);
-    TokenStream result = new StandardFilter(matchVersion, source);
-    result = new LowerCaseFilter(matchVersion, result);
-    result = new StopFilter(matchVersion, result, stopwords);
+    final Tokenizer source = new StandardTokenizer(getVersion(), reader);
+    TokenStream result = new StandardFilter(getVersion(), source);
+    result = new LowerCaseFilter(getVersion(), result);
+    result = new StopFilter(getVersion(), result, stopwords);
     if(!stemExclusionSet.isEmpty())
       result = new SetKeywordMarkerFilter(result, stemExclusionSet);
     result = new SnowballFilter(result, new RomanianStemmer());

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/ru/RussianAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/ru/RussianAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/ru/RussianAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/ru/RussianAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -45,7 +45,7 @@ import org.apache.lucene.util.Version;
  * A default set of stopwords is used unless an alternative list is specified.
  * </p>
  * <a name="version"/>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating RussianAnalyzer:
  * <ul>
  *   <li> As of 3.1, StandardTokenizer is used, Snowball stemming is done with
@@ -86,7 +86,7 @@ public final class RussianAnalyzer exten
       static {
         try {
           DEFAULT_STOP_SET = WordlistLoader.getSnowballWordSet(IOUtils.getDecodingReader(SnowballFilter.class, 
-              DEFAULT_STOPWORD_FILE, StandardCharsets.UTF_8), Version.LUCENE_CURRENT);
+              DEFAULT_STOPWORD_FILE, StandardCharsets.UTF_8));
         } catch (IOException ex) {
           // default set should always be present as it is part of the
           // distribution (JAR)
@@ -106,6 +106,14 @@ public final class RussianAnalyzer exten
       return DefaultSetHolder.DEFAULT_STOP_SET;
     }
 
+    public RussianAnalyzer() {
+      this(DefaultSetHolder.DEFAULT_STOP_SET);
+    }
+
+    /**
+     * @deprecated Use {@link #RussianAnalyzer()}
+     */
+    @Deprecated
     public RussianAnalyzer(Version matchVersion) {
       this(matchVersion,
         matchVersion.onOrAfter(Version.LUCENE_3_1) ? DefaultSetHolder.DEFAULT_STOP_SET
@@ -115,11 +123,17 @@ public final class RussianAnalyzer exten
     /**
      * Builds an analyzer with the given stop words
      * 
-     * @param matchVersion
-     *          lucene compatibility version
      * @param stopwords
      *          a stopword set
      */
+    public RussianAnalyzer(CharArraySet stopwords) {
+      this(stopwords, CharArraySet.EMPTY_SET);
+    }
+
+    /**
+     * @deprecated Use {@link #RussianAnalyzer(CharArraySet)}
+     */
+    @Deprecated
     public RussianAnalyzer(Version matchVersion, CharArraySet stopwords){
       this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
     }
@@ -127,12 +141,19 @@ public final class RussianAnalyzer exten
     /**
      * Builds an analyzer with the given stop words
      * 
-     * @param matchVersion
-     *          lucene compatibility version
      * @param stopwords
      *          a stopword set
      * @param stemExclusionSet a set of words not to be stemmed
      */
+    public RussianAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) {
+      super(stopwords);
+      this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(stemExclusionSet));
+    }
+
+    /**
+     * @deprecated Use {@link #RussianAnalyzer(CharArraySet)}
+     */
+    @Deprecated
     public RussianAnalyzer(Version matchVersion, CharArraySet stopwords, CharArraySet stemExclusionSet){
       super(matchVersion, stopwords);
       this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(matchVersion, stemExclusionSet));
@@ -152,19 +173,19 @@ public final class RussianAnalyzer exten
     @Override
     protected TokenStreamComponents createComponents(String fieldName,
         Reader reader) {
-      if (matchVersion.onOrAfter(Version.LUCENE_3_1)) {
-        final Tokenizer source = new StandardTokenizer(matchVersion, reader);
-        TokenStream result = new StandardFilter(matchVersion, source);
-        result = new LowerCaseFilter(matchVersion, result);
-        result = new StopFilter(matchVersion, result, stopwords);
+      if (getVersion().onOrAfter(Version.LUCENE_3_1)) {
+        final Tokenizer source = new StandardTokenizer(getVersion(), reader);
+        TokenStream result = new StandardFilter(getVersion(), source);
+        result = new LowerCaseFilter(getVersion(), result);
+        result = new StopFilter(getVersion(), result, stopwords);
         if (!stemExclusionSet.isEmpty()) result = new SetKeywordMarkerFilter(
             result, stemExclusionSet);
         result = new SnowballFilter(result, new org.tartarus.snowball.ext.RussianStemmer());
         return new TokenStreamComponents(source, result);
       } else {
-        final Tokenizer source = new RussianLetterTokenizer(matchVersion, reader);
-        TokenStream result = new LowerCaseFilter(matchVersion, source);
-        result = new StopFilter(matchVersion, result, stopwords);
+        final Tokenizer source = new RussianLetterTokenizer(getVersion(), reader);
+        TokenStream result = new LowerCaseFilter(getVersion(), source);
+        result = new StopFilter(getVersion(), result, stopwords);
         if (!stemExclusionSet.isEmpty()) result = new SetKeywordMarkerFilter(
           result, stemExclusionSet);
         result = new SnowballFilter(result, new org.tartarus.snowball.ext.RussianStemmer());

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapper.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapper.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapper.java Thu Aug 21 03:12:52 2014
@@ -20,7 +20,6 @@ package org.apache.lucene.analysis.shing
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.AnalyzerWrapper;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.lucene.util.Version;
 
 /**
  * A ShingleAnalyzerWrapper wraps a {@link ShingleFilter} around another {@link Analyzer}.
@@ -101,15 +100,15 @@ public final class ShingleAnalyzerWrappe
   /**
    * Wraps {@link StandardAnalyzer}. 
    */
-  public ShingleAnalyzerWrapper(Version matchVersion) {
-    this(matchVersion, ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE, ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE);
+  public ShingleAnalyzerWrapper() {
+    this(ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE, ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE);
   }
 
   /**
    * Wraps {@link StandardAnalyzer}. 
    */
-  public ShingleAnalyzerWrapper(Version matchVersion, int minShingleSize, int maxShingleSize) {
-    this(new StandardAnalyzer(matchVersion), minShingleSize, maxShingleSize);
+  public ShingleAnalyzerWrapper(int minShingleSize, int maxShingleSize) {
+    this(new StandardAnalyzer(), minShingleSize, maxShingleSize);
   }
 
   /**

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -17,7 +17,7 @@ package org.apache.lucene.analysis.stand
  * limitations under the License.
  */
 
-import org.apache.lucene.analysis.*;
+import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.core.LowerCaseFilter;
 import org.apache.lucene.analysis.core.StopAnalyzer;
 import org.apache.lucene.analysis.core.StopFilter;
@@ -26,7 +26,6 @@ import org.apache.lucene.analysis.util.S
 import org.apache.lucene.analysis.util.WordlistLoader;
 import org.apache.lucene.util.Version;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.Reader;
 
@@ -34,20 +33,16 @@ import java.io.Reader;
  * Filters {@link ClassicTokenizer} with {@link ClassicFilter}, {@link
  * LowerCaseFilter} and {@link StopFilter}, using a list of
  * English stop words.
- *
+ * 
  * <a name="version"/>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating ClassicAnalyzer:
  * <ul>
  *   <li> As of 3.1, StopFilter correctly handles Unicode 4.0
- *         supplementary characters in stopwords
- *   <li> As of 2.9, StopFilter preserves position
- *        increments
- *   <li> As of 2.4, Tokens incorrectly identified as acronyms
- *        are corrected (see <a href="https://issues.apache.org/jira/browse/LUCENE-1068">LUCENE-1068</a>)
+ *         supplementary characters in stopwords</li>
  * </ul>
- * 
- * ClassicAnalyzer was named StandardAnalyzer in Lucene versions prior to 3.1. 
+ *
+ * ClassicAnalyzer was named StandardAnalyzer in Lucene versions prior to 3.1.
  * As of 3.1, {@link StandardAnalyzer} implements Unicode text segmentation,
  * as specified by UAX#29.
  */
@@ -63,27 +58,45 @@ public final class ClassicAnalyzer exten
   public static final CharArraySet STOP_WORDS_SET = StopAnalyzer.ENGLISH_STOP_WORDS_SET; 
 
   /** Builds an analyzer with the given stop words.
-   * @param matchVersion Lucene version to match See {@link
-   * <a href="#version">above</a>}
    * @param stopWords stop words */
+  public ClassicAnalyzer(CharArraySet stopWords) {
+    super(stopWords);
+  }
+
+  /**
+   * @deprecated Use {@link #ClassicAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public ClassicAnalyzer(Version matchVersion, CharArraySet stopWords) {
     super(matchVersion, stopWords);
   }
 
   /** Builds an analyzer with the default stop words ({@link
    * #STOP_WORDS_SET}).
-   * @param matchVersion Lucene version to match See {@link
-   * <a href="#version">above</a>}
    */
+  public ClassicAnalyzer() {
+    this(STOP_WORDS_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #ClassicAnalyzer()}
+   */
+  @Deprecated
   public ClassicAnalyzer(Version matchVersion) {
     this(matchVersion, STOP_WORDS_SET);
   }
 
   /** Builds an analyzer with the stop words from the given reader.
-   * @see WordlistLoader#getWordSet(Reader, Version)
-   * @param matchVersion Lucene version to match See {@link
-   * <a href="#version">above</a>}
+   * @see WordlistLoader#getWordSet(Reader)
    * @param stopwords Reader to read stop words from */
+  public ClassicAnalyzer(Reader stopwords) throws IOException {
+    this(loadStopwordSet(stopwords));
+  }
+
+  /**
+   * @deprecated Use {@link #ClassicAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public ClassicAnalyzer(Version matchVersion, Reader stopwords) throws IOException {
     this(matchVersion, loadStopwordSet(stopwords, matchVersion));
   }
@@ -107,11 +120,11 @@ public final class ClassicAnalyzer exten
 
   @Override
   protected TokenStreamComponents createComponents(final String fieldName, final Reader reader) {
-    final ClassicTokenizer src = new ClassicTokenizer(matchVersion, reader);
+    final ClassicTokenizer src = new ClassicTokenizer(getVersion(), reader);
     src.setMaxTokenLength(maxTokenLength);
     TokenStream tok = new ClassicFilter(src);
-    tok = new LowerCaseFilter(matchVersion, tok);
-    tok = new StopFilter(matchVersion, tok, stopwords);
+    tok = new LowerCaseFilter(getVersion(), tok);
+    tok = new StopFilter(getVersion(), tok, stopwords);
     return new TokenStreamComponents(src, tok) {
       @Override
       protected void setReader(final Reader reader) throws IOException {

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizer.java Thu Aug 21 03:12:52 2014
@@ -26,7 +26,6 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
 import org.apache.lucene.analysis.tokenattributes.TypeAttribute;
 import org.apache.lucene.util.AttributeFactory;
-import org.apache.lucene.util.AttributeSource;
 import org.apache.lucene.util.Version;
 
 /** A grammar-based tokenizer constructed with JFlex
@@ -104,20 +103,38 @@ public final class ClassicTokenizer exte
    *
    * See http://issues.apache.org/jira/browse/LUCENE-1068
    */
+  public ClassicTokenizer(Reader input) {
+    super(input);
+    init();
+  }
+
+  /**
+   * @deprecated Use {@link #ClassicTokenizer(AttributeFactory, Reader)}
+   */
+  @Deprecated
   public ClassicTokenizer(Version matchVersion, Reader input) {
     super(input);
-    init(matchVersion);
+    init();
   }
 
   /**
    * Creates a new ClassicTokenizer with a given {@link org.apache.lucene.util.AttributeFactory} 
    */
+  public ClassicTokenizer(AttributeFactory factory, Reader input) {
+    super(factory, input);
+    init();
+  }
+
+  /**
+   * @deprecated Use {@link #ClassicTokenizer(AttributeFactory, Reader)}
+   */
+  @Deprecated
   public ClassicTokenizer(Version matchVersion, AttributeFactory factory, Reader input) {
     super(factory, input);
-    init(matchVersion);
+    init();
   }
 
-  private void init(Version matchVersion) {
+  private void init() {
     this.scanner = new ClassicTokenizerImpl(input);
   }
 

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizerFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizerFactory.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizerFactory.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizerFactory.java Thu Aug 21 03:12:52 2014
@@ -38,7 +38,6 @@ public class ClassicTokenizerFactory ext
   /** Creates a new ClassicTokenizerFactory */
   public ClassicTokenizerFactory(Map<String,String> args) {
     super(args);
-    assureMatchVersion();
     maxTokenLength = getInt(args, "maxTokenLength", StandardAnalyzer.DEFAULT_MAX_TOKEN_LENGTH);
     if (!args.isEmpty()) {
       throw new IllegalArgumentException("Unknown parameters: " + args);
@@ -47,7 +46,12 @@ public class ClassicTokenizerFactory ext
 
   @Override
   public ClassicTokenizer create(AttributeFactory factory, Reader input) {
-    ClassicTokenizer tokenizer = new ClassicTokenizer(luceneMatchVersion, factory, input); 
+    ClassicTokenizer tokenizer;
+    if (luceneMatchVersion == null) {
+      tokenizer = new ClassicTokenizer(factory, input);
+    } else {
+      tokenizer = new ClassicTokenizer(luceneMatchVersion, factory, input);
+    }
     tokenizer.setMaxTokenLength(maxTokenLength);
     return tokenizer;
   }

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -17,7 +17,7 @@ package org.apache.lucene.analysis.stand
  * limitations under the License.
  */
 
-import org.apache.lucene.analysis.*;
+import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.core.LowerCaseFilter;
 import org.apache.lucene.analysis.core.StopAnalyzer;
 import org.apache.lucene.analysis.core.StopFilter;
@@ -26,7 +26,6 @@ import org.apache.lucene.analysis.util.S
 import org.apache.lucene.analysis.util.WordlistLoader;
 import org.apache.lucene.util.Version;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.Reader;
 
@@ -36,7 +35,7 @@ import java.io.Reader;
  * English stop words.
  *
  * <a name="version"/>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating StandardAnalyzer:
  * <ul>
  *   <li> As of 3.4, Hiragana and Han characters are no longer wrongly split
@@ -44,16 +43,13 @@ import java.io.Reader;
  *        you get the exact broken behavior for backwards compatibility.
  *   <li> As of 3.1, StandardTokenizer implements Unicode text segmentation,
  *        and StopFilter correctly handles Unicode 4.0 supplementary characters
- *        in stopwords.  {@link ClassicTokenizer} and {@link ClassicAnalyzer} 
+ *        in stopwords.  {@link ClassicTokenizer} and {@link ClassicAnalyzer}
  *        are the pre-3.1 implementations of StandardTokenizer and
  *        StandardAnalyzer.
- *   <li> As of 2.9, StopFilter preserves position increments
- *   <li> As of 2.4, Tokens incorrectly identified as acronyms
- *        are corrected (see <a href="https://issues.apache.org/jira/browse/LUCENE-1068">LUCENE-1068</a>)
  * </ul>
  */
 public final class StandardAnalyzer extends StopwordAnalyzerBase {
-
+  
   /** Default maximum allowed token length */
   public static final int DEFAULT_MAX_TOKEN_LENGTH = 255;
 
@@ -64,27 +60,44 @@ public final class StandardAnalyzer exte
   public static final CharArraySet STOP_WORDS_SET = StopAnalyzer.ENGLISH_STOP_WORDS_SET; 
 
   /** Builds an analyzer with the given stop words.
-   * @param matchVersion Lucene version to match See {@link
-   * <a href="#version">above</a>}
    * @param stopWords stop words */
+  public StandardAnalyzer(CharArraySet stopWords) {
+    super(stopWords);
+  }
+
+  /**
+   * @deprecated Use {@link #StandardAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public StandardAnalyzer(Version matchVersion, CharArraySet stopWords) {
     super(matchVersion, stopWords);
   }
 
-  /** Builds an analyzer with the default stop words ({@link
-   * #STOP_WORDS_SET}).
-   * @param matchVersion Lucene version to match See {@link
-   * <a href="#version">above</a>}
+  /** Builds an analyzer with the default stop words ({@link #STOP_WORDS_SET}).
    */
+  public StandardAnalyzer() {
+    this(STOP_WORDS_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #StandardAnalyzer()}
+   */
+  @Deprecated
   public StandardAnalyzer(Version matchVersion) {
     this(matchVersion, STOP_WORDS_SET);
   }
 
   /** Builds an analyzer with the stop words from the given reader.
-   * @see WordlistLoader#getWordSet(Reader, Version)
-   * @param matchVersion Lucene version to match See {@link
-   * <a href="#version">above</a>}
+   * @see WordlistLoader#getWordSet(Reader)
    * @param stopwords Reader to read stop words from */
+  public StandardAnalyzer(Reader stopwords) throws IOException {
+    this(loadStopwordSet(stopwords));
+  }
+
+  /**
+   * @deprecated Use {@link #StandardAnalyzer()}
+   */
+  @Deprecated
   public StandardAnalyzer(Version matchVersion, Reader stopwords) throws IOException {
     this(matchVersion, loadStopwordSet(stopwords, matchVersion));
   }
@@ -108,11 +121,11 @@ public final class StandardAnalyzer exte
 
   @Override
   protected TokenStreamComponents createComponents(final String fieldName, final Reader reader) {
-    final StandardTokenizer src = new StandardTokenizer(matchVersion, reader);
+    final StandardTokenizer src = new StandardTokenizer(getVersion(), reader);
     src.setMaxTokenLength(maxTokenLength);
-    TokenStream tok = new StandardFilter(matchVersion, src);
-    tok = new LowerCaseFilter(matchVersion, tok);
-    tok = new StopFilter(matchVersion, tok, stopwords);
+    TokenStream tok = new StandardFilter(getVersion(), src);
+    tok = new LowerCaseFilter(getVersion(), tok);
+    tok = new StopFilter(getVersion(), tok, stopwords);
     return new TokenStreamComponents(src, tok) {
       @Override
       protected void setReader(final Reader reader) throws IOException {

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardFilter.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardFilter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardFilter.java Thu Aug 21 03:12:52 2014
@@ -31,6 +31,14 @@ import org.apache.lucene.util.Version;
 public class StandardFilter extends TokenFilter {
   private final Version matchVersion;
   
+  public StandardFilter(TokenStream in) {
+    this(Version.LATEST, in);
+  }
+
+  /**
+   * @deprecated Use {@link #StandardFilter(TokenStream)}
+   */
+  @Deprecated
   public StandardFilter(Version matchVersion, TokenStream in) {
     super(in);
     this.matchVersion = matchVersion;

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardFilterFactory.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardFilterFactory.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardFilterFactory.java Thu Aug 21 03:12:52 2014
@@ -38,7 +38,6 @@ public class StandardFilterFactory exten
   /** Creates a new StandardFilterFactory */
   public StandardFilterFactory(Map<String,String> args) {
     super(args);
-    assureMatchVersion();
     if (!args.isEmpty()) {
       throw new IllegalArgumentException("Unknown parameters: " + args);
     }
@@ -46,6 +45,6 @@ public class StandardFilterFactory exten
   
   @Override
   public StandardFilter create(TokenStream input) {
-    return new StandardFilter(luceneMatchVersion, input);
+    return new StandardFilter(input);
   }
 }

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardTokenizer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardTokenizer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardTokenizer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardTokenizer.java Thu Aug 21 03:12:52 2014
@@ -29,7 +29,6 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
 import org.apache.lucene.analysis.tokenattributes.TypeAttribute;
 import org.apache.lucene.util.AttributeFactory;
-import org.apache.lucene.util.AttributeSource;
 import org.apache.lucene.util.Version;
 
 /** A grammar-based tokenizer constructed with JFlex.
@@ -132,6 +131,14 @@ public final class StandardTokenizer ext
    *
    * See http://issues.apache.org/jira/browse/LUCENE-1068
    */
+  public StandardTokenizer(Reader input) {
+    this(Version.LATEST, input);
+  }
+
+  /**
+   * @deprecated Use {@link #StandardTokenizer(Reader)}
+   */
+  @Deprecated
   public StandardTokenizer(Version matchVersion, Reader input) {
     super(input);
     init(matchVersion);
@@ -140,6 +147,14 @@ public final class StandardTokenizer ext
   /**
    * Creates a new StandardTokenizer with a given {@link org.apache.lucene.util.AttributeFactory} 
    */
+  public StandardTokenizer(AttributeFactory factory, Reader input) {
+    this(Version.LATEST, factory, input);
+  }
+
+  /**
+   * @deprecated Use {@link #StandardTokenizer(AttributeFactory, Reader)}
+   */
+  @Deprecated
   public StandardTokenizer(Version matchVersion, AttributeFactory factory, Reader input) {
     super(factory, input);
     init(matchVersion);

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardTokenizerFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardTokenizerFactory.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardTokenizerFactory.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/StandardTokenizerFactory.java Thu Aug 21 03:12:52 2014
@@ -38,7 +38,6 @@ public class StandardTokenizerFactory ex
   /** Creates a new StandardTokenizerFactory */
   public StandardTokenizerFactory(Map<String,String> args) {
     super(args);
-    assureMatchVersion();
     maxTokenLength = getInt(args, "maxTokenLength", StandardAnalyzer.DEFAULT_MAX_TOKEN_LENGTH);
     if (!args.isEmpty()) {
       throw new IllegalArgumentException("Unknown parameters: " + args);
@@ -47,7 +46,12 @@ public class StandardTokenizerFactory ex
 
   @Override
   public StandardTokenizer create(AttributeFactory factory, Reader input) {
-    StandardTokenizer tokenizer = new StandardTokenizer(luceneMatchVersion, factory, input); 
+    StandardTokenizer tokenizer;
+    if (luceneMatchVersion == null) {
+      tokenizer = new StandardTokenizer(factory, input);
+    } else {
+      tokenizer = new StandardTokenizer(luceneMatchVersion, factory, input);
+    }
     tokenizer.setMaxTokenLength(maxTokenLength);
     return tokenizer;
   }

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -37,12 +37,12 @@ import java.io.Reader;
  *
  * <a name="version"/>
  * <p>
- *   You must specify the required {@link org.apache.lucene.util.Version}
+ *   You may specify the {@link org.apache.lucene.util.Version}
  *   compatibility when creating UAX29URLEmailAnalyzer
  * </p>
  */
 public final class UAX29URLEmailAnalyzer extends StopwordAnalyzerBase {
-
+  
   /** Default maximum allowed token length */
   public static final int DEFAULT_MAX_TOKEN_LENGTH = StandardAnalyzer.DEFAULT_MAX_TOKEN_LENGTH;
 
@@ -53,27 +53,45 @@ public final class UAX29URLEmailAnalyzer
   public static final CharArraySet STOP_WORDS_SET = StopAnalyzer.ENGLISH_STOP_WORDS_SET;
 
   /** Builds an analyzer with the given stop words.
-   * @param matchVersion Lucene version to match See {@link
-   * <a href="#version">above</a>}
    * @param stopWords stop words */
+  public UAX29URLEmailAnalyzer(CharArraySet stopWords) {
+    super(stopWords);
+  }
+
+  /**
+   * @deprecated Use {@link #UAX29URLEmailAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public UAX29URLEmailAnalyzer(Version matchVersion, CharArraySet stopWords) {
     super(matchVersion, stopWords);
   }
 
   /** Builds an analyzer with the default stop words ({@link
    * #STOP_WORDS_SET}).
-   * @param matchVersion Lucene version to match See {@link
-   * <a href="#version">above</a>}
    */
+  public UAX29URLEmailAnalyzer() {
+    this(STOP_WORDS_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #UAX29URLEmailAnalyzer()}
+   */
+  @Deprecated
   public UAX29URLEmailAnalyzer(Version matchVersion) {
     this(matchVersion, STOP_WORDS_SET);
   }
 
   /** Builds an analyzer with the stop words from the given reader.
-   * @see org.apache.lucene.analysis.util.WordlistLoader#getWordSet(java.io.Reader, org.apache.lucene.util.Version)
-   * @param matchVersion Lucene version to match See {@link
-   * <a href="#version">above</a>}
+   * @see org.apache.lucene.analysis.util.WordlistLoader#getWordSet(java.io.Reader)
    * @param stopwords Reader to read stop words from */
+  public UAX29URLEmailAnalyzer(Reader stopwords) throws IOException {
+    this(loadStopwordSet(stopwords));
+  }
+
+  /**
+   * @deprecated Use {@link #UAX29URLEmailAnalyzer(Reader)}
+   */
+  @Deprecated
   public UAX29URLEmailAnalyzer(Version matchVersion, Reader stopwords) throws IOException {
     this(matchVersion, loadStopwordSet(stopwords, matchVersion));
   }
@@ -97,11 +115,11 @@ public final class UAX29URLEmailAnalyzer
 
   @Override
   protected TokenStreamComponents createComponents(final String fieldName, final Reader reader) {
-    final UAX29URLEmailTokenizer src = new UAX29URLEmailTokenizer(matchVersion, reader);
+    final UAX29URLEmailTokenizer src = new UAX29URLEmailTokenizer(getVersion(), reader);
     src.setMaxTokenLength(maxTokenLength);
-    TokenStream tok = new StandardFilter(matchVersion, src);
-    tok = new LowerCaseFilter(matchVersion, tok);
-    tok = new StopFilter(matchVersion, tok, stopwords);
+    TokenStream tok = new StandardFilter(getVersion(), src);
+    tok = new LowerCaseFilter(getVersion(), tok);
+    tok = new StopFilter(getVersion(), tok, stopwords);
     return new TokenStreamComponents(src, tok) {
       @Override
       protected void setReader(final Reader reader) throws IOException {

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.java Thu Aug 21 03:12:52 2014
@@ -30,7 +30,6 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
 import org.apache.lucene.analysis.tokenattributes.TypeAttribute;
 import org.apache.lucene.util.AttributeFactory;
-import org.apache.lucene.util.AttributeSource;
 import org.apache.lucene.util.Version;
 
 /**
@@ -51,7 +50,7 @@ import org.apache.lucene.util.Version;
  *   <li>&lt;HIRAGANA&gt;: A single hiragana character</li>
  * </ul>
  * <a name="version"/>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating UAX29URLEmailTokenizer:
  * <ul>
  *   <li> As of 3.4, Hiragana and Han characters are no longer wrongly split
@@ -111,6 +110,15 @@ public final class UAX29URLEmailTokenize
    *
    * @param input The input reader
    */
+  public UAX29URLEmailTokenizer(Reader input) {
+    super(input);
+    this.scanner = getScannerFor(Version.LATEST);
+  }
+
+  /**
+   * @deprecated Use {@link #UAX29URLEmailTokenizer(Reader)}
+   */
+  @Deprecated
   public UAX29URLEmailTokenizer(Version matchVersion, Reader input) {
     super(input);
     this.scanner = getScannerFor(matchVersion);
@@ -119,6 +127,15 @@ public final class UAX29URLEmailTokenize
   /**
    * Creates a new UAX29URLEmailTokenizer with a given {@link AttributeFactory}
    */
+  public UAX29URLEmailTokenizer(AttributeFactory factory, Reader input) {
+    super(factory, input);
+    this.scanner = getScannerFor(Version.LATEST);
+  }
+
+  /**
+   * @deprecated Use {@link #UAX29URLEmailTokenizer(Reader)}
+   */
+  @Deprecated
   public UAX29URLEmailTokenizer(Version matchVersion, AttributeFactory factory, Reader input) {
     super(factory, input);
     this.scanner = getScannerFor(matchVersion);

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizerFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizerFactory.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizerFactory.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizerFactory.java Thu Aug 21 03:12:52 2014
@@ -38,7 +38,6 @@ public class UAX29URLEmailTokenizerFacto
   /** Creates a new UAX29URLEmailTokenizerFactory */
   public UAX29URLEmailTokenizerFactory(Map<String,String> args) {
     super(args);
-    assureMatchVersion();
     maxTokenLength = getInt(args, "maxTokenLength", StandardAnalyzer.DEFAULT_MAX_TOKEN_LENGTH);
     if (!args.isEmpty()) {
       throw new IllegalArgumentException("Unknown parameters: " + args);
@@ -47,7 +46,12 @@ public class UAX29URLEmailTokenizerFacto
 
   @Override
   public UAX29URLEmailTokenizer create(AttributeFactory factory, Reader input) {
-    UAX29URLEmailTokenizer tokenizer = new UAX29URLEmailTokenizer(luceneMatchVersion, factory, input); 
+    UAX29URLEmailTokenizer tokenizer;
+    if (luceneMatchVersion == null) {
+      tokenizer = new UAX29URLEmailTokenizer(factory, input);
+    } else {
+      tokenizer = new UAX29URLEmailTokenizer(luceneMatchVersion, factory, input);
+    }
     tokenizer.setMaxTokenLength(maxTokenLength);
     return tokenizer;
   }

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -64,7 +64,7 @@ public final class SwedishAnalyzer exten
     static {
       try {
         DEFAULT_STOP_SET = WordlistLoader.getSnowballWordSet(IOUtils.getDecodingReader(SnowballFilter.class, 
-            DEFAULT_STOPWORD_FILE, StandardCharsets.UTF_8), Version.LUCENE_CURRENT);
+            DEFAULT_STOPWORD_FILE, StandardCharsets.UTF_8));
       } catch (IOException ex) {
         // default set should always be present as it is part of the
         // distribution (JAR)
@@ -76,6 +76,14 @@ public final class SwedishAnalyzer exten
   /**
    * Builds an analyzer with the default stop words: {@link #DEFAULT_STOPWORD_FILE}.
    */
+  public SwedishAnalyzer() {
+    this(DefaultSetHolder.DEFAULT_STOP_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #SwedishAnalyzer()}
+   */
+  @Deprecated
   public SwedishAnalyzer(Version matchVersion) {
     this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET);
   }
@@ -83,9 +91,16 @@ public final class SwedishAnalyzer exten
   /**
    * Builds an analyzer with the given stop words.
    * 
-   * @param matchVersion lucene compatibility version
    * @param stopwords a stopword set
    */
+  public SwedishAnalyzer(CharArraySet stopwords) {
+    this(stopwords, CharArraySet.EMPTY_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #SwedishAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public SwedishAnalyzer(Version matchVersion, CharArraySet stopwords) {
     this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
   }
@@ -95,10 +110,18 @@ public final class SwedishAnalyzer exten
    * provided this analyzer will add a {@link SetKeywordMarkerFilter} before
    * stemming.
    * 
-   * @param matchVersion lucene compatibility version
    * @param stopwords a stopword set
    * @param stemExclusionSet a set of terms not to be stemmed
    */
+  public SwedishAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) {
+    super(stopwords);
+    this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(stemExclusionSet));
+  }
+
+  /**
+   * @deprecated Use {@link #SwedishAnalyzer(CharArraySet,CharArraySet)}
+   */
+  @Deprecated
   public SwedishAnalyzer(Version matchVersion, CharArraySet stopwords, CharArraySet stemExclusionSet) {
     super(matchVersion, stopwords);
     this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(
@@ -120,10 +143,10 @@ public final class SwedishAnalyzer exten
   @Override
   protected TokenStreamComponents createComponents(String fieldName,
       Reader reader) {
-    final Tokenizer source = new StandardTokenizer(matchVersion, reader);
-    TokenStream result = new StandardFilter(matchVersion, source);
-    result = new LowerCaseFilter(matchVersion, result);
-    result = new StopFilter(matchVersion, result, stopwords);
+    final Tokenizer source = new StandardTokenizer(getVersion(), reader);
+    TokenStream result = new StandardFilter(getVersion(), source);
+    result = new LowerCaseFilter(getVersion(), result);
+    result = new StopFilter(getVersion(), result, stopwords);
     if(!stemExclusionSet.isEmpty())
       result = new SetKeywordMarkerFilter(result, stemExclusionSet);
     result = new SnowballFilter(result, new SwedishStemmer());

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymFilterFactory.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymFilterFactory.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymFilterFactory.java Thu Aug 21 03:12:52 2014
@@ -67,8 +67,7 @@ public class SynonymFilterFactory extend
 
   public SynonymFilterFactory(Map<String,String> args) {
     super(args);
-    assureMatchVersion();
-    if (luceneMatchVersion.onOrAfter(Version.LUCENE_3_4)) {
+    if (luceneMatchVersion == null || luceneMatchVersion.onOrAfter(Version.LUCENE_3_4_0)) {
       delegator = new FSTSynonymFilterFactory(new HashMap<>(getOriginalArgs()));
     } else {
       // check if you use the new optional arg "format". this makes no sense for the old one, 

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -80,19 +80,32 @@ public final class ThaiAnalyzer extends 
 
   /**
    * Builds an analyzer with the default stop words.
-   * 
-   * @param matchVersion lucene compatibility version
    */
+  public ThaiAnalyzer() {
+    this(DefaultSetHolder.DEFAULT_STOP_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #ThaiAnalyzer()}
+   */
+  @Deprecated
   public ThaiAnalyzer(Version matchVersion) {
     this(matchVersion, matchVersion.onOrAfter(Version.LUCENE_3_6) ? DefaultSetHolder.DEFAULT_STOP_SET : StopAnalyzer.ENGLISH_STOP_WORDS_SET);
   }
   
   /**
    * Builds an analyzer with the given stop words.
-   * 
-   * @param matchVersion lucene compatibility version
+   *
    * @param stopwords a stopword set
    */
+  public ThaiAnalyzer(CharArraySet stopwords) {
+    super(stopwords);
+  }
+
+  /**
+   * @deprecated Use {@link #ThaiAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public ThaiAnalyzer(Version matchVersion, CharArraySet stopwords) {
     super(matchVersion, stopwords);
   }
@@ -108,21 +121,20 @@ public final class ThaiAnalyzer extends 
    *         {@link StopFilter}
    */
   @Override
-
   protected TokenStreamComponents createComponents(String fieldName,
       Reader reader) {
-    if (matchVersion.onOrAfter(Version.LUCENE_4_8_0)) {
+    if (getVersion().onOrAfter(Version.LUCENE_4_8_0)) {
       final Tokenizer source = new ThaiTokenizer(reader);
-      TokenStream result = new LowerCaseFilter(matchVersion, source);
-      result = new StopFilter(matchVersion, result, stopwords);
+      TokenStream result = new LowerCaseFilter(getVersion(), source);
+      result = new StopFilter(getVersion(), result, stopwords);
       return new TokenStreamComponents(source, result);
     } else {
-      final Tokenizer source = new StandardTokenizer(matchVersion, reader);
-      TokenStream result = new StandardFilter(matchVersion, source);
-      if (matchVersion.onOrAfter(Version.LUCENE_3_1_0))
-        result = new LowerCaseFilter(matchVersion, result);
-      result = new ThaiWordFilter(matchVersion, result);
-      return new TokenStreamComponents(source, new StopFilter(matchVersion,
+      final Tokenizer source = new StandardTokenizer(getVersion(), reader);
+      TokenStream result = new StandardFilter(getVersion(), source);
+      if (getVersion().onOrAfter(Version.LUCENE_3_1_0))
+        result = new LowerCaseFilter(getVersion(), result);
+      result = new ThaiWordFilter(getVersion(), result);
+      return new TokenStreamComponents(source, new StopFilter(getVersion(),
         result, stopwords));
     }
   }

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiWordFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiWordFilter.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiWordFilter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiWordFilter.java Thu Aug 21 03:12:52 2014
@@ -68,9 +68,17 @@ public final class ThaiWordFilter extend
   private boolean hasIllegalOffsets = false; // only if the length changed before this filter
 
   /** Creates a new ThaiWordFilter with the specified match version. */
+  public ThaiWordFilter(TokenStream input) {
+    this(Version.LATEST, input);
+  }
+
+  /**
+   * @deprecated Use {@link #ThaiWordFilter(TokenStream)}
+   */
+  @Deprecated
   public ThaiWordFilter(Version matchVersion, TokenStream input) {
     super(matchVersion.onOrAfter(Version.LUCENE_3_1) ?
-      input : new LowerCaseFilter(matchVersion, input));
+        input : new LowerCaseFilter(matchVersion, input));
     if (!DBBI_AVAILABLE)
       throw new UnsupportedOperationException("This JRE does not have support for Thai segmentation");
     handlePosIncr = matchVersion.onOrAfter(Version.LUCENE_3_1);

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiWordFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiWordFilterFactory.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiWordFilterFactory.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/th/ThaiWordFilterFactory.java Thu Aug 21 03:12:52 2014
@@ -41,7 +41,6 @@ public class ThaiWordFilterFactory exten
   /** Creates a new ThaiWordFilterFactory */
   public ThaiWordFilterFactory(Map<String,String> args) {
     super(args);
-    assureMatchVersion();
     if (!args.isEmpty()) {
       throw new IllegalArgumentException("Unknown parameters: " + args);
     }
@@ -49,7 +48,7 @@ public class ThaiWordFilterFactory exten
   
   @Override
   public ThaiWordFilter create(TokenStream input) {
-    return new ThaiWordFilter(luceneMatchVersion, input);
+    return new ThaiWordFilter(input);
   }
 }
 

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/tr/TurkishAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/tr/TurkishAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/tr/TurkishAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/tr/TurkishAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -77,16 +77,31 @@ public final class TurkishAnalyzer exten
   /**
    * Builds an analyzer with the default stop words: {@link #DEFAULT_STOPWORD_FILE}.
    */
+  public TurkishAnalyzer() {
+    this(DefaultSetHolder.DEFAULT_STOP_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #TurkishAnalyzer()}
+   */
+  @Deprecated
   public TurkishAnalyzer(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 TurkishAnalyzer(CharArraySet stopwords) {
+    this(stopwords, CharArraySet.EMPTY_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #TurkishAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public TurkishAnalyzer(Version matchVersion, CharArraySet stopwords) {
     this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
   }
@@ -95,11 +110,19 @@ public final class TurkishAnalyzer exten
    * Builds an analyzer with the given stop words. If a non-empty stem exclusion set is
    * provided this analyzer will add a {@link SetKeywordMarkerFilter} before
    * stemming.
-   * 
-   * @param matchVersion lucene compatibility version
+   *
    * @param stopwords a stopword set
    * @param stemExclusionSet a set of terms not to be stemmed
    */
+  public TurkishAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) {
+    super(stopwords);
+    this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(stemExclusionSet));
+  }
+
+  /**
+   * @deprecated Use {@link #TurkishAnalyzer(CharArraySet,CharArraySet)}
+   */
+  @Deprecated
   public TurkishAnalyzer(Version matchVersion, CharArraySet stopwords, CharArraySet stemExclusionSet) {
     super(matchVersion, stopwords);
     this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(
@@ -121,12 +144,12 @@ public final class TurkishAnalyzer exten
   @Override
   protected TokenStreamComponents createComponents(String fieldName,
       Reader reader) {
-    final Tokenizer source = new StandardTokenizer(matchVersion, reader);
-    TokenStream result = new StandardFilter(matchVersion, source);
-    if(matchVersion.onOrAfter(Version.LUCENE_4_8_0))
+    final Tokenizer source = new StandardTokenizer(getVersion(), reader);
+    TokenStream result = new StandardFilter(getVersion(), source);
+    if(getVersion().onOrAfter(Version.LUCENE_4_8_0))
       result = new ApostropheFilter(result);
     result = new TurkishLowerCaseFilter(result);
-    result = new StopFilter(matchVersion, result, stopwords);
+    result = new StopFilter(getVersion(), result, stopwords);
     if(!stemExclusionSet.isEmpty())
       result = new SetKeywordMarkerFilter(result, stemExclusionSet);
     result = new SnowballFilter(result, new TurkishStemmer());

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharArrayMap.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharArrayMap.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharArrayMap.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharArrayMap.java Thu Aug 21 03:12:52 2014
@@ -27,7 +27,6 @@ import java.util.Set;
 import org.apache.lucene.analysis.util.CharacterUtils;
 import org.apache.lucene.util.Version;
 
-
 /**
  * A simple class that stores key Strings as char[]'s in a
  * hash table. Note that this is not a general purpose
@@ -38,7 +37,7 @@ import org.apache.lucene.util.Version;
  * to a String first.
  *
  * <a name="version"></a>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating {@link CharArrayMap}:
  * <ul>
  *   <li> As of 3.1, supplementary characters are
@@ -64,16 +63,21 @@ public class CharArrayMap<V> extends Abs
 
   /**
    * Create map with enough capacity to hold startSize terms
-   * 
-   * @param matchVersion
-   *          compatibility match version see <a href="#version">Version
-   *          note</a> above for details.
+   *
    * @param startSize
    *          the initial capacity
    * @param ignoreCase
    *          <code>false</code> if and only if the set should be case sensitive
    *          otherwise <code>true</code>.
    */
+  public CharArrayMap(int startSize, boolean ignoreCase) {
+    this(Version.LATEST, startSize, ignoreCase);
+  }
+
+  /**
+   * @deprecated Use {@link #CharArrayMap(int, boolean)}
+   */
+  @Deprecated
   @SuppressWarnings("unchecked")
   public CharArrayMap(Version matchVersion, int startSize, boolean ignoreCase) {
     this.ignoreCase = ignoreCase;
@@ -88,16 +92,21 @@ public class CharArrayMap<V> extends Abs
 
   /**
    * Creates a map from the mappings in another map. 
-   * 
-   * @param matchVersion
-   *          compatibility match version see <a href="#version">Version
-   *          note</a> above for details.
+   *
    * @param c
    *          a map whose mappings to be copied
    * @param ignoreCase
    *          <code>false</code> if and only if the set should be case sensitive
    *          otherwise <code>true</code>.
    */
+  public CharArrayMap(Map<?,? extends V> c, boolean ignoreCase) {
+    this(Version.LATEST, c, ignoreCase);
+  }
+
+  /**
+   * @deprecated Use {@link #CharArrayMap(java.util.Map, boolean)}
+   */
+  @Deprecated
   public CharArrayMap(Version matchVersion, Map<?,? extends V> c, boolean ignoreCase) {
     this(matchVersion, c.size(), ignoreCase);
     putAll(c);
@@ -572,19 +581,23 @@ public class CharArrayMap<V> extends Abs
    * The {@link #copy(Version, Map)} will preserve the {@link Version} of the
    * source map it is an instance of {@link CharArrayMap}.
    * </p>
-   * 
-   * @param matchVersion
-   *          compatibility match version see <a href="#version">Version
-   *          note</a> above for details. This argument will be ignored if the
-   *          given map is a {@link CharArrayMap}.
+   *
    * @param map
    *          a map to copy
    * @return a copy of the given map as a {@link CharArrayMap}. If the given map
    *         is a {@link CharArrayMap} the ignoreCase property as well as the
    *         matchVersion will be of the given map will be preserved.
    */
+  public static <V> CharArrayMap<V> copy(final Map<?,? extends V> map) {
+    return copy(Version.LATEST, map);
+  }
+
+  /**
+   * @deprecated Use {@link #copy(Map)}
+   */
+  @Deprecated
   @SuppressWarnings("unchecked")
-  public static <V> CharArrayMap<V> copy(final Version matchVersion, final Map<?,? extends V> map) {
+  public static <V> CharArrayMap<V> copy(Version matchVersion, final Map<?,? extends V> map) {
     if(map == EMPTY_MAP)
       return emptyMap();
     if(map instanceof CharArrayMap) {
@@ -659,7 +672,7 @@ public class CharArrayMap<V> extends Abs
    */
   private static final class EmptyCharArrayMap<V> extends UnmodifiableCharArrayMap<V> {
     EmptyCharArrayMap() {
-      super(new CharArrayMap<V>(Version.LUCENE_CURRENT, 0, false));
+      super(new CharArrayMap<V>(0, false));
     }
     
     @Override

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharArraySet.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharArraySet.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharArraySet.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharArraySet.java Thu Aug 21 03:12:52 2014
@@ -35,7 +35,7 @@ import org.apache.lucene.util.Version;
  * to a String first.
  *
  * <a name="version"></a>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating {@link CharArraySet}:
  * <ul>
  *   <li> As of 3.1, supplementary characters are
@@ -64,15 +64,20 @@ public class CharArraySet extends Abstra
   /**
    * Create set with enough capacity to hold startSize terms
    * 
-   * @param matchVersion
-   *          compatibility match version see <a href="#version">Version
-   *          note</a> above for details.
    * @param startSize
    *          the initial capacity
    * @param ignoreCase
    *          <code>false</code> if and only if the set should be case sensitive
    *          otherwise <code>true</code>.
    */
+  public CharArraySet(int startSize, boolean ignoreCase) {
+    this(new CharArrayMap<>(startSize, ignoreCase));
+  }
+
+  /**
+   * @deprecated Use {@link #CharArraySet(int, boolean)}
+   */
+  @Deprecated
   public CharArraySet(Version matchVersion, int startSize, boolean ignoreCase) {
     this(new CharArrayMap<>(matchVersion, startSize, ignoreCase));
   }
@@ -80,15 +85,20 @@ public class CharArraySet extends Abstra
   /**
    * Creates a set from a Collection of objects. 
    * 
-   * @param matchVersion
-   *          compatibility match version see <a href="#version">Version
-   *          note</a> above for details.
    * @param c
    *          a collection whose elements to be placed into the set
    * @param ignoreCase
    *          <code>false</code> if and only if the set should be case sensitive
    *          otherwise <code>true</code>.
    */
+  public CharArraySet(Collection<?> c, boolean ignoreCase) {
+    this(Version.LATEST, c, ignoreCase);
+  }
+
+  /**
+   * @deprecated Use {@link #CharArraySet(Collection, boolean)}
+   */
+  @Deprecated
   public CharArraySet(Version matchVersion, Collection<?> c, boolean ignoreCase) {
     this(matchVersion, c.size(), ignoreCase);
     addAll(c);
@@ -179,18 +189,22 @@ public class CharArraySet extends Abstra
    * The {@link #copy(Version, Set)} will preserve the {@link Version} of the
    * source set it is an instance of {@link CharArraySet}.
    * </p>
-   * 
-   * @param matchVersion
-   *          compatibility match version see <a href="#version">Version
-   *          note</a> above for details. This argument will be ignored if the
-   *          given set is a {@link CharArraySet}.
+   *
    * @param set
    *          a set to copy
    * @return a copy of the given set as a {@link CharArraySet}. If the given set
    *         is a {@link CharArraySet} the ignoreCase property as well as the
    *         matchVersion will be of the given set will be preserved.
    */
-  public static CharArraySet copy(final Version matchVersion, final Set<?> set) {
+  public static CharArraySet copy(final Set<?> set) {
+    return copy(Version.LATEST, set);
+  }
+
+  /**
+   * @deprecated Use {@link #copy(java.util.Set)}
+   */
+  @Deprecated
+  public static CharArraySet copy(Version matchVersion, final Set<?> set) {
     if(set == EMPTY_SET)
       return EMPTY_SET;
     if(set instanceof CharArraySet) {

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharTokenizer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharTokenizer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharTokenizer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharTokenizer.java Thu Aug 21 03:12:52 2014
@@ -24,8 +24,6 @@ import org.apache.lucene.analysis.Tokeni
 import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
 import org.apache.lucene.util.AttributeFactory;
-import org.apache.lucene.util.AttributeSource;
-import org.apache.lucene.analysis.util.CharacterUtils;
 import org.apache.lucene.util.Version;
 import org.apache.lucene.analysis.util.CharacterUtils.CharacterBuffer;
 
@@ -70,12 +68,18 @@ public abstract class CharTokenizer exte
   
   /**
    * Creates a new {@link CharTokenizer} instance
-   * 
-   * @param matchVersion
-   *          Lucene version to match
    * @param input
    *          the input to split up into tokens
    */
+  public CharTokenizer(Reader input) {
+    super(input);
+    charUtils = CharacterUtils.getInstance();
+  }
+
+  /**
+   * @deprecated Use {@link #CharTokenizer(Reader)}
+   */
+  @Deprecated
   public CharTokenizer(Version matchVersion, Reader input) {
     super(input);
     charUtils = CharacterUtils.getInstance(matchVersion);
@@ -84,19 +88,26 @@ public abstract class CharTokenizer exte
   /**
    * Creates a new {@link CharTokenizer} instance
    * 
-   * @param matchVersion
-   *          Lucene version to match
    * @param factory
    *          the attribute factory to use for this {@link Tokenizer}
    * @param input
    *          the input to split up into tokens
    */
+  public CharTokenizer(AttributeFactory factory, Reader input) {
+    super(factory, input);
+    charUtils = CharacterUtils.getInstance();
+  }
+
+  /**
+   * @deprecated Use {@link #CharTokenizer(AttributeFactory, Reader)}
+   */
+  @Deprecated
   public CharTokenizer(Version matchVersion, AttributeFactory factory,
       Reader input) {
     super(factory, input);
     charUtils = CharacterUtils.getInstance(matchVersion);
   }
-  
+
   private int offset = 0, bufferIndex = 0, dataLen = 0, finalOffset = 0;
   private static final int MAX_WORD_LEN = 255;
   private static final int IO_BUFFER_SIZE = 4096;

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharacterUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharacterUtils.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharacterUtils.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/CharacterUtils.java Thu Aug 21 03:12:52 2014
@@ -34,19 +34,30 @@ public abstract class CharacterUtils {
   private static final Java5CharacterUtils JAVA_5 = new Java5CharacterUtils();
 
   /**
-   * Returns a {@link CharacterUtils} implementation according to the given
-   * {@link Version} instance.
-   * 
-   * @param matchVersion
-   *          a version instance
+   * Returns a {@link CharacterUtils} implementation.
    * @return a {@link CharacterUtils} implementation according to the given
    *         {@link Version} instance.
    */
-  public static CharacterUtils getInstance(final Version matchVersion) {
+  public static CharacterUtils getInstance() {
+    return JAVA_5;
+  }
+
+  /**
+   * @deprecated Use {@link #getInstance()}
+   */
+  @Deprecated
+  public static CharacterUtils getInstance(Version matchVersion) {
     return matchVersion.onOrAfter(Version.LUCENE_3_1) ? JAVA_5 : JAVA_4;
   }
 
   /** Return a {@link CharacterUtils} instance compatible with Java 1.4. */
+
+  
+  /** 
+   * explicitly returns a version matching java 4 semantics 
+   * @deprecated Only for n-gram backwards compat
+   */
+  @Deprecated
   public static CharacterUtils getJava4Instance() {
     return JAVA_4;
   }
@@ -57,7 +68,7 @@ public abstract class CharacterUtils {
    * {@link CharacterUtils#getInstance(Version)} this method mimics the behavior
    * of {@link Character#codePointAt(char[], int)} as it would have been
    * available on a Java 1.4 JVM or on a later virtual machine version.
-   * 
+   *
    * @param seq
    *          a character sequence
    * @param offset
@@ -79,7 +90,7 @@ public abstract class CharacterUtils {
    * {@link CharacterUtils#getInstance(Version)} this method mimics the behavior
    * of {@link Character#codePointAt(char[], int)} as it would have been
    * available on a Java 1.4 JVM or on a later virtual machine version.
-   * 
+   *
    * @param chars
    *          a character array
    * @param offset



Mime
View raw message