lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rjer...@apache.org
Subject svn commit: r1619283 [2/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/core/LetterTokenizer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/LetterTokenizer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/LetterTokenizer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/LetterTokenizer.java Thu Aug 21 03:12:52 2014
@@ -34,7 +34,7 @@ import org.apache.lucene.util.Version;
  * </p>
  * <p>
  * <a name="version"/>
- * You must specify the required {@link Version} compatibility when creating
+ * You may specify the {@link Version} compatibility when creating
  * {@link LetterTokenizer}:
  * <ul>
  * <li>As of 3.1, {@link CharTokenizer} uses an int based API to normalize and
@@ -48,12 +48,17 @@ public class LetterTokenizer extends Cha
   
   /**
    * Construct a new LetterTokenizer.
-   * 
-   * @param matchVersion
-   *          Lucene version to match See {@link <a href="#version">above</a>}
    * @param in
    *          the input to split up into tokens
    */
+  public LetterTokenizer(Reader in) {
+    super(in);
+  }
+
+  /**
+   * @deprecated Use {@link #LetterTokenizer(Reader)}
+   */
+  @Deprecated
   public LetterTokenizer(Version matchVersion, Reader in) {
     super(matchVersion, in);
   }
@@ -62,13 +67,19 @@ public class LetterTokenizer extends Cha
    * Construct a new LetterTokenizer using a given
    * {@link org.apache.lucene.util.AttributeFactory}.
    * 
-   * @param matchVersion
-   *          Lucene version to match See {@link <a href="#version">above</a>}
    * @param factory
    *          the attribute factory to use for this {@link Tokenizer}
    * @param in
    *          the input to split up into tokens
    */
+  public LetterTokenizer(AttributeFactory factory, Reader in) {
+    super(factory, in);
+  }
+
+  /**
+   * @deprecated Use {@link #LetterTokenizer(AttributeFactory,Reader)}
+   */
+  @Deprecated
   public LetterTokenizer(Version matchVersion, AttributeFactory factory, Reader in) {
     super(matchVersion, factory, in);
   }

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

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseFilter.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseFilter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseFilter.java Thu Aug 21 03:12:52 2014
@@ -28,7 +28,7 @@ import org.apache.lucene.util.Version;
 /**
  * Normalizes token text to lower case.
  * <a name="version"/>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating LowerCaseFilter:
  * <ul>
  *   <li> As of 3.1, supplementary characters are properly lowercased.
@@ -40,10 +40,18 @@ public final class LowerCaseFilter exten
   
   /**
    * Create a new LowerCaseFilter, that normalizes token text to lower case.
-   * 
-   * @param matchVersion See <a href="#version">above</a>
+   *
    * @param in TokenStream to filter
    */
+  public LowerCaseFilter(TokenStream in) {
+    super(in);
+    charUtils = CharacterUtils.getInstance();
+  }
+
+  /**
+   * @deprecated Use {@link #LowerCaseFilter(TokenStream)}
+   */
+  @Deprecated
   public LowerCaseFilter(Version matchVersion, TokenStream in) {
     super(in);
     charUtils = CharacterUtils.getInstance(matchVersion);

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

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseTokenizer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseTokenizer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseTokenizer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/LowerCaseTokenizer.java Thu Aug 21 03:12:52 2014
@@ -22,7 +22,6 @@ import java.io.Reader;
 import org.apache.lucene.analysis.Tokenizer;
 import org.apache.lucene.analysis.util.CharTokenizer;
 import org.apache.lucene.util.AttributeFactory;
-import org.apache.lucene.util.AttributeSource;
 import org.apache.lucene.util.Version;
 
 /**
@@ -37,7 +36,7 @@ import org.apache.lucene.util.Version;
  * </p>
  * <p>
  * <a name="version"/>
- * You must specify the required {@link Version} compatibility when creating
+ * You may specify the required {@link Version} compatibility when creating
  * {@link LowerCaseTokenizer}:
  * <ul>
  * <li>As of 3.1, {@link CharTokenizer} uses an int based API to normalize and
@@ -50,13 +49,17 @@ public final class LowerCaseTokenizer ex
   
   /**
    * Construct a new LowerCaseTokenizer.
-   * 
-   * @param matchVersion
-   *          Lucene version to match See {@link <a href="#version">above</a>}
-   * 
    * @param in
    *          the input to split up into tokens
    */
+  public LowerCaseTokenizer(Reader in) {
+    super(in);
+  }
+
+  /**
+   * @deprecated Use {@link #LowerCaseTokenizer(Reader)}
+   */
+  @Deprecated
   public LowerCaseTokenizer(Version matchVersion, Reader in) {
     super(matchVersion, in);
   }
@@ -65,13 +68,19 @@ public final class LowerCaseTokenizer ex
    * Construct a new LowerCaseTokenizer using a given
    * {@link org.apache.lucene.util.AttributeFactory}.
    *
-   * @param matchVersion
-   *          Lucene version to match See {@link <a href="#version">above</a>}
    * @param factory
    *          the attribute factory to use for this {@link Tokenizer}
    * @param in
    *          the input to split up into tokens
    */
+  public LowerCaseTokenizer(AttributeFactory factory, Reader in) {
+    super(factory, in);
+  }
+
+  /**
+   * @deprecated Use {@link #LowerCaseTokenizer(AttributeFactory,Reader)}
+   */
+  @Deprecated
   public LowerCaseTokenizer(Version matchVersion, AttributeFactory factory, Reader in) {
     super(matchVersion, factory, in);
   }

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

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/SimpleAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/SimpleAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/SimpleAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/SimpleAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -26,8 +26,8 @@ import org.apache.lucene.util.Version;
 /** An {@link Analyzer} that filters {@link LetterTokenizer} 
  *  with {@link LowerCaseFilter} 
  * <p>
- * <a name="version">You must specify the required {@link Version} compatibility
- * when creating {@link CharTokenizer}:
+ * <a name="version">You may specify the {@link Version} compatibility
+ * when creating {@link SimpleAnalyzer}:
  * <ul>
  * <li>As of 3.1, {@link LowerCaseTokenizer} uses an int based API to normalize and
  * detect token codepoints. See {@link CharTokenizer#isTokenChar(int)} and
@@ -37,19 +37,22 @@ import org.apache.lucene.util.Version;
  **/
 public final class SimpleAnalyzer extends Analyzer {
 
-  private final Version matchVersion;
-  
   /**
    * Creates a new {@link SimpleAnalyzer}
-   * @param matchVersion Lucene version to match See {@link <a href="#version">above</a>}
    */
+  public SimpleAnalyzer() {}
+
+  /**
+   * @deprecated Use {@link #SimpleAnalyzer()}
+   */
+  @Deprecated
   public SimpleAnalyzer(Version matchVersion) {
-    this.matchVersion = matchVersion;
+    setVersion(matchVersion);
   }
   
   @Override
   protected TokenStreamComponents createComponents(final String fieldName,
       final Reader reader) {
-    return new TokenStreamComponents(new LowerCaseTokenizer(matchVersion, reader));
+    return new TokenStreamComponents(new LowerCaseTokenizer(getVersion(), reader));
   }
 }

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -29,18 +29,17 @@ import org.apache.lucene.analysis.util.S
 import org.apache.lucene.analysis.util.WordlistLoader;
 import org.apache.lucene.util.Version;
 
-/** Filters {@link LetterTokenizer} with {@link LowerCaseFilter} and {@link StopFilter}.
+/** 
+ * Filters {@link LetterTokenizer} with {@link LowerCaseFilter} and {@link StopFilter}.
  *
  * <a name="version"/>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating StopAnalyzer:
  * <ul>
  *    <li> As of 3.1, StopFilter correctly handles Unicode 4.0
  *         supplementary characters in stopwords
- *   <li> As of 2.9, position increments are preserved
  * </ul>
-*/
-
+ */
 public final class StopAnalyzer extends StopwordAnalyzerBase {
   
   /** An unmodifiable set containing some common English words that are not usually useful
@@ -55,38 +54,65 @@ public final class StopAnalyzer extends 
       "that", "the", "their", "then", "there", "these",
       "they", "this", "to", "was", "will", "with"
     );
-    final CharArraySet stopSet = new CharArraySet(Version.LUCENE_CURRENT, 
-        stopWords, false);
+    final CharArraySet stopSet = new CharArraySet(stopWords, false);
     ENGLISH_STOP_WORDS_SET = CharArraySet.unmodifiableSet(stopSet); 
   }
   
   /** Builds an analyzer which removes words in
    *  {@link #ENGLISH_STOP_WORDS_SET}.
-   * @param matchVersion See <a href="#version">above</a>
    */
+  public StopAnalyzer() {
+    this(ENGLISH_STOP_WORDS_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #StopAnalyzer()}
+   */
+  @Deprecated
   public StopAnalyzer(Version matchVersion) {
     this(matchVersion, ENGLISH_STOP_WORDS_SET);
   }
 
   /** Builds an analyzer with the stop words from the given set.
-   * @param matchVersion See <a href="#version">above</a>
    * @param stopWords Set of stop words */
+  public StopAnalyzer(CharArraySet stopWords) {
+    super(stopWords);
+  }
+
+  /**
+   * @deprecated Use {@link #StopAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public StopAnalyzer(Version matchVersion, CharArraySet stopWords) {
     super(matchVersion, stopWords);
   }
 
   /** Builds an analyzer with the stop words from the given file.
-   * @see WordlistLoader#getWordSet(Reader, Version)
-   * @param matchVersion See <a href="#version">above</a>
+   * @see WordlistLoader#getWordSet(Reader)
    * @param stopwordsFile File to load stop words from */
+  public StopAnalyzer(File stopwordsFile) throws IOException {
+    this(loadStopwordSet(stopwordsFile));
+  }
+
+  /**
+   * @deprecated Use {@link #StopAnalyzer(File)}
+   */
+  @Deprecated
   public StopAnalyzer(Version matchVersion, File stopwordsFile) throws IOException {
     this(matchVersion, loadStopwordSet(stopwordsFile, matchVersion));
   }
 
   /** Builds an analyzer with the stop words from the given reader.
-   * @see WordlistLoader#getWordSet(Reader, Version)
-   * @param matchVersion See <a href="#version">above</a>
+   * @see WordlistLoader#getWordSet(Reader)
    * @param stopwords Reader to load stop words from */
+  public StopAnalyzer(Reader stopwords) throws IOException {
+    this(loadStopwordSet(stopwords));
+  }
+
+  /**
+   * @deprecated Use {@link #StopAnalyzer(Reader)}
+   */
+  @Deprecated
   public StopAnalyzer(Version matchVersion, Reader stopwords) throws IOException {
     this(matchVersion, loadStopwordSet(stopwords, matchVersion));
   }
@@ -103,8 +129,8 @@ public final class StopAnalyzer extends 
   @Override
   protected TokenStreamComponents createComponents(String fieldName,
       Reader reader) {
-    final Tokenizer source = new LowerCaseTokenizer(matchVersion, reader);
-    return new TokenStreamComponents(source, new StopFilter(matchVersion,
+    final Tokenizer source = new LowerCaseTokenizer(getVersion(), reader);
+    return new TokenStreamComponents(source, new StopFilter(getVersion(),
           source, stopwords));
   }
 }

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopFilter.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopFilter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopFilter.java Thu Aug 21 03:12:52 2014
@@ -28,9 +28,9 @@ import org.apache.lucene.util.Version;
 
 /**
  * Removes stop words from a token stream.
- * 
+ *
  * <a name="version"/>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating StopFilter:
  * <ul>
  *   <li> As of 3.1, StopFilter correctly handles Unicode 4.0
@@ -47,15 +47,20 @@ public final class StopFilter extends Fi
    * Constructs a filter which removes words from the input TokenStream that are
    * named in the Set.
    * 
-   * @param matchVersion
-   *          Lucene version to enable correct Unicode 4.0 behavior in the stop
-   *          set if Version > 3.0.  See <a href="#version">above</a> for details.
    * @param in
    *          Input stream
    * @param stopWords
    *          A {@link CharArraySet} representing the stopwords.
-   * @see #makeStopSet(Version, java.lang.String...)
+   * @see #makeStopSet(java.lang.String...)
    */
+  public StopFilter(TokenStream in, CharArraySet stopWords) {
+    this(Version.LATEST, in, stopWords);
+  }
+
+  /**
+   * @deprecated Use {@link #StopFilter(TokenStream, CharArraySet)}
+   */
+  @Deprecated
   public StopFilter(Version matchVersion, TokenStream in, CharArraySet stopWords) {
     super(matchVersion, in);
     this.stopWords = stopWords;
@@ -67,10 +72,17 @@ public final class StopFilter extends Fi
    * This permits this stopWords construction to be cached once when
    * an Analyzer is constructed.
    * 
-   * @param matchVersion Lucene version to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0
    * @param stopWords An array of stopwords
-   * @see #makeStopSet(Version, java.lang.String[], boolean) passing false to ignoreCase
+   * @see #makeStopSet(java.lang.String[], boolean) passing false to ignoreCase
+   */
+  public static CharArraySet makeStopSet(String... stopWords) {
+    return makeStopSet(stopWords, false);
+  }
+
+  /**
+   * @deprecated Use {@link #makeStopSet(String...)}
    */
+  @Deprecated
   public static CharArraySet makeStopSet(Version matchVersion, String... stopWords) {
     return makeStopSet(matchVersion, stopWords, false);
   }
@@ -81,11 +93,18 @@ public final class StopFilter extends Fi
    * This permits this stopWords construction to be cached once when
    * an Analyzer is constructed.
    * 
-   * @param matchVersion Lucene version to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0
    * @param stopWords A List of Strings or char[] or any other toString()-able list representing the stopwords
    * @return A Set ({@link CharArraySet}) containing the words
-   * @see #makeStopSet(Version, java.lang.String[], boolean) passing false to ignoreCase
+   * @see #makeStopSet(java.lang.String[], boolean) passing false to ignoreCase
+   */
+  public static CharArraySet makeStopSet(List<?> stopWords) {
+    return makeStopSet(stopWords, false);
+  }
+
+  /**
+   * @deprecated Use {@link #makeStopSet(List)}
    */
+  @Deprecated
   public static CharArraySet makeStopSet(Version matchVersion, List<?> stopWords) {
     return makeStopSet(matchVersion, stopWords, false);
   }
@@ -93,11 +112,20 @@ public final class StopFilter extends Fi
   /**
    * Creates a stopword set from the given stopword array.
    * 
-   * @param matchVersion Lucene version to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0
    * @param stopWords An array of stopwords
    * @param ignoreCase If true, all words are lower cased first.  
    * @return a Set containing the words
    */    
+  public static CharArraySet makeStopSet(String[] stopWords, boolean ignoreCase) {
+    CharArraySet stopSet = new CharArraySet(stopWords.length, ignoreCase);
+    stopSet.addAll(Arrays.asList(stopWords));
+    return stopSet;
+  }
+
+  /**
+   * @deprecated Use {@link #makeStopSet(String[],boolean)}
+   */
+  @Deprecated
   public static CharArraySet makeStopSet(Version matchVersion, String[] stopWords, boolean ignoreCase) {
     CharArraySet stopSet = new CharArraySet(matchVersion, stopWords.length, ignoreCase);
     stopSet.addAll(Arrays.asList(stopWords));
@@ -106,12 +134,21 @@ public final class StopFilter extends Fi
   
   /**
    * Creates a stopword set from the given stopword list.
-   * @param matchVersion Lucene version to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0
    * @param stopWords A List of Strings or char[] or any other toString()-able list representing the stopwords
    * @param ignoreCase if true, all words are lower cased first
    * @return A Set ({@link CharArraySet}) containing the words
    */
-  public static CharArraySet makeStopSet(Version matchVersion, List<?> stopWords, boolean ignoreCase){
+  public static CharArraySet makeStopSet(List<?> stopWords, boolean ignoreCase){
+    CharArraySet stopSet = new CharArraySet(stopWords.size(), ignoreCase);
+    stopSet.addAll(stopWords);
+    return stopSet;
+  }
+
+  /**
+   * @deprecated Use {@link #makeStopSet(List,boolean)}
+   */
+  @Deprecated
+  public static CharArraySet makeStopSet(Version matchVersion, List<?> stopWords, boolean ignoreCase) {
     CharArraySet stopSet = new CharArraySet(matchVersion, stopWords.size(), ignoreCase);
     stopSet.addAll(stopWords);
     return stopSet;

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopFilterFactory.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopFilterFactory.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopFilterFactory.java Thu Aug 21 03:12:52 2014
@@ -82,7 +82,6 @@ public class StopFilterFactory extends T
   /** Creates a new StopFilterFactory */
   public StopFilterFactory(Map<String,String> args) {
     super(args);
-    assureMatchVersion();
     stopWordFiles = get(args, "words");
     format = get(args, "format", (null == stopWordFiles ? null : FORMAT_WORDSET));
     ignoreCase = getBoolean(args, "ignoreCase", false);
@@ -106,7 +105,11 @@ public class StopFilterFactory extends T
       if (null != format) {
         throw new IllegalArgumentException("'format' can not be specified w/o an explicit 'words' file: " + format);
       }
-      stopWords = new CharArraySet(luceneMatchVersion, StopAnalyzer.ENGLISH_STOP_WORDS_SET, ignoreCase);
+      if (luceneMatchVersion == null) {
+        stopWords = new CharArraySet(StopAnalyzer.ENGLISH_STOP_WORDS_SET, ignoreCase);
+      } else {
+        stopWords = new CharArraySet(luceneMatchVersion, StopAnalyzer.ENGLISH_STOP_WORDS_SET, ignoreCase);
+      }
     }
   }
 
@@ -124,7 +127,12 @@ public class StopFilterFactory extends T
 
   @Override
   public TokenStream create(TokenStream input) {
-    StopFilter stopFilter = new StopFilter(luceneMatchVersion,input,stopWords);
+    StopFilter stopFilter;
+    if (luceneMatchVersion == null) {
+      stopFilter = new StopFilter(input, stopWords);
+    } else {
+      stopFilter = new StopFilter(luceneMatchVersion, input,stopWords);
+    }
     stopFilter.setEnablePositionIncrements(enablePositionIncrements);
     return stopFilter;
   }

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/TypeTokenFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/TypeTokenFilter.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/TypeTokenFilter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/TypeTokenFilter.java Thu Aug 21 03:12:52 2014
@@ -49,12 +49,19 @@ public final class TypeTokenFilter exten
 
   /**
    * Create a new {@link TypeTokenFilter}.
-   * @param version      the Lucene match version
    * @param input        the {@link TokenStream} to consume
    * @param stopTypes    the types to filter
    * @param useWhiteList if true, then tokens whose type is in stopTypes will
    *                     be kept, otherwise they will be filtered out
    */
+  public TypeTokenFilter(TokenStream input, Set<String> stopTypes, boolean useWhiteList) {
+    this(Version.LATEST, input, stopTypes, useWhiteList);
+  }
+
+  /**
+   * @deprecated Use {@link #TypeTokenFilter(TokenStream,Set,boolean)}
+   */
+  @Deprecated
   public TypeTokenFilter(Version version, TokenStream input, Set<String> stopTypes, boolean useWhiteList) {
     super(version, input);
     this.stopTypes = stopTypes;
@@ -64,8 +71,15 @@ public final class TypeTokenFilter exten
   /**
    * Create a new {@link TypeTokenFilter} that filters tokens out
    * (useWhiteList=false).
-   * @see #TypeTokenFilter(Version, TokenStream, Set, boolean)
    */
+  public TypeTokenFilter(TokenStream input, Set<String> stopTypes) {
+    this(input, stopTypes, false);
+  }
+
+  /**
+   * @deprecated Use {@link #TypeTokenFilter(TokenStream,Set)}
+   */
+  @Deprecated
   public TypeTokenFilter(Version version, TokenStream input, Set<String> stopTypes) {
     this(version, input, stopTypes, false);
   }

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/TypeTokenFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/TypeTokenFilterFactory.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/TypeTokenFilterFactory.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/TypeTokenFilterFactory.java Thu Aug 21 03:12:52 2014
@@ -21,6 +21,7 @@ import org.apache.lucene.analysis.TokenS
 import org.apache.lucene.analysis.util.ResourceLoader;
 import org.apache.lucene.analysis.util.ResourceLoaderAware;
 import org.apache.lucene.analysis.util.TokenFilterFactory;
+import org.apache.lucene.util.Version;
 
 import java.io.IOException;
 import java.util.HashSet;
@@ -50,6 +51,10 @@ public class TypeTokenFilterFactory exte
     super(args);
     stopTypesFiles = require(args, "types");
     enablePositionIncrements = getBoolean(args, "enablePositionIncrements", true);
+    if (enablePositionIncrements == false &&
+        (luceneMatchVersion == null || luceneMatchVersion.onOrAfter(Version.LUCENE_4_4_0))) {
+      throw new IllegalArgumentException("enablePositionIncrements=false is not supported anymore as of Lucene 4.4");
+    }
     useWhitelist = getBoolean(args, "useWhitelist", false);
     if (!args.isEmpty()) {
       throw new IllegalArgumentException("Unknown parameters: " + args);
@@ -78,6 +83,10 @@ public class TypeTokenFilterFactory exte
 
   @Override
   public TokenStream create(TokenStream input) {
+    if (luceneMatchVersion == null) {
+      final TokenStream filter = new TypeTokenFilter(input, stopTypes, useWhitelist);
+      return filter;
+    }
     @SuppressWarnings("deprecation")
     final TokenStream filter = new TypeTokenFilter(luceneMatchVersion, enablePositionIncrements, input, stopTypes, useWhitelist);
     return filter;

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/UpperCaseFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/UpperCaseFilter.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/UpperCaseFilter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/UpperCaseFilter.java Thu Aug 21 03:12:52 2014
@@ -28,9 +28,9 @@ import org.apache.lucene.util.Version;
 /**
  * Normalizes token text to UPPER CASE.
  * <a name="version"/>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating UpperCaseFilter
- * 
+ *
  * <p><b>NOTE:</b> In Unicode, this transformation may lose information when the
  * upper case character represents more than one lower case character. Use this filter
  * when you require uppercase tokens.  Use the {@link LowerCaseFilter} for 
@@ -43,9 +43,17 @@ public final class UpperCaseFilter exten
   /**
    * Create a new UpperCaseFilter, that normalizes token text to upper case.
    * 
-   * @param matchVersion See <a href="#version">above</a>
    * @param in TokenStream to filter
    */
+  public UpperCaseFilter(TokenStream in) {
+    super(in);
+    charUtils = CharacterUtils.getInstance();
+  }
+
+  /**
+   * @deprecated Use {@link #UpperCaseFilter(TokenStream)}
+   */
+  @Deprecated
   public UpperCaseFilter(Version matchVersion, TokenStream in) {
     super(in);
     charUtils = CharacterUtils.getInstance(matchVersion);

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/UpperCaseFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/UpperCaseFilterFactory.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/UpperCaseFilterFactory.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/UpperCaseFilterFactory.java Thu Aug 21 03:12:52 2014
@@ -20,7 +20,6 @@ package org.apache.lucene.analysis.core;
 import java.util.Map;
 
 import org.apache.lucene.analysis.TokenStream;
-import org.apache.lucene.analysis.core.UpperCaseFilter;
 import org.apache.lucene.analysis.util.AbstractAnalysisFactory;
 import org.apache.lucene.analysis.util.MultiTermAwareComponent;
 import org.apache.lucene.analysis.util.TokenFilterFactory;
@@ -45,7 +44,6 @@ public class UpperCaseFilterFactory exte
   /** Creates a new UpperCaseFilterFactory */
   public UpperCaseFilterFactory(Map<String,String> args) {
     super(args);
-    assureMatchVersion();
     if (!args.isEmpty()) {
       throw new IllegalArgumentException("Unknown parameters: " + args);
     }
@@ -53,7 +51,10 @@ public class UpperCaseFilterFactory exte
 
   @Override
   public UpperCaseFilter create(TokenStream input) {
-    return new UpperCaseFilter(luceneMatchVersion,input);
+    if (luceneMatchVersion == null) {
+      return new UpperCaseFilter(input);
+    }
+    return new UpperCaseFilter(luceneMatchVersion, input);
   }
 
   @Override

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -26,8 +26,8 @@ import org.apache.lucene.util.Version;
 /**
  * An Analyzer that uses {@link WhitespaceTokenizer}.
  * <p>
- * <a name="version">You must specify the required {@link Version} compatibility
- * when creating {@link CharTokenizer}:
+ * <a name="version">You may specify the {@link Version} compatibility
+ * when creating {@link WhitespaceAnalyzer}:
  * <ul>
  * <li>As of 3.1, {@link WhitespaceTokenizer} uses an int based API to normalize and
  * detect token codepoints. See {@link CharTokenizer#isTokenChar(int)} and
@@ -37,19 +37,22 @@ import org.apache.lucene.util.Version;
  **/
 public final class WhitespaceAnalyzer extends Analyzer {
   
-  private final Version matchVersion;
-  
   /**
    * Creates a new {@link WhitespaceAnalyzer}
-   * @param matchVersion Lucene version to match See {@link <a href="#version">above</a>}
    */
+  public WhitespaceAnalyzer() {}
+
+  /**
+   * @deprecated Use {@link #WhitespaceAnalyzer()}
+   */
+  @Deprecated
   public WhitespaceAnalyzer(Version matchVersion) {
-    this.matchVersion = matchVersion;
+    setVersion(matchVersion);
   }
   
   @Override
   protected TokenStreamComponents createComponents(final String fieldName,
       final Reader reader) {
-    return new TokenStreamComponents(new WhitespaceTokenizer(matchVersion, reader));
+    return new TokenStreamComponents(new WhitespaceTokenizer(getVersion(), reader));
   }
 }

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceTokenizer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceTokenizer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceTokenizer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/WhitespaceTokenizer.java Thu Aug 21 03:12:52 2014
@@ -22,7 +22,6 @@ import java.io.Reader;
 import org.apache.lucene.analysis.Tokenizer;
 import org.apache.lucene.analysis.util.CharTokenizer;
 import org.apache.lucene.util.AttributeFactory;
-import org.apache.lucene.util.AttributeSource;
 import org.apache.lucene.util.Version;
 
 /**
@@ -30,7 +29,7 @@ import org.apache.lucene.util.Version;
  * Adjacent sequences of non-Whitespace characters form tokens. <a
  * name="version"/>
  * <p>
- * You must specify the required {@link Version} compatibility when creating
+ * You may specify the {@link Version} compatibility when creating
  * {@link WhitespaceTokenizer}:
  * <ul>
  * <li>As of 3.1, {@link CharTokenizer} uses an int based API to normalize and
@@ -47,6 +46,14 @@ public final class WhitespaceTokenizer e
    * @param in
    *          the input to split up into tokens
    */
+  public WhitespaceTokenizer(Reader in) {
+    super(in);
+  }
+
+  /**
+   * @deprecated Use {@link #WhitespaceTokenizer(Reader)}
+   */
+  @Deprecated
   public WhitespaceTokenizer(Version matchVersion, Reader in) {
     super(matchVersion, in);
   }
@@ -55,14 +62,19 @@ public final class WhitespaceTokenizer e
    * Construct a new WhitespaceTokenizer using a given
    * {@link org.apache.lucene.util.AttributeFactory}.
    *
-   * @param
-   *          matchVersion Lucene version to match See
-   *          {@link <a href="#version">above</a>}
    * @param factory
    *          the attribute factory to use for this {@link Tokenizer}
    * @param in
    *          the input to split up into tokens
    */
+  public WhitespaceTokenizer(AttributeFactory factory, Reader in) {
+    super(factory, in);
+  }
+
+  /**
+   * @deprecated Use {@link #WhitespaceTokenizer(AttributeFactory, Reader)}
+   */
+  @Deprecated
   public WhitespaceTokenizer(Version matchVersion, AttributeFactory factory, Reader in) {
     super(matchVersion, factory, in);
   }

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

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/cz/CzechAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/cz/CzechAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/cz/CzechAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/cz/CzechAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -44,7 +44,7 @@ import java.nio.charset.StandardCharsets
  * 
  * <a name="version"/>
  * <p>
- * You must specify the required {@link Version} compatibility when creating
+ * You may specify the {@link Version} compatibility when creating
  * CzechAnalyzer:
  * <ul>
  * <li>As of 3.1, words are stemmed with {@link CzechStemFilter}
@@ -72,7 +72,7 @@ public final class CzechAnalyzer extends
     static {
       try {
         DEFAULT_SET = WordlistLoader.getWordSet(IOUtils.getDecodingReader(CzechAnalyzer.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)
@@ -86,10 +86,15 @@ public final class CzechAnalyzer extends
 
   /**
    * Builds an analyzer with the default stop words ({@link #getDefaultStopSet()}).
-   *
-   * @param matchVersion Lucene version to match See
-   *          {@link <a href="#version">above</a>}
    */
+  public CzechAnalyzer() {
+    this(DefaultSetHolder.DEFAULT_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #CzechAnalyzer()}
+   */
+  @Deprecated
   public CzechAnalyzer(Version matchVersion) {
     this(matchVersion, DefaultSetHolder.DEFAULT_SET);
   }
@@ -97,10 +102,16 @@ public final class CzechAnalyzer extends
   /**
    * Builds an analyzer with the given stop words.
    *
-   * @param matchVersion Lucene version to match See
-   *          {@link <a href="#version">above</a>}
    * @param stopwords a stopword set
    */
+  public CzechAnalyzer(CharArraySet stopwords) {
+    this(stopwords, CharArraySet.EMPTY_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #CzechAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public CzechAnalyzer(Version matchVersion, CharArraySet stopwords) {
     this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
   }
@@ -108,12 +119,19 @@ public final class CzechAnalyzer extends
   /**
    * Builds an analyzer with the given stop words and a set of work to be
    * excluded from the {@link CzechStemFilter}.
-   * 
-   * @param matchVersion Lucene version to match See
-   *          {@link <a href="#version">above</a>}
+   *
    * @param stopwords a stopword set
    * @param stemExclusionTable a stemming exclusion set
    */
+  public CzechAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionTable) {
+    super(stopwords);
+    this.stemExclusionTable = CharArraySet.unmodifiableSet(CharArraySet.copy(stemExclusionTable));
+  }
+
+  /**
+   * @deprecated Use {@link #CzechAnalyzer(CharArraySet, CharArraySet)}
+   */
+  @Deprecated
   public CzechAnalyzer(Version matchVersion, CharArraySet stopwords, CharArraySet stemExclusionTable) {
     super(matchVersion, stopwords);
     this.stemExclusionTable = CharArraySet.unmodifiableSet(CharArraySet.copy(matchVersion, stemExclusionTable));
@@ -129,18 +147,18 @@ public final class CzechAnalyzer extends
    *         {@link StandardFilter}, {@link LowerCaseFilter}, {@link StopFilter}
    *         , and {@link CzechStemFilter} (only if version is >= LUCENE_3_1). If
    *         a version is >= LUCENE_3_1 and a stem exclusion set is provided via
-   *         {@link #CzechAnalyzer(Version, CharArraySet, CharArraySet)} a
+   *         {@link #CzechAnalyzer(CharArraySet, CharArraySet)} a
    *         {@link SetKeywordMarkerFilter} is added before
    *         {@link CzechStemFilter}.
    */
   @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);
-    if (matchVersion.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 (getVersion().onOrAfter(Version.LUCENE_3_1_0)) {
       if(!this.stemExclusionTable.isEmpty())
         result = new SetKeywordMarkerFilter(result, stemExclusionTable);
       result = new CzechStemFilter(result);

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/da/DanishAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/da/DanishAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/da/DanishAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/da/DanishAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -64,7 +64,7 @@ public final class DanishAnalyzer extend
     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 DanishAnalyzer extend
   /**
    * Builds an analyzer with the default stop words: {@link #DEFAULT_STOPWORD_FILE}.
    */
+  public DanishAnalyzer() {
+    this(DefaultSetHolder.DEFAULT_STOP_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #DanishAnalyzer()}
+   */
+  @Deprecated
   public DanishAnalyzer(Version matchVersion) {
     this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET);
   }
@@ -83,9 +91,16 @@ public final class DanishAnalyzer extend
   /**
    * Builds an analyzer with the given stop words.
    * 
-   * @param matchVersion lucene compatibility version
    * @param stopwords a stopword set
    */
+  public DanishAnalyzer(CharArraySet stopwords) {
+    this(stopwords, CharArraySet.EMPTY_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #DanishAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public DanishAnalyzer(Version matchVersion, CharArraySet stopwords) {
     this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
   }
@@ -95,10 +110,18 @@ public final class DanishAnalyzer extend
    * 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 DanishAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) {
+    super(stopwords);
+    this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(stemExclusionSet));
+  }
+
+  /**
+   * @deprecated Use {@link #DanishAnalyzer(CharArraySet,CharArraySet)}
+   */
+  @Deprecated
   public DanishAnalyzer(Version matchVersion, CharArraySet stopwords, CharArraySet stemExclusionSet) {
     super(matchVersion, stopwords);
     this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(
@@ -120,10 +143,10 @@ public final class DanishAnalyzer extend
   @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 DanishStemmer());

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -51,14 +51,12 @@ import org.tartarus.snowball.ext.German2
  * </p>
  * 
  * <a name="version"/>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating GermanAnalyzer:
  * <ul>
  *   <li> As of 3.6, GermanLightStemFilter is used for less aggressive stemming.
  *   <li> As of 3.1, Snowball stemming is done with SnowballFilter, and 
  *        Snowball stopwords are used by default.
- *   <li> As of 2.9, StopFilter preserves position
- *        increments
  * </ul>
  * 
  * <p><b>NOTE</b>: This class uses the same {@link Version}
@@ -103,7 +101,7 @@ public final class GermanAnalyzer extend
     static {
       try {
         DEFAULT_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)
@@ -125,6 +123,14 @@ public final class GermanAnalyzer extend
    * Builds an analyzer with the default stop words:
    * {@link #getDefaultStopSet()}.
    */
+  public GermanAnalyzer() {
+    this(DefaultSetHolder.DEFAULT_SET);
+  }
+
+  /**
+   * @deprecated {@link #GermanAnalyzer()}
+   */
+  @Deprecated
   public GermanAnalyzer(Version matchVersion) {
     this(matchVersion,
         matchVersion.onOrAfter(Version.LUCENE_3_1) ? DefaultSetHolder.DEFAULT_SET
@@ -134,11 +140,17 @@ public final class GermanAnalyzer extend
   /**
    * Builds an analyzer with the given stop words 
    * 
-   * @param matchVersion
-   *          lucene compatibility version
    * @param stopwords
    *          a stopword set
    */
+  public GermanAnalyzer(CharArraySet stopwords) {
+    this(stopwords, CharArraySet.EMPTY_SET);
+  }
+
+  /**
+   * @deprecated {@link #GermanAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public GermanAnalyzer(Version matchVersion, CharArraySet stopwords) {
     this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
   }
@@ -146,13 +158,20 @@ public final class GermanAnalyzer extend
   /**
    * Builds an analyzer with the given stop words
    * 
-   * @param matchVersion
-   *          lucene compatibility version
    * @param stopwords
    *          a stopword set
    * @param stemExclusionSet
    *          a stemming exclusion set
    */
+  public GermanAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) {
+    super(stopwords);
+    exclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(stemExclusionSet));
+  }
+
+  /**
+   * @deprecated {@link #GermanAnalyzer(CharArraySet,CharArraySet)}
+   */
+  @Deprecated
   public GermanAnalyzer(Version matchVersion, CharArraySet stopwords, CharArraySet stemExclusionSet) {
     super(matchVersion, stopwords);
     exclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(matchVersion, stemExclusionSet));
@@ -172,15 +191,15 @@ public final class GermanAnalyzer extend
   @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);
     result = new SetKeywordMarkerFilter(result, exclusionSet);
-    if (matchVersion.onOrAfter(Version.LUCENE_3_6)) {
+    if (getVersion().onOrAfter(Version.LUCENE_3_6)) {
       result = new GermanNormalizationFilter(result);
       result = new GermanLightStemFilter(result);
-    } else if (matchVersion.onOrAfter(Version.LUCENE_3_1)) {
+    } else if (getVersion().onOrAfter(Version.LUCENE_3_1)) {
       result = new SnowballFilter(result, new German2Stemmer());
     } else {
       result = new GermanStemFilter(result);

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/el/GreekAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/el/GreekAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/el/GreekAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/el/GreekAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -39,12 +39,10 @@ import org.apache.lucene.util.Version;
  * </p>
  *
  * <a name="version"/>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating GreekAnalyzer:
  * <ul>
  *   <li> As of 3.1, StandardFilter and GreekStemmer are used by default.
- *   <li> As of 2.9, StopFilter preserves position
- *        increments
  * </ul>
  * 
  * <p><b>NOTE</b>: This class uses the same {@link Version}
@@ -78,9 +76,15 @@ public final class GreekAnalyzer extends
   
   /**
    * Builds an analyzer with the default stop words.
-   * @param matchVersion Lucene compatibility version,
-   *   See <a href="#version">above</a>
    */
+  public GreekAnalyzer() {
+    this(DefaultSetHolder.DEFAULT_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #GreekAnalyzer()}
+   */
+  @Deprecated
   public GreekAnalyzer(Version matchVersion) {
     this(matchVersion, DefaultSetHolder.DEFAULT_SET);
   }
@@ -90,11 +94,16 @@ public final class GreekAnalyzer extends
    * <p>
    * <b>NOTE:</b> The stopwords set should be pre-processed with the logic of 
    * {@link GreekLowerCaseFilter} for best results.
-   *  
-   * @param matchVersion Lucene compatibility version,
-   *   See <a href="#version">above</a>
    * @param stopwords a stopword set
    */
+  public GreekAnalyzer(CharArraySet stopwords) {
+    super(stopwords);
+  }
+
+  /**
+   * @deprecated Use {@link #GreekAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public GreekAnalyzer(Version matchVersion, CharArraySet stopwords) {
     super(matchVersion, stopwords);
   }
@@ -112,12 +121,12 @@ public final class GreekAnalyzer extends
   @Override
   protected TokenStreamComponents createComponents(String fieldName,
       Reader reader) {
-    final Tokenizer source = new StandardTokenizer(matchVersion, reader);
-    TokenStream result = new GreekLowerCaseFilter(matchVersion, source);
-    if (matchVersion.onOrAfter(Version.LUCENE_3_1))
-      result = new StandardFilter(matchVersion, result);
-    result = new StopFilter(matchVersion, result, stopwords);
-    if (matchVersion.onOrAfter(Version.LUCENE_3_1))
+    final Tokenizer source = new StandardTokenizer(getVersion(), reader);
+    TokenStream result = new GreekLowerCaseFilter(getVersion(), source);
+    if (getVersion().onOrAfter(Version.LUCENE_3_1))
+      result = new StandardFilter(getVersion(), result);
+    result = new StopFilter(getVersion(), result, stopwords);
+    if (getVersion().onOrAfter(Version.LUCENE_3_1))
       result = new GreekStemFilter(result);
     return new TokenStreamComponents(source, result);
   }

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/el/GreekLowerCaseFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/el/GreekLowerCaseFilter.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/el/GreekLowerCaseFilter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/el/GreekLowerCaseFilter.java Thu Aug 21 03:12:52 2014
@@ -28,7 +28,7 @@ import org.apache.lucene.util.Version;
  * Normalizes token text to lower case, removes some Greek diacritics,
  * and standardizes final sigma to sigma. 
  * <a name="version"/>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating GreekLowerCaseFilter:
  * <ul>
  *   <li> As of 3.1, supplementary characters are properly lowercased.
@@ -41,10 +41,17 @@ public final class GreekLowerCaseFilter 
   /**
    * Create a GreekLowerCaseFilter that normalizes Greek token text.
    * 
-   * @param matchVersion Lucene compatibility version, 
-   *   See <a href="#version">above</a>
    * @param in TokenStream to filter
    */
+  public GreekLowerCaseFilter(TokenStream in) {
+    super(in);
+    this.charUtils = CharacterUtils.getInstance();
+  }
+
+  /**
+   * @deprecated Use {@link #GreekLowerCaseFilter(TokenStream)}
+   */
+  @Deprecated
   public GreekLowerCaseFilter(Version matchVersion, TokenStream in) {
     super(in);
     this.charUtils = CharacterUtils.getInstance(matchVersion);

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

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/el/GreekStemmer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/el/GreekStemmer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/el/GreekStemmer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/el/GreekStemmer.java Thu Aug 21 03:12:52 2014
@@ -1,7 +1,6 @@
 package org.apache.lucene.analysis.el;
 
 import org.apache.lucene.analysis.util.CharArraySet;
-import org.apache.lucene.util.Version;
 
 import java.util.Arrays;
 
@@ -205,7 +204,7 @@ public class GreekStemmer {
     return len;
   }
   
-  private static final CharArraySet exc4 = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc4 = new CharArraySet(
       Arrays.asList("θ", "δ", "ελ", "γαλ", "ν", "π", "ιδ", "παρ"),
       false);
   
@@ -231,7 +230,7 @@ public class GreekStemmer {
     return len;
   }
 
-  private static final CharArraySet exc6 = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc6 = new CharArraySet(
       Arrays.asList("αλ", "αδ", "ενδ", "αμαν", "αμμοχαλ", "ηθ", "ανηθ",
           "αντιδ", "φυσ", "βρωμ", "γερ", "εξωδ", "καλπ", "καλλιν", "καταδ",
           "μουλ", "μπαν", "μπαγιατ", "μπολ", "μποσ", "νιτ", "ξικ", "συνομηλ",
@@ -256,7 +255,7 @@ public class GreekStemmer {
     return len;
   }
   
-  private static final CharArraySet exc7 = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc7 = new CharArraySet(
       Arrays.asList("αναπ", "αποθ", "αποκ", "αποστ", "βουβ", "ξεθ", "ουλ",
           "πεθ", "πικρ", "ποτ", "σιχ", "χ"), 
       false);
@@ -283,11 +282,11 @@ public class GreekStemmer {
     return len;
   }
 
-  private static final CharArraySet exc8a = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc8a = new CharArraySet(
       Arrays.asList("τρ", "τσ"),
       false);
 
-  private static final CharArraySet exc8b = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc8b = new CharArraySet(
       Arrays.asList("βετερ", "βουλκ", "βραχμ", "γ", "δραδουμ", "θ", "καλπουζ",
           "καστελ", "κορμορ", "λαοπλ", "μωαμεθ", "μ", "μουσουλμ", "ν", "ουλ",
           "π", "πελεκ", "πλ", "πολισ", "πορτολ", "σαρακατσ", "σουλτ",
@@ -346,7 +345,7 @@ public class GreekStemmer {
     return len;
   }
   
-  private static final CharArraySet exc9 = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc9 = new CharArraySet(
       Arrays.asList("αβαρ", "βεν", "εναρ", "αβρ", "αδ", "αθ", "αν", "απλ",
           "βαρον", "ντρ", "σκ", "κοπ", "μπορ", "νιφ", "παγ", "παρακαλ", "σερπ",
           "σκελ", "συρφ", "τοκ", "υ", "δ", "εμ", "θαρρ", "θ"), 
@@ -434,11 +433,11 @@ public class GreekStemmer {
     return len;
   }
 
-  private static final CharArraySet exc12a = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc12a = new CharArraySet(
       Arrays.asList("π", "απ", "συμπ", "ασυμπ", "ακαταπ", "αμεταμφ"),
       false);
 
-  private static final CharArraySet exc12b = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc12b = new CharArraySet(
       Arrays.asList("αλ", "αρ", "εκτελ", "ζ", "μ", "ξ", "παρακαλ", "αρ", "προ", "νισ"),
       false);
   
@@ -458,7 +457,7 @@ public class GreekStemmer {
     return len;
   }
   
-  private static final CharArraySet exc13 = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc13 = new CharArraySet(
       Arrays.asList("διαθ", "θ", "παρακαταθ", "προσθ", "συνθ"),
       false);
   
@@ -492,7 +491,7 @@ public class GreekStemmer {
     return len;
   }
   
-  private static final CharArraySet exc14 = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc14 = new CharArraySet(
       Arrays.asList("φαρμακ", "χαδ", "αγκ", "αναρρ", "βρομ", "εκλιπ", "λαμπιδ",
           "λεχ", "μ", "πατ", "ρ", "λ", "μεδ", "μεσαζ", "υποτειν", "αμ", "αιθ",
           "ανηκ", "δεσποζ", "ενδιαφερ", "δε", "δευτερευ", "καθαρευ", "πλε",
@@ -530,7 +529,7 @@ public class GreekStemmer {
    return len;
   }
   
-  private static final CharArraySet exc15a = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc15a = new CharArraySet(
       Arrays.asList("αβαστ", "πολυφ", "αδηφ", "παμφ", "ρ", "ασπ", "αφ", "αμαλ",
           "αμαλλι", "ανυστ", "απερ", "ασπαρ", "αχαρ", "δερβεν", "δροσοπ",
           "ξεφ", "νεοπ", "νομοτ", "ολοπ", "ομοτ", "προστ", "προσωποπ", "συμπ",
@@ -539,7 +538,7 @@ public class GreekStemmer {
           "ουλαμ", "ουρ", "π", "τρ", "μ"), 
       false);
   
-  private static final CharArraySet exc15b = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc15b = new CharArraySet(
       Arrays.asList("ψοφ", "ναυλοχ"),
       false);
   
@@ -576,7 +575,7 @@ public class GreekStemmer {
     return len;
   }
   
-  private static final CharArraySet exc16 = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc16 = new CharArraySet(
       Arrays.asList("ν", "χερσον", "δωδεκαν", "ερημον", "μεγαλον", "επταν"),
       false);
   
@@ -596,7 +595,7 @@ public class GreekStemmer {
     return len;
   }
   
-  private static final CharArraySet exc17 = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc17 = new CharArraySet(
       Arrays.asList("ασβ", "σβ", "αχρ", "χρ", "απλ", "αειμν", "δυσχρ", "ευχρ", "κοινοχρ", "παλιμψ"),
       false);
   
@@ -610,7 +609,7 @@ public class GreekStemmer {
     return len;
   }
   
-  private static final CharArraySet exc18 = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc18 = new CharArraySet(
       Arrays.asList("ν", "ρ", "σπι", "στραβομουτσ", "κακομουτσ", "εξων"),
       false);
   
@@ -634,7 +633,7 @@ public class GreekStemmer {
     return len;
   }
   
-  private static final CharArraySet exc19 = new CharArraySet(Version.LUCENE_CURRENT,
+  private static final CharArraySet exc19 = new CharArraySet(
       Arrays.asList("παρασουσ", "φ", "χ", "ωριοπλ", "αζ", "αλλοσουσ", "ασουσ"),
       false);
   

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/EnglishAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/EnglishAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/EnglishAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/EnglishAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -57,6 +57,14 @@ public final class EnglishAnalyzer exten
   /**
    * Builds an analyzer with the default stop words: {@link #getDefaultStopSet}.
    */
+  public EnglishAnalyzer() {
+    this(DefaultSetHolder.DEFAULT_STOP_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #EnglishAnalyzer()}
+   */
+  @Deprecated
   public EnglishAnalyzer(Version matchVersion) {
     this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET);
   }
@@ -64,9 +72,16 @@ public final class EnglishAnalyzer exten
   /**
    * Builds an analyzer with the given stop words.
    * 
-   * @param matchVersion lucene compatibility version
    * @param stopwords a stopword set
    */
+  public EnglishAnalyzer(CharArraySet stopwords) {
+    this(stopwords, CharArraySet.EMPTY_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #EnglishAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public EnglishAnalyzer(Version matchVersion, CharArraySet stopwords) {
     this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
   }
@@ -76,10 +91,18 @@ public final class EnglishAnalyzer 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 EnglishAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) {
+    super(stopwords);
+    this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(stemExclusionSet));
+  }
+
+  /**
+   * @deprecated Use {@link #EnglishAnalyzer(CharArraySet,CharArraySet)}
+   */
+  @Deprecated
   public EnglishAnalyzer(Version matchVersion, CharArraySet stopwords, CharArraySet stemExclusionSet) {
     super(matchVersion, stopwords);
     this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(
@@ -102,13 +125,13 @@ public final class EnglishAnalyzer exten
   @Override
   protected TokenStreamComponents createComponents(String fieldName,
       Reader reader) {
-    final Tokenizer source = new StandardTokenizer(matchVersion, reader);
-    TokenStream result = new StandardFilter(matchVersion, source);
+    final Tokenizer source = new StandardTokenizer(getVersion(), reader);
+    TokenStream result = new StandardFilter(getVersion(), source);
     // prior to this we get the classic behavior, standardfilter does it for us.
-    if (matchVersion.onOrAfter(Version.LUCENE_3_1))
-      result = new EnglishPossessiveFilter(matchVersion, result);
-    result = new LowerCaseFilter(matchVersion, result);
-    result = new StopFilter(matchVersion, result, stopwords);
+    if (getVersion().onOrAfter(Version.LUCENE_3_1))
+      result = new EnglishPossessiveFilter(getVersion(), result);
+    result = new LowerCaseFilter(getVersion(), result);
+    result = new StopFilter(getVersion(), result, stopwords);
     if(!stemExclusionSet.isEmpty())
       result = new SetKeywordMarkerFilter(result, stemExclusionSet);
     result = new PorterStemFilter(result);

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/EnglishPossessiveFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/EnglishPossessiveFilter.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/EnglishPossessiveFilter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/EnglishPossessiveFilter.java Thu Aug 21 03:12:52 2014
@@ -27,7 +27,7 @@ import org.apache.lucene.util.Version;
 /**
  * TokenFilter that removes possessives (trailing 's) from words.
  * <a name="version"/>
- * <p>You must specify the required {@link Version}
+ * <p>You may specify the {@link Version}
  * compatibility when creating EnglishPossessiveFilter:
  * <ul>
  *    <li> As of 3.6, U+2019 RIGHT SINGLE QUOTATION MARK and 

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

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/KStemmer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/KStemmer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/KStemmer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/KStemmer.java Thu Aug 21 03:12:52 2014
@@ -64,7 +64,6 @@ import org.apache.lucene.analysis.util.O
  * <p>Copyright: Copyright 2008, Luicid Imagination, Inc. </p>
  * <p>Copyright: Copyright 2003, CIIR University of Massachusetts Amherst (http://ciir.cs.umass.edu) </p>
  */
-import org.apache.lucene.util.Version;
 
 /**
  * This class implements the Kstem algorithm
@@ -280,7 +279,7 @@ public class KStemmer {
     DictEntry defaultEntry;
     DictEntry entry;
 
-    CharArrayMap<DictEntry> d = new CharArrayMap<>(Version.LUCENE_CURRENT, 1000, false);
+    CharArrayMap<DictEntry> d = new CharArrayMap<>(1000, false);
     for (int i = 0; i < exceptionWords.length; i++) {
       if (!d.containsKey(exceptionWords[i])) {
         entry = new DictEntry(exceptionWords[i], true);

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/es/SpanishAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/es/SpanishAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/es/SpanishAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/es/SpanishAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -71,7 +71,7 @@ public final class SpanishAnalyzer 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)
@@ -83,6 +83,14 @@ public final class SpanishAnalyzer exten
   /**
    * Builds an analyzer with the default stop words: {@link #DEFAULT_STOPWORD_FILE}.
    */
+  public SpanishAnalyzer() {
+    this(DefaultSetHolder.DEFAULT_STOP_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #SpanishAnalyzer()}
+   */
+  @Deprecated
   public SpanishAnalyzer(Version matchVersion) {
     this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET);
   }
@@ -90,9 +98,16 @@ public final class SpanishAnalyzer exten
   /**
    * Builds an analyzer with the given stop words.
    * 
-   * @param matchVersion lucene compatibility version
    * @param stopwords a stopword set
    */
+  public SpanishAnalyzer(CharArraySet stopwords) {
+    this(stopwords, CharArraySet.EMPTY_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #SpanishAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public SpanishAnalyzer(Version matchVersion, CharArraySet stopwords) {
     this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
   }
@@ -102,10 +117,18 @@ public final class SpanishAnalyzer 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 SpanishAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) {
+    super(stopwords);
+    this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(stemExclusionSet));
+  }
+
+  /**
+   * @deprecated Use {@link #SpanishAnalyzer(CharArraySet,CharArraySet)}
+   */
+  @Deprecated
   public SpanishAnalyzer(Version matchVersion, CharArraySet stopwords, CharArraySet stemExclusionSet) {
     super(matchVersion, stopwords);
     this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(
@@ -127,13 +150,13 @@ public final class SpanishAnalyzer 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);
-    if (matchVersion.onOrAfter(Version.LUCENE_3_6)) {
+    if (getVersion().onOrAfter(Version.LUCENE_3_6)) {
       result = new SpanishLightStemFilter(result);
     } else {
       result = new SnowballFilter(result, new SpanishStemmer());

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/eu/BasqueAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/eu/BasqueAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/eu/BasqueAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/eu/BasqueAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -73,6 +73,14 @@ public final class BasqueAnalyzer extend
   /**
    * Builds an analyzer with the default stop words: {@link #DEFAULT_STOPWORD_FILE}.
    */
+  public BasqueAnalyzer() {
+    this(DefaultSetHolder.DEFAULT_STOP_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #BasqueAnalyzer()}
+   */
+  @Deprecated
   public BasqueAnalyzer(Version matchVersion) {
     this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET);
   }
@@ -80,9 +88,16 @@ public final class BasqueAnalyzer extend
   /**
    * Builds an analyzer with the given stop words.
    * 
-   * @param matchVersion lucene compatibility version
    * @param stopwords a stopword set
    */
+  public BasqueAnalyzer(CharArraySet stopwords) {
+    this(stopwords, CharArraySet.EMPTY_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #BasqueAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public BasqueAnalyzer(Version matchVersion, CharArraySet stopwords) {
     this(matchVersion, stopwords, CharArraySet.EMPTY_SET);
   }
@@ -92,10 +107,18 @@ public final class BasqueAnalyzer extend
    * 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 BasqueAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) {
+    super(stopwords);
+    this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(stemExclusionSet));
+  }
+
+  /**
+   * @deprecated Use {@link #BasqueAnalyzer(CharArraySet,CharArraySet)}
+   */
+  @Deprecated
   public BasqueAnalyzer(Version matchVersion, CharArraySet stopwords, CharArraySet stemExclusionSet) {
     super(matchVersion, stopwords);
     this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy(
@@ -117,10 +140,10 @@ public final class BasqueAnalyzer extend
   @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 BasqueStemmer());

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/fa/PersianAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/fa/PersianAnalyzer.java?rev=1619283&r1=1619282&r2=1619283&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/fa/PersianAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/fa/PersianAnalyzer.java Thu Aug 21 03:12:52 2014
@@ -88,6 +88,14 @@ public final class PersianAnalyzer exten
    * Builds an analyzer with the default stop words:
    * {@link #DEFAULT_STOPWORD_FILE}.
    */
+  public PersianAnalyzer() {
+    this(DefaultSetHolder.DEFAULT_STOP_SET);
+  }
+
+  /**
+   * @deprecated Use {@link #PersianAnalyzer()}
+   */
+  @Deprecated
   public PersianAnalyzer(Version matchVersion) {
     this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET);
   }
@@ -95,11 +103,17 @@ public final class PersianAnalyzer exten
   /**
    * Builds an analyzer with the given stop words 
    * 
-   * @param matchVersion
-   *          lucene compatibility version
    * @param stopwords
    *          a stopword set
    */
+  public PersianAnalyzer(CharArraySet stopwords) {
+    super(stopwords);
+  }
+
+  /**
+   * @deprecated Use {@link #PersianAnalyzer(CharArraySet)}
+   */
+  @Deprecated
   public PersianAnalyzer(Version matchVersion, CharArraySet stopwords){
     super(matchVersion, stopwords);
   }
@@ -118,12 +132,12 @@ public final class PersianAnalyzer exten
   protected TokenStreamComponents createComponents(String fieldName,
       Reader reader) {
     final Tokenizer source;
-    if (matchVersion.onOrAfter(Version.LUCENE_3_1)) {
-      source = new StandardTokenizer(matchVersion, reader);
+    if (getVersion().onOrAfter(Version.LUCENE_3_1_0)) {
+      source = new StandardTokenizer(getVersion(), reader);
     } else {
-      source = new ArabicLetterTokenizer(matchVersion, reader);
+      source = new ArabicLetterTokenizer(getVersion(), reader);
     }
-    TokenStream result = new LowerCaseFilter(matchVersion, source);
+    TokenStream result = new LowerCaseFilter(getVersion(), source);
     result = new ArabicNormalizationFilter(result);
     /* additional persian-specific normalization */
     result = new PersianNormalizationFilter(result);
@@ -131,7 +145,7 @@ public final class PersianAnalyzer exten
      * the order here is important: the stopword list is normalized with the
      * above!
      */
-    return new TokenStreamComponents(source, new StopFilter(matchVersion, result, stopwords));
+    return new TokenStreamComponents(source, new StopFilter(getVersion(), result, stopwords));
   }
   
   /** 
@@ -139,7 +153,7 @@ public final class PersianAnalyzer exten
    */
   @Override
   protected Reader initReader(String fieldName, Reader reader) {
-    return matchVersion.onOrAfter(Version.LUCENE_3_1) ? 
+    return getVersion().onOrAfter(Version.LUCENE_3_1_0) ?
        new PersianCharFilter(reader) :
        reader;
   }



Mime
View raw message