Index: CHANGES.txt =================================================================== --- CHANGES.txt (revision 615191) +++ CHANGES.txt (working copy) @@ -12,6 +12,10 @@ pre-existing constructors; these will be removed in release 3.0. (Steven Rowe via Mike McCandless) + 2. LUCENE-1150: Re-expose StandardTokenizer's constants publicly; + this was accidentally lost with LUCENE-966. (Nicolas Lalevée via + Mike McCandless) + Bug fixes New features Index: src/test/org/apache/lucene/analysis/TestAnalyzers.java =================================================================== --- src/test/org/apache/lucene/analysis/TestAnalyzers.java (revision 615191) +++ src/test/org/apache/lucene/analysis/TestAnalyzers.java (working copy) @@ -23,6 +23,7 @@ import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.index.Payload; +import org.apache.lucene.analysis.standard.Constants; public class TestAnalyzers extends LuceneTestCase { @@ -118,6 +119,18 @@ verifyPayload(ts); } + // Just a compile time test, to ensure the + // StandardAnalyzer constants remain publicly accessible + public void _testStandardConstants() { + int x = Constants.ALPHANUM; + x = Constants.APOSTROPHE; + x = Constants.ACRONYM; + x = Constants.COMPANY; + x = Constants.EMAIL; + x = Constants.HOST; + x = Constants.NUM; + x = Constants.CJ; + } } class BuffTokenFilter extends TokenFilter { Index: src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.jflex =================================================================== --- src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.jflex (revision 615191) +++ src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.jflex (working copy) @@ -30,20 +30,20 @@ %{ -public static final int ALPHANUM = 0; -public static final int APOSTROPHE = 1; -public static final int ACRONYM = 2; -public static final int COMPANY = 3; -public static final int EMAIL = 4; -public static final int HOST = 5; -public static final int NUM = 6; -public static final int CJ = 7; +public static final int ALPHANUM = Constants.ALPHANUM; +public static final int APOSTROPHE = Constants.APOSTROPHE; +public static final int ACRONYM = Constants.ACRONYM; +public static final int COMPANY = Constants.COMPANY; +public static final int EMAIL = Constants.EMAIL; +public static final int HOST = Constants.HOST; +public static final int NUM = Constants.NUM; +public static final int CJ = Constants.CJ; /** * @deprecated this solves a bug where HOSTs that end with '.' are identified * as ACRONYMs. It is deprecated and will be removed in the next * release. */ -public static final int ACRONYM_DEP = 8; +public static final int ACRONYM_DEP = Constants.ACRONYM_DEP; public static final String [] TOKEN_TYPES = new String [] { "", Index: src/java/org/apache/lucene/analysis/standard/Constants.java =================================================================== --- src/java/org/apache/lucene/analysis/standard/Constants.java (revision 0) +++ src/java/org/apache/lucene/analysis/standard/Constants.java (revision 0) @@ -0,0 +1,37 @@ +package org.apache.lucene.analysis.standard; + +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +public class Constants { + public static final int ALPHANUM = 0; + public static final int APOSTROPHE = 1; + public static final int ACRONYM = 2; + public static final int COMPANY = 3; + public static final int EMAIL = 4; + public static final int HOST = 5; + public static final int NUM = 6; + public static final int CJ = 7; + + /** + * @deprecated this solves a bug where HOSTs that end with '.' are identified + * as ACRONYMs. It is deprecated and will be removed in the next + * release. + */ + public static final int ACRONYM_DEP = 8; +} Property changes on: src/java/org/apache/lucene/analysis/standard/Constants.java ___________________________________________________________________ Name: svn:eol-style + native Index: src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.java =================================================================== --- src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.java (revision 615191) +++ src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.java (working copy) @@ -283,20 +283,20 @@ /* user code: */ -public static final int ALPHANUM = 0; -public static final int APOSTROPHE = 1; -public static final int ACRONYM = 2; -public static final int COMPANY = 3; -public static final int EMAIL = 4; -public static final int HOST = 5; -public static final int NUM = 6; -public static final int CJ = 7; +public static final int ALPHANUM = Constants.ALPHANUM; +public static final int APOSTROPHE = Constants.APOSTROPHE; +public static final int ACRONYM = Constants.ACRONYM; +public static final int COMPANY = Constants.COMPANY; +public static final int EMAIL = Constants.EMAIL; +public static final int HOST = Constants.HOST; +public static final int NUM = Constants.NUM; +public static final int CJ = Constants.CJ; /** * @deprecated this solves a bug where HOSTs that end with '.' are identified * as ACRONYMs. It is deprecated and will be removed in the next * release. */ -public static final int ACRONYM_DEP = 8; +public static final int ACRONYM_DEP = Constants.ACRONYM_DEP; public static final String [] TOKEN_TYPES = new String [] { "",