You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by us...@apache.org on 2010/01/14 20:05:42 UTC

svn commit: r899359 [4/7] - in /lucene/java/branches/flex_1458: ./ contrib/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/bg/ contrib/analyzers/common/src/java/org/apache/l...

Modified: lucene/java/branches/flex_1458/contrib/snowball/src/java/org/tartarus/snowball/Among.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/snowball/src/java/org/tartarus/snowball/Among.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/snowball/src/java/org/tartarus/snowball/Among.java (original)
+++ lucene/java/branches/flex_1458/contrib/snowball/src/java/org/tartarus/snowball/Among.java Thu Jan 14 19:05:12 2010
@@ -37,7 +37,7 @@
     public Among (String s, int substring_i, int result,
 		  String methodname, SnowballProgram methodobject) {
         this.s_size = s.length();
-        this.s = s;
+        this.s = s.toCharArray();
         this.substring_i = substring_i;
 	this.result = result;
 	this.methodobject = methodobject;
@@ -48,17 +48,16 @@
 		this.method = methodobject.getClass().
 		getDeclaredMethod(methodname, new Class[0]);
 	    } catch (NoSuchMethodException e) {
-		// FIXME - debug message
-		this.method = null;
+		throw new RuntimeException(e);
 	    }
 	}
     }
 
-    public int s_size; /* search string */
-    public String s; /* search string */
-    public int substring_i; /* index to longest matching substring */
-    public int result;      /* result of the lookup */
-    public Method method; /* method to use if substring matches */
-    public SnowballProgram methodobject; /* object to invoke method on */
+    public final int s_size; /* search string */
+    public final char[] s; /* search string */
+    public final int substring_i; /* index to longest matching substring */
+    public final int result;      /* result of the lookup */
+    public final Method method; /* method to use if substring matches */
+    public final SnowballProgram methodobject; /* object to invoke method on */
    
 };

Modified: lucene/java/branches/flex_1458/contrib/snowball/src/java/org/tartarus/snowball/SnowballProgram.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/snowball/src/java/org/tartarus/snowball/SnowballProgram.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/snowball/src/java/org/tartarus/snowball/SnowballProgram.java (original)
+++ lucene/java/branches/flex_1458/contrib/snowball/src/java/org/tartarus/snowball/SnowballProgram.java Thu Jan 14 19:05:12 2010
@@ -34,16 +34,20 @@
 
 import java.lang.reflect.InvocationTargetException;
 
+import org.apache.lucene.util.ArrayUtil;
+
 /**
- * This is the rev 500 of the Snowball SVN trunk,
+ * This is the rev 502 of the Snowball SVN trunk,
  * but modified:
  * made abstract and introduced abstract method stem to avoid expensive reflection in filter class.
  * refactored StringBuffers to StringBuilder
+ * uses char[] as buffer instead of StringBuffer/StringBuilder
+ * eq_s,eq_s_b,insert,replace_s take CharSequence like eq_v and eq_v_b
  */
 public abstract class SnowballProgram {
     protected SnowballProgram()
     {
-	current = new StringBuilder();
+	current = new char[8];
 	setCurrent("");
     }
 
@@ -54,9 +58,9 @@
      */
     public void setCurrent(String value)
     {
-	current.replace(0, current.length(), value);
+	current = value.toCharArray();
 	cursor = 0;
-	limit = current.length();
+	limit = value.length();
 	limit_backward = 0;
 	bra = cursor;
 	ket = limit;
@@ -67,19 +71,52 @@
      */
     public String getCurrent()
     {
-        String result = current.toString();
-        // Make a new StringBuffer.  If we reuse the old one, and a user of
-        // the library keeps a reference to the buffer returned (for example,
-        // by converting it to a String in a way which doesn't force a copy),
-        // the buffer size will not decrease, and we will risk wasting a large
-        // amount of memory.
-        // Thanks to Wolfram Esser for spotting this problem.
-        current = new StringBuilder();
-        return result;
+      return new String(current, 0, limit);
+    }
+    
+    /**
+     * Set the current string.
+     * @param text character array containing input
+     * @param length valid length of text.
+     */
+    public void setCurrent(char text[], int length) {
+      current = text;
+      cursor = 0;
+      limit = length;
+      limit_backward = 0;
+      bra = cursor;
+      ket = limit;
+    }
+
+    /**
+     * Get the current buffer containing the stem.
+     * <p>
+     * NOTE: this may be a reference to a different character array than the
+     * one originally provided with setCurrent, in the exceptional case that 
+     * stemming produced a longer intermediate or result string. 
+     * </p>
+     * <p>
+     * It is necessary to use {@link #getCurrentBufferLength()} to determine
+     * the valid length of the returned buffer. For example, many words are
+     * stemmed simply by subtracting from the length to remove suffixes.
+     * </p>
+     * @see #getCurrentBufferLength()
+     */
+    public char[] getCurrentBuffer() {
+      return current;
+    }
+    
+    /**
+     * Get the valid length of the character array in 
+     * {@link #getCurrentBuffer()}. 
+     * @return valid length of the array.
+     */
+    public int getCurrentBufferLength() {
+      return limit;
     }
 
     // current string
-    protected StringBuilder current;
+    private char current[];
 
     protected int cursor;
     protected int limit;
@@ -100,7 +137,7 @@
     protected boolean in_grouping(char [] s, int min, int max)
     {
 	if (cursor >= limit) return false;
-	char ch = current.charAt(cursor);
+	char ch = current[cursor];
 	if (ch > max || ch < min) return false;
 	ch -= min;
 	if ((s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return false;
@@ -111,7 +148,7 @@
     protected boolean in_grouping_b(char [] s, int min, int max)
     {
 	if (cursor <= limit_backward) return false;
-	char ch = current.charAt(cursor - 1);
+	char ch = current[cursor - 1];
 	if (ch > max || ch < min) return false;
 	ch -= min;
 	if ((s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return false;
@@ -122,7 +159,7 @@
     protected boolean out_grouping(char [] s, int min, int max)
     {
 	if (cursor >= limit) return false;
-	char ch = current.charAt(cursor);
+	char ch = current[cursor];
 	if (ch > max || ch < min) {
 	    cursor++;
 	    return true;
@@ -138,7 +175,7 @@
     protected boolean out_grouping_b(char [] s, int min, int max)
     {
 	if (cursor <= limit_backward) return false;
-	char ch = current.charAt(cursor - 1);
+	char ch = current[cursor - 1];
 	if (ch > max || ch < min) {
 	    cursor--;
 	    return true;
@@ -154,7 +191,7 @@
     protected boolean in_range(int min, int max)
     {
 	if (cursor >= limit) return false;
-	char ch = current.charAt(cursor);
+	char ch = current[cursor];
 	if (ch > max || ch < min) return false;
 	cursor++;
 	return true;
@@ -163,7 +200,7 @@
     protected boolean in_range_b(int min, int max)
     {
 	if (cursor <= limit_backward) return false;
-	char ch = current.charAt(cursor - 1);
+	char ch = current[cursor - 1];
 	if (ch > max || ch < min) return false;
 	cursor--;
 	return true;
@@ -172,7 +209,7 @@
     protected boolean out_range(int min, int max)
     {
 	if (cursor >= limit) return false;
-	char ch = current.charAt(cursor);
+	char ch = current[cursor];
 	if (!(ch > max || ch < min)) return false;
 	cursor++;
 	return true;
@@ -181,41 +218,68 @@
     protected boolean out_range_b(int min, int max)
     {
 	if (cursor <= limit_backward) return false;
-	char ch = current.charAt(cursor - 1);
+	char ch = current[cursor - 1];
 	if(!(ch > max || ch < min)) return false;
 	cursor--;
 	return true;
     }
 
-    protected boolean eq_s(int s_size, String s)
+    protected boolean eq_s(int s_size, CharSequence s)
     {
 	if (limit - cursor < s_size) return false;
 	int i;
 	for (i = 0; i != s_size; i++) {
-	    if (current.charAt(cursor + i) != s.charAt(i)) return false;
+	    if (current[cursor + i] != s.charAt(i)) return false;
 	}
 	cursor += s_size;
 	return true;
     }
 
-    protected boolean eq_s_b(int s_size, String s)
+    /** @deprecated for binary back compat. Will be removed in Lucene 4.0 */
+    @Deprecated
+    protected boolean eq_s(int s_size, String s)
+    {
+	return eq_s(s_size, (CharSequence)s);
+    }
+
+    protected boolean eq_s_b(int s_size, CharSequence s)
     {
 	if (cursor - limit_backward < s_size) return false;
 	int i;
 	for (i = 0; i != s_size; i++) {
-	    if (current.charAt(cursor - s_size + i) != s.charAt(i)) return false;
+	    if (current[cursor - s_size + i] != s.charAt(i)) return false;
 	}
 	cursor -= s_size;
 	return true;
     }
 
+    /** @deprecated for binary back compat. Will be removed in Lucene 4.0 */
+    @Deprecated
+    protected boolean eq_s_b(int s_size, String s)
+    {
+	return eq_s_b(s_size, (CharSequence)s);
+    }
+
+    protected boolean eq_v(CharSequence s)
+    {
+	return eq_s(s.length(), s);
+    }
+
+    /** @deprecated for binary back compat. Will be removed in Lucene 4.0 */
+    @Deprecated
     protected boolean eq_v(StringBuilder s)
     {
-	return eq_s(s.length(), s.toString());
+	return eq_s(s.length(), (CharSequence)s);
+    }
+
+    protected boolean eq_v_b(CharSequence s)
+    {   return eq_s_b(s.length(), s);
     }
 
+    /** @deprecated for binary back compat. Will be removed in Lucene 4.0 */
+    @Deprecated
     protected boolean eq_v_b(StringBuilder s)
-    {   return eq_s_b(s.length(), s.toString());
+    {   return eq_s_b(s.length(), (CharSequence)s);
     }
 
     protected int find_among(Among v[], int v_size)
@@ -242,7 +306,7 @@
 		    diff = -1;
 		    break;
 		}
-		diff = current.charAt(c + common) - w.s.charAt(i2);
+		diff = current[c + common] - w.s[i2];
 		if (diff != 0) break;
 		common++;
 	    }
@@ -315,7 +379,7 @@
 		    diff = -1;
 		    break;
 		}
-		diff = current.charAt(c - 1 - common) - w.s.charAt(i2);
+		diff = current[c - 1 - common] - w.s[i2];
 		if (diff != 0) break;
 		common++;
 	    }
@@ -362,22 +426,45 @@
     /* to replace chars between c_bra and c_ket in current by the
      * chars in s.
      */
-    protected int replace_s(int c_bra, int c_ket, String s)
+    protected int replace_s(int c_bra, int c_ket, CharSequence s)
     {
-	int adjustment = s.length() - (c_ket - c_bra);
-	current.replace(c_bra, c_ket, s);
+	final int adjustment = s.length() - (c_ket - c_bra);
+	final int newLength = limit + adjustment;
+	//resize if necessary
+	if (newLength > current.length) {
+	  char newBuffer[] = new char[ArrayUtil.getNextSize(newLength)];
+	  System.arraycopy(current, 0, newBuffer, 0, limit);
+	  current = newBuffer;
+	}
+	// if the substring being replaced is longer or shorter than the
+	// replacement, need to shift things around
+	if (adjustment != 0 && c_ket < limit) {
+	  System.arraycopy(current, c_ket, current, c_bra + s.length(), 
+	      limit - c_ket);
+	}
+	// insert the replacement text
+	// Note, faster is s.getChars(0, s.length(), current, c_bra);
+	// but would have to duplicate this method for both String and StringBuilder
+	for (int i = 0; i < s.length(); i++)
+	  current[c_bra + i] = s.charAt(i);
+	
 	limit += adjustment;
 	if (cursor >= c_ket) cursor += adjustment;
 	else if (cursor > c_bra) cursor = c_bra;
 	return adjustment;
     }
 
+    /** @deprecated for binary back compat. Will be removed in Lucene 4.0 */
+    @Deprecated
+    protected int replace_s(int c_bra, int c_ket, String s) {
+	return replace_s(c_bra, c_ket, (CharSequence)s);
+    }
+
     protected void slice_check()
     {
 	if (bra < 0 ||
 	    bra > ket ||
-	    ket > limit ||
-	    limit > current.length())   // this line could be removed
+	    ket > limit)
 	{
 	    System.err.println("faulty slice operation");
 	// FIXME: report error somehow.
@@ -389,32 +476,50 @@
 	}
     }
 
-    protected void slice_from(String s)
+    protected void slice_from(CharSequence s)
     {
 	slice_check();
 	replace_s(bra, ket, s);
     }
+ 
+    /** @deprecated for binary back compat. Will be removed in Lucene 4.0 */
+    @Deprecated
+    protected void slice_from(String s)
+    {
+	slice_from((CharSequence)s);
+    }
 
+    /** @deprecated for binary back compat. Will be removed in Lucene 4.0 */
+    @Deprecated
     protected void slice_from(StringBuilder s)
     {
-        slice_from(s.toString());
+	slice_from((CharSequence)s);
     }
 
     protected void slice_del()
     {
-	slice_from("");
+	slice_from((CharSequence)"");
     }
 
-    protected void insert(int c_bra, int c_ket, String s)
+    protected void insert(int c_bra, int c_ket, CharSequence s)
     {
 	int adjustment = replace_s(c_bra, c_ket, s);
 	if (c_bra <= bra) bra += adjustment;
 	if (c_bra <= ket) ket += adjustment;
     }
 
+    /** @deprecated for binary back compat. Will be removed in Lucene 4.0 */
+    @Deprecated
+    protected void insert(int c_bra, int c_ket, String s)
+    {
+	insert(c_bra, c_ket, (CharSequence)s);
+    }
+
+    /** @deprecated for binary back compat. Will be removed in Lucene 4.0 */
+    @Deprecated
     protected void insert(int c_bra, int c_ket, StringBuilder s)
     {
-	insert(c_bra, c_ket, s.toString());
+	insert(c_bra, c_ket, (CharSequence)s);
     }
 
     /* Copy the slice into the supplied StringBuffer */
@@ -422,13 +527,15 @@
     {
 	slice_check();
 	int len = ket - bra;
-	s.replace(0, s.length(), current.substring(bra, ket));
+	s.setLength(0);
+	s.append(current, bra, len);
 	return s;
     }
 
     protected StringBuilder assign_to(StringBuilder s)
     {
-	s.replace(0, s.length(), current.substring(0, limit));
+	s.setLength(0);
+	s.append(current, 0, limit);
 	return s;
     }
 

Propchange: lucene/java/branches/flex_1458/contrib/snowball/src/test/org/apache/lucene/analysis/snowball/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jan 14 19:05:12 2010
@@ -0,0 +1 @@
+data

Modified: lucene/java/branches/flex_1458/contrib/snowball/src/test/org/apache/lucene/analysis/snowball/TestSnowball.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/snowball/src/test/org/apache/lucene/analysis/snowball/TestSnowball.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/snowball/src/test/org/apache/lucene/analysis/snowball/TestSnowball.java (original)
+++ lucene/java/branches/flex_1458/contrib/snowball/src/test/org/apache/lucene/analysis/snowball/TestSnowball.java Thu Jan 14 19:05:12 2010
@@ -21,6 +21,7 @@
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.index.Payload;
 import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.analysis.tokenattributes.FlagsAttribute;
 import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
 import org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
@@ -36,6 +37,13 @@
     assertAnalyzesTo(a, "he abhorred accents",
         new String[]{"he", "abhor", "accent"});
   }
+  
+  public void testStopwords() throws Exception {
+    Analyzer a = new SnowballAnalyzer(Version.LUCENE_CURRENT, "English",
+        StandardAnalyzer.STOP_WORDS_SET);
+    assertAnalyzesTo(a, "the quick brown fox jumped",
+        new String[]{"quick", "brown", "fox", "jump"});
+  }
 
   /**
    * Test english lowercasing. Test both cases (pre-3.1 and post-3.1) to ensure

Modified: lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/geohash/GeoHashUtils.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/geohash/GeoHashUtils.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/geohash/GeoHashUtils.java (original)
+++ lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/geohash/GeoHashUtils.java Thu Jan 14 19:05:12 2010
@@ -21,154 +21,119 @@
 import java.util.Map;
 
 /**
- * Based on http://en.wikipedia.org/wiki/Geohash
- *
- * <p><font color="red"><b>NOTE:</b> This API is still in
- * flux and might change in incompatible ways in the next
- * release.</font>
+ * Utilities for encoding and decoding geohashes. Based on
+ * http://en.wikipedia.org/wiki/Geohash.
  */
 public class GeoHashUtils {
 
-	// geohash's char map
-	// no a's i's l's o's
-	// old MacDonal wouldn't be happy
-	private static char[] _base32 = {'0','1','2','3','4','5','6','7','8','9',
-							'b','c','d','e','f','g','h','j','k','m',
-							'n','p','q','r','s','t','u','v','w','x',
-							'y','z'} ;
-	
-	private final static Map<Character, Integer> _decodemap = new HashMap<Character, Integer>();
-	static {
-		int sz = _base32.length;
-		for (int i = 0; i < sz; i++ ){
-			_decodemap.put(_base32[i], i);
-		}
-	}
-	
-	private static int precision = 12;
-	private static int[] bits = {16, 8, 4, 2, 1};
-	
-	public static void main(String[] args) {
-		GeoHashUtils ghf = new GeoHashUtils();
-		String gc1 = ghf.encode(30, -90.0);
-		String gc2 = ghf.encode(51.4797, -0.0124);
-		
-		System.out.println(gc1);
-		System.out.println(gc2);
-		
-		double [] gd1 = ghf.decode(gc1);
-		double [] gd2 = ghf.decode(gc2);
-		System.out.println(gd1[0]+ ", "+ gd1[1]);
-		System.out.println(gd2[0]+ ", "+ gd2[1]);
-		
-	}
-	
-	public static String encode(double latitude, double longitude){
-		double[] lat_interval = {-90.0 ,  90.0};
-		double[] lon_interval = {-180.0, 180.0};
-			
-		StringBuilder geohash = new StringBuilder();
-		boolean is_even = true;
-		int bit = 0, ch = 0;
-		
-		while(geohash.length() < precision){
-			double mid = 0.0;
-			if(is_even){
-				mid = (lon_interval[0] + lon_interval[1]) / 2;
-				if (longitude > mid){
-					ch |= bits[bit];
-					lon_interval[0] = mid;
-				} else {
-					lon_interval[1] = mid;
-				}
-				
-			} else {
-				mid = (lat_interval[0] + lat_interval[1]) / 2;
-				if(latitude > mid){
-					ch |= bits[bit];
-					lat_interval[0] = mid;
-				} else {
-					lat_interval[1] = mid;
-				}
-			}
-			
-			is_even = is_even ? false : true;
-			
-			if (bit  < 4){
-				bit ++;
-			} else {
-				geohash.append(_base32[ch]);
-				bit =0;
-				ch = 0;
-			}
-		}
-		
-		return geohash.toString();
-	}
-	
-	public static double[] decode(String geohash) {
-		double[] ge = decode_exactly(geohash);
-		double lat, lon, lat_err, lon_err;
-		lat = ge[0];
-		lon = ge[1];
-		lat_err = ge[2];
-		lon_err = ge[3];
-		
-		double lat_precision = Math.max(1, Math.round(- Math.log10(lat_err))) - 1;
-		double lon_precision = Math.max(1, Math.round(- Math.log10(lon_err))) - 1;
-		
-		lat = getPrecision(lat, lat_precision);
-		lon = getPrecision(lon, lon_precision);
-		
-		return new double[] {lat, lon};
-	}
-	
-	public static double[] decode_exactly (String geohash){
-		double[] lat_interval = {-90.0 , 90.0};
-		double[] lon_interval = {-180.0, 180.0};
-		
-		double lat_err =  90.0;
-		double lon_err = 180.0;
-		boolean is_even = true;
-		int sz = geohash.length();
-		int bsz = bits.length;
-		double latitude, longitude;
-		for (int i = 0; i < sz; i++){
-			
-			int cd = _decodemap.get(geohash.charAt(i));
-			
-			for (int z = 0; z< bsz; z++){
-				int mask = bits[z];
-				if (is_even){
-					lon_err /= 2;
-					if ((cd & mask) != 0){
-						lon_interval[0] = (lon_interval[0]+lon_interval[1])/2;
-					} else {
-						lon_interval[1] = (lon_interval[0]+lon_interval[1])/2;
-					}
-					
-				} else {
-					lat_err /=2;
-				
-					if ( (cd & mask) != 0){
-						lat_interval[0] = (lat_interval[0]+lat_interval[1])/2;
-					} else {
-						lat_interval[1] = (lat_interval[0]+lat_interval[1])/2;
-					}
-				}
-				is_even = is_even ? false : true;
-			}
-		
-		}
-		latitude  = (lat_interval[0] + lat_interval[1]) / 2;
-		longitude = (lon_interval[0] + lon_interval[1]) / 2;
+  private static final char[] BASE_32 = {'0', '1', '2', '3', '4', '5', '6',
+      '7', '8', '9', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'm', 'n',
+      'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
 
-		return new double []{latitude, longitude, lat_err, lon_err};
-	}
-	
-	static double getPrecision(double x, double precision) {
-		double base = Math.pow(10,- precision);
-		double diff = x % base;
-		return x - diff;
+  private final static Map<Character,Integer> DECODE_MAP = new HashMap<Character,Integer>();
+
+  private static final int PRECISION = 12;
+  private static final int[] BITS = {16, 8, 4, 2, 1};
+
+  static {
+    for (int i = 0; i < BASE_32.length; i++) {
+      DECODE_MAP.put(Character.valueOf(BASE_32[i]), Integer.valueOf(i));
+    }
+  }
+
+  private GeoHashUtils() {  
+  }
+
+  /**
+   * Encodes the given latitude and longitude into a geohash
+   *
+   * @param latitude Latitude to encode
+   * @param longitude Longitude to encode
+   * @return Geohash encoding of the longitude and latitude
+   */
+  public static String encode(double latitude, double longitude) {
+    double[] latInterval = {-90.0, 90.0};
+    double[] lngInterval = {-180.0, 180.0};
+
+    final StringBuilder geohash = new StringBuilder();
+    boolean isEven = true;
+
+    int bit = 0;
+    int ch = 0;
+
+    while (geohash.length() < PRECISION) {
+      double mid = 0.0;
+      if (isEven) {
+        mid = (lngInterval[0] + lngInterval[1]) / 2D;
+        if (longitude > mid) {
+          ch |= BITS[bit];
+          lngInterval[0] = mid;
+        } else {
+          lngInterval[1] = mid;
+        }
+      } else {
+        mid = (latInterval[0] + latInterval[1]) / 2D;
+        if (latitude > mid) {
+          ch |= BITS[bit];
+          latInterval[0] = mid;
+        } else {
+          latInterval[1] = mid;
+        }
+      }
+
+      isEven = !isEven;
+
+      if (bit < 4) {
+        bit++;
+      } else {
+        geohash.append(BASE_32[ch]);
+        bit = 0;
+        ch = 0;
+      }
+    }
+
+    return geohash.toString();
+  }
+
+  /**
+   * Decodes the given geohash into a latitude and longitude
+   *
+   * @param geohash Geohash to deocde
+   * @return Array with the latitude at index 0, and longitude at index 1
+   */
+  public static double[] decode(String geohash) {
+    final double[] latInterval = {-90.0, 90.0};
+    final double[] lngInterval = {-180.0, 180.0};
+
+    boolean isEven = true;
+
+    double latitude;
+    double longitude;
+    for (int i = 0; i < geohash.length(); i++) {
+      final int cd = DECODE_MAP.get(Character.valueOf(
+          geohash.charAt(i))).intValue();
+
+      for (int mask : BITS) {
+        if (isEven) {
+          if ((cd & mask) != 0) {
+            lngInterval[0] = (lngInterval[0] + lngInterval[1]) / 2D;
+          } else {
+            lngInterval[1] = (lngInterval[0] + lngInterval[1]) / 2D;
+          }
+        } else {
+          if ((cd & mask) != 0) {
+            latInterval[0] = (latInterval[0] + latInterval[1]) / 2D;
+          } else {
+            latInterval[1] = (latInterval[0] + latInterval[1]) / 2D;
+          }
+        }
+        isEven = !isEven;
+      }
+
+    }
+    latitude = (latInterval[0] + latInterval[1]) / 2D;
+    longitude = (lngInterval[0] + lngInterval[1]) / 2D;
+
+    return new double[] {latitude, longitude};
 	}
-}
+}
\ No newline at end of file

Modified: lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/geometry/DistanceUnits.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/geometry/DistanceUnits.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/geometry/DistanceUnits.java (original)
+++ lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/geometry/DistanceUnits.java Thu Jan 14 19:05:12 2010
@@ -18,11 +18,93 @@
 package org.apache.lucene.spatial.geometry;
 
 /**
- * <p><font color="red"><b>NOTE:</b> This API is still in
- * flux and might change in incompatible ways in the next
- * release.</font>
+ * Enum representing difference distance units, currently only kilometers and
+ * miles
  */
 public enum DistanceUnits {
-  MILES,
-  KILOMETERS;
+
+  MILES("miles", 3959, 24902),
+  KILOMETERS("km", 6371, 40076);
+
+  private static final double MILES_KILOMETRES_RATIO = 1.609344;
+
+  private final String unit;
+  
+  private final double earthCircumference;
+  
+  private final double earthRadius;
+
+  /**
+   * Creates a new DistanceUnit that represents the given unit
+   *
+   * @param unit Distance unit in String form
+   * @param earthRadius Radius of the Earth in the specific distance unit
+   * @param earthCircumfence Circumference of the Earth in the specific distance unit
+   */
+  DistanceUnits(String unit, double earthRadius, double earthCircumfence) {
+    this.unit = unit;
+    this.earthCircumference = earthCircumfence;
+    this.earthRadius = earthRadius;
+  }
+
+  /**
+   * Returns the DistanceUnit which represents the given unit
+   *
+   * @param unit Unit whose DistanceUnit should be found
+   * @return DistanceUnit representing the unit
+   * @throws IllegalArgumentException if no DistanceUnit which represents the given unit is found
+   */
+  public static DistanceUnits findDistanceUnit(String unit) {
+    if (MILES.getUnit().equals(unit)) {
+      return MILES;
+    }
+
+    if (KILOMETERS.getUnit().equals(unit)) {
+      return KILOMETERS;
+    }
+
+    throw new IllegalArgumentException("Unknown distance unit " + unit);
+  }
+
+  /**
+   * Converts the given distance in given DistanceUnit, to a distance in the unit represented by {@code this} 
+   *
+   * @param distance Distance to convert
+   * @param from Unit to convert the distance from
+   * @return Given distance converted to the distance in the given unit
+   */
+  public double convert(double distance, DistanceUnits from) {
+    if (from == this) {
+      return distance;
+    }
+    return (this == MILES) ? distance / MILES_KILOMETRES_RATIO : distance * MILES_KILOMETRES_RATIO;
+  }
+
+  /**
+   * Returns the string representation of the distance unit
+   *
+   * @return String representation of the distance unit
+   */
+  public String getUnit() {
+    return unit;
+  }
+  
+  /**
+   * Returns the <a href="http://en.wikipedia.org/wiki/Earth_radius">average earth radius</a>
+   *
+   * @return the average earth radius
+   */
+  public double earthRadius() {
+    return earthRadius;
+  }
+  
+  /**
+   * Returns the <a href="http://www.lyberty.com/encyc/articles/earth.html">circumference of the Earth</a>
+   * 
+   * @return  the circumference of the Earth
+   */
+  public double earthCircumference() {
+    return earthCircumference;
+  }
 }
+

Modified: lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/geometry/shape/DistanceApproximation.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/geometry/shape/DistanceApproximation.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/geometry/shape/DistanceApproximation.java (original)
+++ lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/geometry/shape/DistanceApproximation.java Thu Jan 14 19:05:12 2010
@@ -27,6 +27,7 @@
  * @deprecated This has been replaced with more accurate
  * math in {@link LLRect}. This class will be removed in a future release.
  */
+@Deprecated
 public class DistanceApproximation
 {
   private double m_testLat;

Propchange: lucene/java/branches/flex_1458/contrib/spatial/src/java/overview.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesianShapeFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/branches/flex_1458/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java (original)
+++ lucene/java/branches/flex_1458/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java Thu Jan 14 19:05:12 2010
@@ -55,7 +55,7 @@
  *
  * @version 1.0
  */
-public class SpellChecker {
+public class SpellChecker implements java.io.Closeable {
 
   /**
    * Field name for each word in the ngram index.

Propchange: lucene/java/branches/flex_1458/contrib/spellchecker/src/java/overview.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/branches/flex_1458/contrib/surround/src/java/overview.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/branches/flex_1458/contrib/wikipedia/src/java/overview.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/branches/flex_1458/contrib/wordnet/src/java/overview.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/LuceneContribQuery.dtd.org.html
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/LuceneContribQuery.dtd.org.html?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/LuceneContribQuery.dtd.org.html (original)
+++ lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/LuceneContribQuery.dtd.org.html Thu Jan 14 19:05:12 2010
@@ -1,9 +1,9 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html> <head>
-<meta http-equiv='CONTENT-TYPE' content='text/html; charset=UTF-8' />
-<link rel='StyleSheet' href='DTDDocStyle.css' type='text/css' media='screen' />
-<title>Contrib Lucene</title>
-</head><body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html> <head>
+<meta http-equiv='CONTENT-TYPE' content='text/html; charset=UTF-8' />
+<link rel='StyleSheet' href='DTDDocStyle.css' type='text/css' media='screen' />
+<title>Contrib Lucene</title>
+</head><body>
 <p class='DTDSource'><b><code>LuceneContribQuery.dtd</code></b>: <a href='LuceneContribQuery.dtd.html'>Elements</a> - <a href='LuceneContribQuery.dtd.entities.html'>Entities</a> - <a href='LuceneContribQuery.dtd.org.html'>Source</a> | <a href='intro.html'>Intro</a> - <a href='elementsIndex.html'>Index</a><br /><a href='index.html' target='_top'>FRAMES</a>&nbsp;/&nbsp;<a href='LuceneContribQuery.dtd.org.html' target='_top'>NO FRAMES</a></p><pre id='dtd_source'><span class="dtd_comment">&lt;!--    </span>
 <span class="dtd_comment">    This DTD builds on the &lt;a href=&quot;LuceneCoreQuery.dtd.html&quot;&gt;core Lucene XML syntax&lt;/a&gt; and adds support for features found in the &quot;contrib&quot; section of the Lucene project.</span>
 <span class="dtd_comment">    </span>
@@ -233,5 +233,5 @@
 <span class="dtd_comment">    --&gt;</span>
 <span class="dtd_tag_symbols">&lt;!</span><span class="dtd_tag_name">ELEMENT</span><span class="dtd_plain"> </span><span class="dtd_attribute_name">BooleanFilter</span><span class="dtd_plain"> (</span><span class="dtd_attribute_name">Clause</span><span class="dtd_plain">)+</span><span class="dtd_tag_symbols">&gt;</span>
 
-</pre>
-</body></html>
+</pre>
+</body></html>

Propchange: lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/LuceneContribQuery.dtd.org.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/LuceneCoreQuery.dtd.org.html
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/LuceneCoreQuery.dtd.org.html?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/LuceneCoreQuery.dtd.org.html (original)
+++ lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/LuceneCoreQuery.dtd.org.html Thu Jan 14 19:05:12 2010
@@ -1,9 +1,9 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html> <head>
-<meta http-equiv='CONTENT-TYPE' content='text/html; charset=UTF-8' />
-<link rel='StyleSheet' href='DTDDocStyle.css' type='text/css' media='screen' />
-<title>Core Lucene</title>
-</head><body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html> <head>
+<meta http-equiv='CONTENT-TYPE' content='text/html; charset=UTF-8' />
+<link rel='StyleSheet' href='DTDDocStyle.css' type='text/css' media='screen' />
+<title>Core Lucene</title>
+</head><body>
 <p class='DTDSource'><b><code>LuceneCoreQuery.dtd</code></b>: <a href='LuceneCoreQuery.dtd.html'>Elements</a> - <a href='LuceneCoreQuery.dtd.entities.html'>Entities</a> - <a href='LuceneCoreQuery.dtd.org.html'>Source</a> | <a href='intro.html'>Intro</a> - <a href='elementsIndex.html'>Index</a><br /><a href='index.html' target='_top'>FRAMES</a>&nbsp;/&nbsp;<a href='LuceneCoreQuery.dtd.org.html' target='_top'>NO FRAMES</a></p><pre id='dtd_source'><span class="dtd_comment">&lt;!--</span>
 <span class="dtd_comment">    &lt;h3&gt;Background&lt;/h3&gt;</span>
 <span class="dtd_comment">    This DTD describes the XML syntax used to perform advanced searches using the core Lucene search engine. The motivation behind the XML query syntax is:</span>
@@ -403,5 +403,5 @@
 
 
 
-</pre>
-</body></html>
+</pre>
+</body></html>

Propchange: lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/LuceneCoreQuery.dtd.org.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/index.html
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/index.html?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/index.html (original)
+++ lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/index.html Thu Jan 14 19:05:12 2010
@@ -5,12 +5,12 @@
 <frameset cols='20%, 80%'>
    <frame src='toc.html' />
    <frame src='intro.html' name='detail' />
-   <noframes><body>
-<p class='DTDSource'>Elements - Entities - Source | <a href='intro.html'>Intro</a> - <a href='elementsIndex.html'>Index</a><br /><a href='index.html' target='_top'>FRAMES</a>&nbsp;/&nbsp;<a href='intro.html' target='_top'>NO FRAMES</a></p><h1>Lucene XML Query syntax</h1>
-<table border='1' cellspacing='0'>
-<tr><td><code><a href='LuceneContribQuery.dtd.html'>LuceneContribQuery.dtd</a></code></td><td>Contrib Lucene</td></tr>
-<tr><td><code><a href='LuceneCoreQuery.dtd.html'>LuceneCoreQuery.dtd</a></code></td><td>Core Lucene</td></tr>
-</table>
-<p>This documentation was generated by <a href='http://dtddoc.sourceforge.net'>DTDDoc</a> 1.1.0 (2007-02-03) !</p>
+   <noframes><body>
+<p class='DTDSource'>Elements - Entities - Source | <a href='intro.html'>Intro</a> - <a href='elementsIndex.html'>Index</a><br /><a href='index.html' target='_top'>FRAMES</a>&nbsp;/&nbsp;<a href='intro.html' target='_top'>NO FRAMES</a></p><h1>Lucene XML Query syntax</h1>
+<table border='1' cellspacing='0'>
+<tr><td><code><a href='LuceneContribQuery.dtd.html'>LuceneContribQuery.dtd</a></code></td><td>Contrib Lucene</td></tr>
+<tr><td><code><a href='LuceneCoreQuery.dtd.html'>LuceneCoreQuery.dtd</a></code></td><td>Core Lucene</td></tr>
+</table>
+<p>This documentation was generated by <a href='http://dtddoc.sourceforge.net'>DTDDoc</a> 1.1.0 (2007-02-03) !</p>
 </body></noframes>
-</frameset></html>
+</frameset></html>

Propchange: lucene/java/branches/flex_1458/contrib/xml-query-parser/docs/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/branches/flex_1458/contrib/xml-query-parser/src/java/overview.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/branches/flex_1458/docs/lucene-contrib/index.html
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/docs/lucene-contrib/index.html?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/docs/lucene-contrib/index.html (original)
+++ lucene/java/branches/flex_1458/docs/lucene-contrib/index.html Thu Jan 14 19:05:12 2010
@@ -1,528 +1,528 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.8">
-<meta name="Forrest-skin-name" content="lucene">
-<title>
-	        Apache Lucene - Lucene Contrib
-		  </title>
-<link type="text/css" href="../skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="../skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="../skin/print.css" rel="stylesheet">
-<link type="text/css" href="../skin/profile.css" rel="stylesheet">
-<script src="../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="../images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://lucene.apache.org/">Lucene</a><script src="../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://lucene.apache.org/"><img class="logoImage" alt="Lucene" src="http://www.apache.org/images/asf_logo_simple.png" title="Apache Lucene"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://lucene.apache.org/java/"><img class="logoImage" alt="Lucene" src="http://lucene.apache.org/images/lucene_green_300.gif" title="Apache Lucene is a high-performance, full-featured text search engine library written entirely in
-      Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform."></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:lucene" method="get" class="roundtopsmall">
-<input onFocus="getBlank (this, 'Search the site with Lucene');" size="25" name="q" id="query" type="text" value="Search the site with Lucene">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li class="current">
-<a class="selected" href="http://lucene.apache.org/java/docs/">Main</a>
-</li>
-<li>
-<a class="unselected" href="http://wiki.apache.org/lucene-java">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="../index.html">Lucene 3.1 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_selected_1.1', '../skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Documentation</div>
-<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
-<div class="menuitem">
-<a href="../index.html">Overview</a>
-</div>
-<div onclick="SwitchMenu('menu_1.1.2', '../skin/')" id="menu_1.1.2Title" class="menutitle">Changes</div>
-<div id="menu_1.1.2" class="menuitemgroup">
-<div class="menuitem">
-<a href="../changes/Changes.html">Core</a>
-</div>
-<div class="menuitem">
-<a href="../changes/Contrib-Changes.html">Contrib</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.1.3', '../skin/')" id="menu_1.1.3Title" class="menutitle">Javadocs</div>
-<div id="menu_1.1.3" class="menuitemgroup">
-<div class="menuitem">
-<a href="../api/all/index.html">All</a>
-</div>
-<div class="menuitem">
-<a href="../api/core/index.html">Core</a>
-</div>
-<div class="menuitem">
-<a href="../api/demo/index.html">Demo</a>
-</div>
-<div onclick="SwitchMenu('menu_1.1.3.4', '../skin/')" id="menu_1.1.3.4Title" class="menutitle">Contrib</div>
-<div id="menu_1.1.3.4" class="menuitemgroup">
-<div class="menuitem">
-<a href="../api/contrib-analyzers/index.html">Analyzers</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-smartcn/index.html">Smart Chinese Analyzer</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-ant/index.html">Ant</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-bdb/index.html">Bdb</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-bdb-je/index.html">Bdb-je</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-benchmark/index.html">Benchmark</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-fast-vector-highlighter/index.html">Fast Vector Highlighter</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-highlighter/index.html">Highlighter</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-icu/index.html">ICU</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-instantiated/index.html">Instantiated</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-lucli/index.html">Lucli</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-memory/index.html">Memory</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-misc/index.html">Miscellaneous</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-queries/index.html">Queries</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-queryparser/index.html">Query Parser Framework</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-regex/index.html">Regex</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-remote/index.html">Remote</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-snowball/index.html">Snowball</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-spatial/index.html">Spatial</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-spellchecker/index.html">Spellchecker</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-surround/index.html">Surround</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-swing/index.html">Swing</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-wikipedia/index.html">Wikipedia</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-wordnet/index.html">Wordnet</a>
-</div>
-<div class="menuitem">
-<a href="../api/contrib-xml-query-parser/index.html">XML Query Parser</a>
-</div>
-</div>
-</div>
-<div class="menuitem">
-<a href="../systemrequirements.html">System Requirements</a>
-</div>
-<div class="menuitem">
-<a href="../contributions.html">Contributions</a>
-</div>
-<div class="menuitem">
-<a href="http://wiki.apache.org/lucene-java/LuceneFAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="../fileformats.html">File Formats</a>
-</div>
-<div class="menuitem">
-<a href="../gettingstarted.html">Getting Started</a>
-</div>
-<div class="menupage">
-<div class="menupagetitle">Lucene Contrib</div>
-</div>
-<div class="menuitem">
-<a href="../queryparsersyntax.html">Query Syntax</a>
-</div>
-<div class="menuitem">
-<a href="../scoring.html">Scoring</a>
-</div>
-<div class="menuitem">
-<a href="http://wiki.apache.org/lucene-java">Wiki</a>
-</div>
-</div>
-<div id="credit">
-<hr>
-<a href="http://forrest.apache.org/"><img border="0" title="Built with Apache Forrest" alt="Built with Apache Forrest - logo" src="../images/built-with-forrest-button.png" style="width: 88px;height: 31px;"></a>
-</div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="index.pdf"><img alt="PDF -icon" src="../skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>
-	        Apache Lucene - Lucene Contrib
-		  </h1>
-<div id="minitoc-area">
-<ul class="minitoc">
-<li>
-<a href="#Contrib">Lucene Contrib</a>
-<ul class="minitoc">
-<li>
-<a href="#analyzers">analyzers</a>
-</li>
-<li>
-<a href="#ant">ant</a>
-</li>
-<li>
-<a href="#benchmark">benchmark</a>
-</li>
-<li>
-<a href="#db">db</a>
-</li>
-<li>
-<a href="#highlighter">highlighter</a>
-</li>
-<li>
-<a href="#fast-vector-highlighter">fast-vector-highlighter</a>
-</li>
-<li>
-<a href="#icu">icu</a>
-</li>
-<li>
-<a href="#instantiated">instantiated</a>
-</li>
-<li>
-<a href="#lucli">lucli</a>
-</li>
-<li>
-<a href="#memory">memory</a>
-</li>
-<li>
-<a href="#misc">misc</a>
-</li>
-<li>
-<a href="#queryparser">queryparser</a>
-</li>
-<li>
-<a href="#regex">regex</a>
-</li>
-<li>
-<a href="#remote">remote</a>
-</li>
-<li>
-<a href="#snowball">snowball</a>
-</li>
-<li>
-<a href="#spatial">spatial</a>
-</li>
-<li>
-<a href="#spellchecker">spellchecker</a>
-</li>
-<li>
-<a href="#surround">surround</a>
-</li>
-<li>
-<a href="#swing">swing</a>
-</li>
-<li>
-<a href="#wikipedia">wikipedia</a>
-</li>
-<li>
-<a href="#wordnet">wordnet</a>
-</li>
-<li>
-<a href="#xml-query-parser">xml-query-parser</a>
-</li>
-</ul>
-</li>
-</ul>
-</div>
-
-      
-<a name="N1000C"></a><a name="Contrib"></a>
-<h2 class="boxed">Lucene Contrib</h2>
-<div class="section">
-<p>
-	          The Lucene Java project also contains a workspace, Lucene Contrib
-	          (formerly known as the Lucene Sandbox), that is open both to all Lucene 
-	          Java core committers and to developers whose commit rights are 
-	          restricted to the Contrib workspace; these developers are referred to 
-	          as "Contrib committers".  The Lucene Contrib workspace hosts the 
-	          following types of packages:
-	        </p>
-<ul>
-	          
-<li>Various third party contributions.</li>
-	          
-<li>
-	            Contributions with third party dependencies - the Lucene Java core
-	            distribution has no external runtime dependencies.
-	          </li>
-	          
-<li>
-	            New ideas that are intended for eventual inclusion into the Lucene 
-	            Java core.
-	          </li>
-	         
-</ul>
-<p>
-	          Users are free to experiment with the components developed in the
-	          Contrib workspace, but Contrib packages will not necessarily be
-	          maintained, particularly in their current state. The Lucene Java core 
-	          backwards compatibility commitments (see
-	          <a href="http://wiki.apache.org/lucene-java/BackwardsCompatibility">http://wiki.apache.org/lucene-java/BackwardsCompatibility</a>)
-	          do not necessarily extend to the packages in the Contrib workspace.
-	          See the README.txt file for each Contrib package for details.  If the
-	          README.txt file does not address its backwards compatibility
-	          commitments, users should assume it does not make any compatibility
-	          commitments.
-	        </p>
-<p>
-  			  See <a href="../changes/Contrib-Changes.html">Contrib CHANGES</a> for changes included in the current release.
-			</p>
-<p>
-                You can access the current trunk Contrib repository at
-                <a href="http://svn.apache.org/repos/asf/lucene/java/trunk/contrib/">http://svn.apache.org/repos/asf/lucene/java/trunk/contrib/</a>.
-            </p>
-<a name="N10035"></a><a name="analyzers"></a>
-<h3 class="boxed">analyzers</h3>
-<p>Contributed Analyzers, Tokenizers, and Filters for various uses and languages.</p>
-<p>See <a href="../api/contrib-analyzers/index.html">analyzers javadoc</a>
-</p>
-<a name="N10044"></a><a name="ant"></a>
-<h3 class="boxed">ant</h3>
-<p>Ant task to create Lucene indexes.</p>
-<p>See <a href="../api/contrib-ant/index.html">ant javadoc</a>
-</p>
-<a name="N10053"></a><a name="benchmark"></a>
-<h3 class="boxed">benchmark</h3>
-<p>The benchmark contribution contains tools for benchmarking Lucene using standard, freely available corpora.</p>
-<p>See <a href="../api/contrib-benchmark/index.html">benchmark javadoc</a>
-</p>
-<a name="N10062"></a><a name="db"></a>
-<h3 class="boxed">db</h3>
-<p>Provides integration with Berkley DB.</p>
-<p>See <a href="../api/contrib-db/index.html">db javadoc</a>
-</p>
-<a name="N10071"></a><a name="highlighter"></a>
-<h3 class="boxed">highlighter</h3>
-<p>A set of classes for highlighting matching terms in search results.</p>
-<p>See <a href="../api/contrib-highlighter/index.html">highlighter javadoc</a>
-</p>
-<a name="N10080"></a><a name="fast-vector-highlighter"></a>
-<h3 class="boxed">fast-vector-highlighter</h3>
-<p>An alternative set of classes for highlighting matching terms in search results that relies on stored term vectors.
-                This highlighter can be much faster than the standard highlighter, especially on large fields.</p>
-<p>See <a href="../api/contrib-fast-vector-highlighter/index.html">fast-vector-highlighter javadoc</a>
-</p>
-<a name="N1008F"></a><a name="icu"></a>
-<h3 class="boxed">icu</h3>
-<p>Provides integration with ICU (International Components for Unicode) for
-                stronger Unicode and internationalization support. </p>
-<p>See <a href="../api/contrib-icu/index.html">icu javadoc</a>
-</p>
-<a name="N1009E"></a><a name="instantiated"></a>
-<h3 class="boxed">instantiated</h3>
-<p>RAM-based index that enables much faster searching than RAMDirectory in certain situations.</p>
-<p>See <a href="../api/contrib-instantiated/index.html">instantiated javadoc</a>
-</p>
-<a name="N100AD"></a><a name="lucli"></a>
-<h3 class="boxed">lucli</h3>
-<p>An application that allows Lucene index manipulation from the command-line.</p>
-<p>See <a href="../api/contrib-lucli/index.html">lucli javadoc</a>
-</p>
-<a name="N100BC"></a><a name="memory"></a>
-<h3 class="boxed">memory</h3>
-<p>High-performance single-document main memory index.</p>
-<p>See <a href="../api/contrib-memory/index.html">memory javadoc</a>
-</p>
-<a name="N100CB"></a><a name="misc"></a>
-<h3 class="boxed">misc</h3>
-<p>A variety of miscellaneous files, including QueryParsers, and other alternate Lucene class implementations and tools.</p>
-<p>See <a href="../api/contrib-misc/index.html">misc javadoc</a>
-</p>
-<a name="N100DA"></a><a name="queryparser"></a>
-<h3 class="boxed">queryparser</h3>
-<p>A new Lucene query parser implementation, which matches the syntax of the core QueryParser but offers a more modular architecture to enable customization.</p>
-<p>See <a href="../api/contrib-queryparser/index.html">queryparser javadoc</a>
-</p>
-<a name="N100E9"></a><a name="regex"></a>
-<h3 class="boxed">regex</h3>
-<p>Queries with additional regex matching capabilities.</p>
-<p>See <a href="../api/contrib-regex/index.html">regex javadoc</a>
-</p>
-<a name="N100F8"></a><a name="remote"></a>
-<h3 class="boxed">remote</h3>
-<p>Classes to help use Lucene with RMI.</p>
-<p>See <a href="../api/contrib-remote/index.html">remote javadoc</a>
-</p>
-<a name="N10107"></a><a name="snowball"></a>
-<h3 class="boxed">snowball</h3>
-<p>Pre-compiled versions of the Snowball stemmers for Lucene.</p>
-<p>See <a href="../api/contrib-snowball/index.html">snowball javadoc</a>
-</p>
-<a name="N10116"></a><a name="spatial"></a>
-<h3 class="boxed">spatial</h3>
-<p>Classes to help with efficient distance based sorting.</p>
-<p>See <a href="../api/contrib-spatial/index.html">spatial javadoc</a>
-</p>
-<a name="N10125"></a><a name="spellchecker"></a>
-<h3 class="boxed">spellchecker</h3>
-<p>Provides tools for spellchecking and suggestions with Lucene.</p>
-<p>See <a href="../api/contrib-spellchecker/index.html">spellchecker javadoc</a>
-</p>
-<a name="N10134"></a><a name="surround"></a>
-<h3 class="boxed">surround</h3>
-<p>A QueryParser that supports the Span family of queries as well as pre and infix notation.</p>
-<p>See <a href="../api/contrib-surround/index.html">surround javadoc</a>
-</p>
-<a name="N10143"></a><a name="swing"></a>
-<h3 class="boxed">swing</h3>
-<p>Swing components designed to integrate with Lucene.</p>
-<p>See <a href="../api/contrib-swing/index.html">swing javadoc</a>
-</p>
-<a name="N10152"></a><a name="wikipedia"></a>
-<h3 class="boxed">wikipedia</h3>
-<p>Tools for working with wikipedia content.</p>
-<p>See <a href="../api/contrib-wikipedia/index.html">wikipedia javadoc</a>
-</p>
-<a name="N10161"></a><a name="wordnet"></a>
-<h3 class="boxed">wordnet</h3>
-<p>Tools to help utilize wordnet synonyms with Lucene</p>
-<p>See <a href="../api/contrib-wordnet/index.html">wordnet javadoc</a>
-</p>
-<a name="N10170"></a><a name="xml-query-parser"></a>
-<h3 class="boxed">xml-query-parser</h3>
-<p>A QueryParser that can read queries written in an XML format.</p>
-<p>See <a href="../api/contrib-wordnet/index.html">xml-query-parser javadoc</a>
-</p>
-</div>
-    
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-         2006 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<div id="logos"></div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta content="Apache Forrest" name="Generator">
+<meta name="Forrest-version" content="0.8">
+<meta name="Forrest-skin-name" content="lucene">
+<title>
+	        Apache Lucene - Lucene Contrib
+		  </title>
+<link type="text/css" href="../skin/basic.css" rel="stylesheet">
+<link media="screen" type="text/css" href="../skin/screen.css" rel="stylesheet">
+<link media="print" type="text/css" href="../skin/print.css" rel="stylesheet">
+<link type="text/css" href="../skin/profile.css" rel="stylesheet">
+<script src="../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../skin/fontsize.js" language="javascript" type="text/javascript"></script>
+<link rel="shortcut icon" href="../images/favicon.ico">
+</head>
+<body onload="init()">
+<script type="text/javascript">ndeSetTextSize();</script>
+<div id="top">
+<!--+
+    |breadtrail
+    +-->
+<div class="breadtrail">
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://lucene.apache.org/">Lucene</a><script src="../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
+</div>
+<!--+
+    |header
+    +-->
+<div class="header">
+<!--+
+    |start group logo
+    +-->
+<div class="grouplogo">
+<a href="http://lucene.apache.org/"><img class="logoImage" alt="Lucene" src="http://www.apache.org/images/asf_logo_simple.png" title="Apache Lucene"></a>
+</div>
+<!--+
+    |end group logo
+    +-->
+<!--+
+    |start Project Logo
+    +-->
+<div class="projectlogo">
+<a href="http://lucene.apache.org/java/"><img class="logoImage" alt="Lucene" src="http://lucene.apache.org/images/lucene_green_300.gif" title="Apache Lucene is a high-performance, full-featured text search engine library written entirely in
+      Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform."></a>
+</div>
+<!--+
+    |end Project Logo
+    +-->
+<!--+
+    |start Search
+    +-->
+<div class="searchbox">
+<form action="http://search.lucidimagination.com/p:lucene" method="get" class="roundtopsmall">
+<input onFocus="getBlank (this, 'Search the site with Lucene');" size="25" name="q" id="query" type="text" value="Search the site with Lucene">&nbsp; 
+                    <input name="Search" value="Search" type="submit">
+</form>
+<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
+</div>
+</div>
+<!--+
+    |end search
+    +-->
+<!--+
+    |start Tabs
+    +-->
+<ul id="tabs">
+<li class="current">
+<a class="selected" href="http://lucene.apache.org/java/docs/">Main</a>
+</li>
+<li>
+<a class="unselected" href="http://wiki.apache.org/lucene-java">Wiki</a>
+</li>
+<li class="current">
+<a class="selected" href="../index.html">Lucene 3.1 Documentation</a>
+</li>
+</ul>
+<!--+
+    |end Tabs
+    +-->
+</div>
+</div>
+<div id="main">
+<div id="publishedStrip">
+<!--+
+    |start Subtabs
+    +-->
+<div id="level2tabs"></div>
+<!--+
+    |end Endtabs
+    +-->
+<script type="text/javascript"><!--
+document.write("Last Published: " + document.lastModified);
+//  --></script>
+</div>
+<!--+
+    |breadtrail
+    +-->
+<div class="breadtrail">
+
+             &nbsp;
+           </div>
+<!--+
+    |start Menu, mainarea
+    +-->
+<!--+
+    |start Menu
+    +-->
+<div id="menu">
+<div onclick="SwitchMenu('menu_selected_1.1', '../skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Documentation</div>
+<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a href="../index.html">Overview</a>
+</div>
+<div onclick="SwitchMenu('menu_1.1.2', '../skin/')" id="menu_1.1.2Title" class="menutitle">Changes</div>
+<div id="menu_1.1.2" class="menuitemgroup">
+<div class="menuitem">
+<a href="../changes/Changes.html">Core</a>
+</div>
+<div class="menuitem">
+<a href="../changes/Contrib-Changes.html">Contrib</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.3', '../skin/')" id="menu_1.1.3Title" class="menutitle">Javadocs</div>
+<div id="menu_1.1.3" class="menuitemgroup">
+<div class="menuitem">
+<a href="../api/all/index.html">All</a>
+</div>
+<div class="menuitem">
+<a href="../api/core/index.html">Core</a>
+</div>
+<div class="menuitem">
+<a href="../api/demo/index.html">Demo</a>
+</div>
+<div onclick="SwitchMenu('menu_1.1.3.4', '../skin/')" id="menu_1.1.3.4Title" class="menutitle">Contrib</div>
+<div id="menu_1.1.3.4" class="menuitemgroup">
+<div class="menuitem">
+<a href="../api/contrib-analyzers/index.html">Analyzers</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-smartcn/index.html">Smart Chinese Analyzer</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-ant/index.html">Ant</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-bdb/index.html">Bdb</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-bdb-je/index.html">Bdb-je</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-benchmark/index.html">Benchmark</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-fast-vector-highlighter/index.html">Fast Vector Highlighter</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-highlighter/index.html">Highlighter</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-icu/index.html">ICU</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-instantiated/index.html">Instantiated</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-lucli/index.html">Lucli</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-memory/index.html">Memory</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-misc/index.html">Miscellaneous</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-queries/index.html">Queries</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-queryparser/index.html">Query Parser Framework</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-regex/index.html">Regex</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-remote/index.html">Remote</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-snowball/index.html">Snowball</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-spatial/index.html">Spatial</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-spellchecker/index.html">Spellchecker</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-surround/index.html">Surround</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-swing/index.html">Swing</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-wikipedia/index.html">Wikipedia</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-wordnet/index.html">Wordnet</a>
+</div>
+<div class="menuitem">
+<a href="../api/contrib-xml-query-parser/index.html">XML Query Parser</a>
+</div>
+</div>
+</div>
+<div class="menuitem">
+<a href="../systemrequirements.html">System Requirements</a>
+</div>
+<div class="menuitem">
+<a href="../contributions.html">Contributions</a>
+</div>
+<div class="menuitem">
+<a href="http://wiki.apache.org/lucene-java/LuceneFAQ">FAQ</a>
+</div>
+<div class="menuitem">
+<a href="../fileformats.html">File Formats</a>
+</div>
+<div class="menuitem">
+<a href="../gettingstarted.html">Getting Started</a>
+</div>
+<div class="menupage">
+<div class="menupagetitle">Lucene Contrib</div>
+</div>
+<div class="menuitem">
+<a href="../queryparsersyntax.html">Query Syntax</a>
+</div>
+<div class="menuitem">
+<a href="../scoring.html">Scoring</a>
+</div>
+<div class="menuitem">
+<a href="http://wiki.apache.org/lucene-java">Wiki</a>
+</div>
+</div>
+<div id="credit">
+<hr>
+<a href="http://forrest.apache.org/"><img border="0" title="Built with Apache Forrest" alt="Built with Apache Forrest - logo" src="../images/built-with-forrest-button.png" style="width: 88px;height: 31px;"></a>
+</div>
+<div id="roundbottom">
+<img style="display: none" class="corner" height="15" width="15" alt="" src="../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
+<!--+
+  |alternative credits
+  +-->
+<div id="credit2"></div>
+</div>
+<!--+
+    |end Menu
+    +-->
+<!--+
+    |start content
+    +-->
+<div id="content">
+<div title="Portable Document Format" class="pdflink">
+<a class="dida" href="index.pdf"><img alt="PDF -icon" src="../skin/images/pdfdoc.gif" class="skin"><br>
+        PDF</a>
+</div>
+<h1>
+	        Apache Lucene - Lucene Contrib
+		  </h1>
+<div id="minitoc-area">
+<ul class="minitoc">
+<li>
+<a href="#Contrib">Lucene Contrib</a>
+<ul class="minitoc">
+<li>
+<a href="#analyzers">analyzers</a>
+</li>
+<li>
+<a href="#ant">ant</a>
+</li>
+<li>
+<a href="#benchmark">benchmark</a>
+</li>
+<li>
+<a href="#db">db</a>
+</li>
+<li>
+<a href="#highlighter">highlighter</a>
+</li>
+<li>
+<a href="#fast-vector-highlighter">fast-vector-highlighter</a>
+</li>
+<li>
+<a href="#icu">icu</a>
+</li>
+<li>
+<a href="#instantiated">instantiated</a>
+</li>
+<li>
+<a href="#lucli">lucli</a>
+</li>
+<li>
+<a href="#memory">memory</a>
+</li>
+<li>
+<a href="#misc">misc</a>
+</li>
+<li>
+<a href="#queryparser">queryparser</a>
+</li>
+<li>
+<a href="#regex">regex</a>
+</li>
+<li>
+<a href="#remote">remote</a>
+</li>
+<li>
+<a href="#snowball">snowball</a>
+</li>
+<li>
+<a href="#spatial">spatial</a>
+</li>
+<li>
+<a href="#spellchecker">spellchecker</a>
+</li>
+<li>
+<a href="#surround">surround</a>
+</li>
+<li>
+<a href="#swing">swing</a>
+</li>
+<li>
+<a href="#wikipedia">wikipedia</a>
+</li>
+<li>
+<a href="#wordnet">wordnet</a>
+</li>
+<li>
+<a href="#xml-query-parser">xml-query-parser</a>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+
+      
+<a name="N1000C"></a><a name="Contrib"></a>
+<h2 class="boxed">Lucene Contrib</h2>
+<div class="section">
+<p>
+	          The Lucene Java project also contains a workspace, Lucene Contrib
+	          (formerly known as the Lucene Sandbox), that is open both to all Lucene 
+	          Java core committers and to developers whose commit rights are 
+	          restricted to the Contrib workspace; these developers are referred to 
+	          as "Contrib committers".  The Lucene Contrib workspace hosts the 
+	          following types of packages:
+	        </p>
+<ul>
+	          
+<li>Various third party contributions.</li>
+	          
+<li>
+	            Contributions with third party dependencies - the Lucene Java core
+	            distribution has no external runtime dependencies.
+	          </li>
+	          
+<li>
+	            New ideas that are intended for eventual inclusion into the Lucene 
+	            Java core.
+	          </li>
+	         
+</ul>
+<p>
+	          Users are free to experiment with the components developed in the
+	          Contrib workspace, but Contrib packages will not necessarily be
+	          maintained, particularly in their current state. The Lucene Java core 
+	          backwards compatibility commitments (see
+	          <a href="http://wiki.apache.org/lucene-java/BackwardsCompatibility">http://wiki.apache.org/lucene-java/BackwardsCompatibility</a>)
+	          do not necessarily extend to the packages in the Contrib workspace.
+	          See the README.txt file for each Contrib package for details.  If the
+	          README.txt file does not address its backwards compatibility
+	          commitments, users should assume it does not make any compatibility
+	          commitments.
+	        </p>
+<p>
+  			  See <a href="../changes/Contrib-Changes.html">Contrib CHANGES</a> for changes included in the current release.
+			</p>
+<p>
+                You can access the current trunk Contrib repository at
+                <a href="http://svn.apache.org/repos/asf/lucene/java/trunk/contrib/">http://svn.apache.org/repos/asf/lucene/java/trunk/contrib/</a>.
+            </p>
+<a name="N10035"></a><a name="analyzers"></a>
+<h3 class="boxed">analyzers</h3>
+<p>Contributed Analyzers, Tokenizers, and Filters for various uses and languages.</p>
+<p>See <a href="../api/contrib-analyzers/index.html">analyzers javadoc</a>
+</p>
+<a name="N10044"></a><a name="ant"></a>
+<h3 class="boxed">ant</h3>
+<p>Ant task to create Lucene indexes.</p>
+<p>See <a href="../api/contrib-ant/index.html">ant javadoc</a>
+</p>
+<a name="N10053"></a><a name="benchmark"></a>
+<h3 class="boxed">benchmark</h3>
+<p>The benchmark contribution contains tools for benchmarking Lucene using standard, freely available corpora.</p>
+<p>See <a href="../api/contrib-benchmark/index.html">benchmark javadoc</a>
+</p>
+<a name="N10062"></a><a name="db"></a>
+<h3 class="boxed">db</h3>
+<p>Provides integration with Berkley DB.</p>
+<p>See <a href="../api/contrib-db/index.html">db javadoc</a>
+</p>
+<a name="N10071"></a><a name="highlighter"></a>
+<h3 class="boxed">highlighter</h3>
+<p>A set of classes for highlighting matching terms in search results.</p>
+<p>See <a href="../api/contrib-highlighter/index.html">highlighter javadoc</a>
+</p>
+<a name="N10080"></a><a name="fast-vector-highlighter"></a>
+<h3 class="boxed">fast-vector-highlighter</h3>
+<p>An alternative set of classes for highlighting matching terms in search results that relies on stored term vectors.
+                This highlighter can be much faster than the standard highlighter, especially on large fields.</p>
+<p>See <a href="../api/contrib-fast-vector-highlighter/index.html">fast-vector-highlighter javadoc</a>
+</p>
+<a name="N1008F"></a><a name="icu"></a>
+<h3 class="boxed">icu</h3>
+<p>Provides integration with ICU (International Components for Unicode) for
+                stronger Unicode and internationalization support. </p>
+<p>See <a href="../api/contrib-icu/index.html">icu javadoc</a>
+</p>
+<a name="N1009E"></a><a name="instantiated"></a>
+<h3 class="boxed">instantiated</h3>
+<p>RAM-based index that enables much faster searching than RAMDirectory in certain situations.</p>
+<p>See <a href="../api/contrib-instantiated/index.html">instantiated javadoc</a>
+</p>
+<a name="N100AD"></a><a name="lucli"></a>
+<h3 class="boxed">lucli</h3>
+<p>An application that allows Lucene index manipulation from the command-line.</p>
+<p>See <a href="../api/contrib-lucli/index.html">lucli javadoc</a>
+</p>
+<a name="N100BC"></a><a name="memory"></a>
+<h3 class="boxed">memory</h3>
+<p>High-performance single-document main memory index.</p>
+<p>See <a href="../api/contrib-memory/index.html">memory javadoc</a>
+</p>
+<a name="N100CB"></a><a name="misc"></a>
+<h3 class="boxed">misc</h3>
+<p>A variety of miscellaneous files, including QueryParsers, and other alternate Lucene class implementations and tools.</p>
+<p>See <a href="../api/contrib-misc/index.html">misc javadoc</a>
+</p>
+<a name="N100DA"></a><a name="queryparser"></a>
+<h3 class="boxed">queryparser</h3>
+<p>A new Lucene query parser implementation, which matches the syntax of the core QueryParser but offers a more modular architecture to enable customization.</p>
+<p>See <a href="../api/contrib-queryparser/index.html">queryparser javadoc</a>
+</p>
+<a name="N100E9"></a><a name="regex"></a>
+<h3 class="boxed">regex</h3>
+<p>Queries with additional regex matching capabilities.</p>
+<p>See <a href="../api/contrib-regex/index.html">regex javadoc</a>
+</p>
+<a name="N100F8"></a><a name="remote"></a>
+<h3 class="boxed">remote</h3>
+<p>Classes to help use Lucene with RMI.</p>
+<p>See <a href="../api/contrib-remote/index.html">remote javadoc</a>
+</p>
+<a name="N10107"></a><a name="snowball"></a>
+<h3 class="boxed">snowball</h3>
+<p>Pre-compiled versions of the Snowball stemmers for Lucene.</p>
+<p>See <a href="../api/contrib-snowball/index.html">snowball javadoc</a>
+</p>
+<a name="N10116"></a><a name="spatial"></a>
+<h3 class="boxed">spatial</h3>
+<p>Classes to help with efficient distance based sorting.</p>
+<p>See <a href="../api/contrib-spatial/index.html">spatial javadoc</a>
+</p>
+<a name="N10125"></a><a name="spellchecker"></a>
+<h3 class="boxed">spellchecker</h3>
+<p>Provides tools for spellchecking and suggestions with Lucene.</p>
+<p>See <a href="../api/contrib-spellchecker/index.html">spellchecker javadoc</a>
+</p>
+<a name="N10134"></a><a name="surround"></a>
+<h3 class="boxed">surround</h3>
+<p>A QueryParser that supports the Span family of queries as well as pre and infix notation.</p>
+<p>See <a href="../api/contrib-surround/index.html">surround javadoc</a>
+</p>
+<a name="N10143"></a><a name="swing"></a>
+<h3 class="boxed">swing</h3>
+<p>Swing components designed to integrate with Lucene.</p>
+<p>See <a href="../api/contrib-swing/index.html">swing javadoc</a>
+</p>
+<a name="N10152"></a><a name="wikipedia"></a>
+<h3 class="boxed">wikipedia</h3>
+<p>Tools for working with wikipedia content.</p>
+<p>See <a href="../api/contrib-wikipedia/index.html">wikipedia javadoc</a>
+</p>
+<a name="N10161"></a><a name="wordnet"></a>
+<h3 class="boxed">wordnet</h3>
+<p>Tools to help utilize wordnet synonyms with Lucene</p>
+<p>See <a href="../api/contrib-wordnet/index.html">wordnet javadoc</a>
+</p>
+<a name="N10170"></a><a name="xml-query-parser"></a>
+<h3 class="boxed">xml-query-parser</h3>
+<p>A QueryParser that can read queries written in an XML format.</p>
+<p>See <a href="../api/contrib-wordnet/index.html">xml-query-parser javadoc</a>
+</p>
+</div>
+    
+</div>
+<!--+
+    |end content
+    +-->
+<div class="clearboth">&nbsp;</div>
+</div>
+<div id="footer">
+<!--+
+    |start bottomstrip
+    +-->
+<div class="lastmodified">
+<script type="text/javascript"><!--
+document.write("Last Published: " + document.lastModified);
+//  --></script>
+</div>
+<div class="copyright">
+        Copyright &copy;
+         2006 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
+</div>
+<div id="logos"></div>
+<!--+
+    |end bottomstrip
+    +-->
+</div>
+</body>
+</html>

Propchange: lucene/java/branches/flex_1458/docs/lucene-contrib/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/branches/flex_1458/src/demo/org/apache/lucene/demo/html/HTMLParser.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/demo/org/apache/lucene/demo/html/HTMLParser.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/demo/org/apache/lucene/demo/html/HTMLParser.java (original)
+++ lucene/java/branches/flex_1458/src/demo/org/apache/lucene/demo/html/HTMLParser.java Thu Jan 14 19:05:12 2010
@@ -43,6 +43,7 @@
   /**
    * @deprecated Use HTMLParser(FileInputStream) instead
    */
+  @Deprecated
   public HTMLParser(File file) throws FileNotFoundException {
     this(new FileInputStream(file));
   }

Modified: lucene/java/branches/flex_1458/src/demo/org/apache/lucene/demo/html/HTMLParser.jj
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/demo/org/apache/lucene/demo/html/HTMLParser.jj?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/demo/org/apache/lucene/demo/html/HTMLParser.jj (original)
+++ lucene/java/branches/flex_1458/src/demo/org/apache/lucene/demo/html/HTMLParser.jj Thu Jan 14 19:05:12 2010
@@ -70,6 +70,7 @@
   /**
    * @deprecated Use HTMLParser(FileInputStream) instead
    */
+  @Deprecated
   public HTMLParser(File file) throws FileNotFoundException {
     this(new FileInputStream(file));
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/Analyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/Analyzer.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/Analyzer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/Analyzer.java Thu Jan 14 19:05:12 2010
@@ -20,9 +20,9 @@
 import java.io.Reader;
 import java.io.IOException;
 import java.io.Closeable;
-import java.lang.reflect.Method;
 
 import org.apache.lucene.util.CloseableThreadLocal;
+import org.apache.lucene.util.VirtualMethod;
 import org.apache.lucene.store.AlreadyClosedException;
 
 import org.apache.lucene.document.Fieldable;
@@ -84,20 +84,25 @@
     }
   }
 
-  /** @deprecated */
-  protected boolean overridesTokenStreamMethod = false;
+  private static final VirtualMethod<Analyzer> tokenStreamMethod =
+    new VirtualMethod<Analyzer>(Analyzer.class, "tokenStream", String.class, Reader.class);
+  private static final VirtualMethod<Analyzer> reusableTokenStreamMethod =
+    new VirtualMethod<Analyzer>(Analyzer.class, "reusableTokenStream", String.class, Reader.class);
+
+  /** This field contains if the {@link #tokenStream} method was overridden in a
+   * more far away subclass of {@code Analyzer} on the current instance's inheritance path.
+   * If this field is {@code true}, {@link #reusableTokenStream} should delegate to {@link #tokenStream}
+   * instead of using the own implementation.
+   * @deprecated Please declare all implementations of {@link #reusableTokenStream} and {@link #tokenStream}
+   * as {@code final}.
+   */
+  @Deprecated
+  protected final boolean overridesTokenStreamMethod =
+    VirtualMethod.compareImplementationDistance(this.getClass(), tokenStreamMethod, reusableTokenStreamMethod) > 0;
 
-  /** @deprecated This is only present to preserve
-   *  back-compat of classes that subclass a core analyzer
-   *  and override tokenStream but not reusableTokenStream */
+  /** @deprecated This is a no-op since Lucene 3.1. */
+  @Deprecated
   protected void setOverridesTokenStreamMethod(Class<? extends Analyzer> baseClass) {
-    try {
-      Method m = this.getClass().getMethod("tokenStream", String.class, Reader.class);
-      overridesTokenStreamMethod = m.getDeclaringClass() != baseClass;
-    } catch (NoSuchMethodException nsme) {
-      // cannot happen, as baseClass is subclass of Analyzer through generics
-      overridesTokenStreamMethod = false;
-    }
   }
 
 

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/BaseCharFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/CharArraySet.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/CharArraySet.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/CharArraySet.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/CharArraySet.java Thu Jan 14 19:05:12 2010
@@ -1,5 +1,6 @@
 package org.apache.lucene.analysis;
 
+import java.util.Arrays;
 import java.util.AbstractSet;
 import java.util.Collection;
 import java.util.Collections;
@@ -116,6 +117,7 @@
    *          otherwise <code>true</code>.
    * @deprecated use {@link #CharArraySet(Version, int, boolean)} instead
    */
+  @Deprecated
   public CharArraySet(int startSize, boolean ignoreCase) {
     this(Version.LUCENE_30, startSize, ignoreCase);
   }
@@ -130,6 +132,7 @@
    *          otherwise <code>true</code>.
    * @deprecated use {@link #CharArraySet(Version, Collection, boolean)} instead         
    */  
+  @Deprecated
   public CharArraySet(Collection<? extends Object> c, boolean ignoreCase) {
     this(Version.LUCENE_30, c.size(), ignoreCase);
     addAll(c);
@@ -143,6 +146,13 @@
     this.charUtils = CharacterUtils.getInstance(matchVersion);
     this.matchVersion = matchVersion;
   }
+  
+  /** Clears all entries in this set. This method is supported for reusing, but not {@link Set#remove}. */
+  @Override
+  public void clear() {
+    count = 0;
+    Arrays.fill(entries, null);
+  }
 
   /** true if the <code>len</code> chars of <code>text</code> starting at <code>off</code>
    * are in the set */
@@ -369,35 +379,50 @@
    * @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 will be
+   *         is a {@link CharArraySet} the ignoreCase and matchVersion property will be
    *         preserved.
-   * @deprecated use {@link #copy(Version, Set)} instead
+   * @deprecated use {@link #copy(Version, Set)} instead.
    */
-  public static CharArraySet copy(Set<?> set) {
-    return copy(Version.LUCENE_30, set);
+  @Deprecated
+  public static CharArraySet copy(final Set<?> set) {
+    if(set == EMPTY_SET)
+      return EMPTY_SET;
+    return (set instanceof CharArraySet) ? copy((CharArraySet) set) : copy(Version.LUCENE_30, set);
   }
   
   /**
    * Returns a copy of the given set as a {@link CharArraySet}. If the given set
    * is a {@link CharArraySet} the ignoreCase property will be preserved.
+   * <p>
+   * <b>Note:</b> If you intend to create a copy of another {@link CharArraySet} where
+   * the {@link Version} of the source set differs from its copy
+   * {@link #CharArraySet(Version, Collection, boolean)} should be used instead.
+   * 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.
+   *          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 will be
-   *         preserved.
+   *         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(Version matchVersion, Set<?> set) {
-    if (set == null)
-      throw new NullPointerException("Given set is null");
+  public static CharArraySet copy(final Version matchVersion, final Set<?> set) {
     if(set == EMPTY_SET)
       return EMPTY_SET;
-    final boolean ignoreCase = set instanceof CharArraySet ? ((CharArraySet) set).ignoreCase
-        : false;
-    return new CharArraySet(matchVersion, set, ignoreCase);
+    if(set instanceof CharArraySet) {
+      final CharArraySet source = (CharArraySet) set;
+      // use fast path instead of iterating all values
+      // this is even on very small sets ~10 times faster than iterating
+      final char[][] entries = new char[source.entries.length][];
+      System.arraycopy(source.entries, 0, entries, 0, entries.length);
+      return new CharArraySet(source.matchVersion, entries, source.ignoreCase, source.count);
+    }
+    return new CharArraySet(matchVersion, set, false);
   }
   
 
@@ -465,6 +490,11 @@
     }
 
     @Override
+    public void clear() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
     public boolean add(Object o){
       throw new UnsupportedOperationException();
     }

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/CharFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/CharReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/CharReader.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/CharReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/CharReader.java Thu Jan 14 19:05:12 2010
@@ -28,7 +28,7 @@
  */
 public final class CharReader extends CharStream {
 
-  protected Reader input;
+  private final Reader input;
   
   public static CharStream get(Reader input) {
     return input instanceof CharStream ?

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/CharReader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/CharStream.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/ISOLatin1AccentFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/ISOLatin1AccentFilter.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/ISOLatin1AccentFilter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/ISOLatin1AccentFilter.java Thu Jan 14 19:05:12 2010
@@ -31,6 +31,7 @@
  * This class is included for use with existing
  * indexes and will be removed in a future release (possibly Lucene 4.0).
  */
+@Deprecated
 public final class ISOLatin1AccentFilter extends TokenFilter {
   public ISOLatin1AccentFilter(TokenStream input) {
     super(input);

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/KeywordAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/KeywordAnalyzer.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/KeywordAnalyzer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/KeywordAnalyzer.java Thu Jan 14 19:05:12 2010
@@ -26,7 +26,6 @@
  */
 public class KeywordAnalyzer extends Analyzer {
   public KeywordAnalyzer() {
-    setOverridesTokenStreamMethod(KeywordAnalyzer.class);
   }
   @Override
   public TokenStream tokenStream(String fieldName,

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/LowerCaseFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/LowerCaseFilter.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/LowerCaseFilter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/LowerCaseFilter.java Thu Jan 14 19:05:12 2010
@@ -50,6 +50,7 @@
   /**
    * @deprecated Use {@link #LowerCaseFilter(Version, TokenStream)} instead.
    */
+  @Deprecated
   public LowerCaseFilter(TokenStream in) {
     this(Version.LUCENE_30, in);
   }

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/MappingCharFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/NormalizeCharMap.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java?rev=899359&r1=899358&r2=899359&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java Thu Jan 14 19:05:12 2010
@@ -72,7 +72,6 @@
     if (fieldAnalyzers != null) {
       analyzerMap.putAll(fieldAnalyzers);
     }
-    setOverridesTokenStreamMethod(PerFieldAnalyzerWrapper.class);
   }