Index: lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java
===================================================================
--- lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java	(revision 1332803)
+++ lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java	(working copy)
@@ -85,10 +85,10 @@
     assertEquals("((b:one t:one)^2.0) (b:two t:two)", q.toString());
 
     q = mfqp.parse("one~ two");
-    assertEquals("(b:one~2.0 t:one~2.0) (b:two t:two)", q.toString());
+    assertEquals("(b:one~2 t:one~2) (b:two t:two)", q.toString());
 
     q = mfqp.parse("one~0.8 two^2");
-    assertEquals("(b:one~0.8 t:one~0.8) ((b:two t:two)^2.0)", q.toString());
+    assertEquals("(b:one~0 t:one~0) ((b:two t:two)^2.0)", q.toString());
 
     q = mfqp.parse("one* two*");
     assertEquals("(b:one* t:one*) (b:two* t:two*)", q.toString());
@@ -272,7 +272,7 @@
     q = parser.parse("bla*");
     assertEquals("f1:bla* f2:bla* f3:bla*", q.toString());
     q = parser.parse("bla~");
-    assertEquals("f1:bla~2.0 f2:bla~2.0 f3:bla~2.0", q.toString());
+    assertEquals("f1:bla~2 f2:bla~2 f3:bla~2", q.toString());
     q = parser.parse("[a TO c]");
     assertEquals("f1:[a TO c] f2:[a TO c] f3:[a TO c]", q.toString());
   }
Index: lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java
===================================================================
--- lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java	(revision 1332803)
+++ lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java	(working copy)
@@ -100,10 +100,10 @@
     assertEquals("((b:one t:one)^2.0) (b:two t:two)", q.toString());
 
     q = mfqp.parse("one~ two", null);
-    assertEquals("(b:one~2.0 t:one~2.0) (b:two t:two)", q.toString());
+    assertEquals("(b:one~2 t:one~2) (b:two t:two)", q.toString());
 
     q = mfqp.parse("one~0.8 two^2", null);
-    assertEquals("(b:one~0.8 t:one~0.8) ((b:two t:two)^2.0)", q.toString());
+    assertEquals("(b:one~0 t:one~0) ((b:two t:two)^2.0)", q.toString());
 
     q = mfqp.parse("one* two*", null);
     assertEquals("(b:one* t:one*) (b:two* t:two*)", q.toString());
@@ -311,7 +311,7 @@
     q = parser.parse("bla*", null);
     assertEquals("f1:bla* f2:bla* f3:bla*", q.toString());
     q = parser.parse("bla~", null);
-    assertEquals("f1:bla~2.0 f2:bla~2.0 f3:bla~2.0", q.toString());
+    assertEquals("f1:bla~2 f2:bla~2 f3:bla~2", q.toString());
     q = parser.parse("[a TO c]", null);
     assertEquals("f1:[a TO c] f2:[a TO c] f3:[a TO c]", q.toString());
   }
Index: lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java
===================================================================
--- lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java	(revision 1332803)
+++ lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java	(working copy)
@@ -514,12 +514,12 @@
   public void testWildcard() throws Exception {
     assertQueryEquals("term*", null, "term*");
     assertQueryEquals("term*^2", null, "term*^2.0");
-    assertQueryEquals("term~", null, "term~2.0");
-    assertQueryEquals("term~0.7", null, "term~0.7");
+    assertQueryEquals("term~", null, "term~2");
+    assertQueryEquals("term~0.7", null, "term~1");
 
-    assertQueryEquals("term~^3", null, "term~2.0^3.0");
+    assertQueryEquals("term~^3", null, "term~2^3.0");
 
-    assertQueryEquals("term^3~", null, "term~2.0^3.0");
+    assertQueryEquals("term^3~", null, "term~2^3.0");
     assertQueryEquals("term*germ", null, "term*germ");
     assertQueryEquals("term*germ^3", null, "term*germ^3.0");
 
@@ -528,10 +528,10 @@
     assertTrue(getQuery("term~", null) instanceof FuzzyQuery);
     assertTrue(getQuery("term~0.7", null) instanceof FuzzyQuery);
     FuzzyQuery fq = (FuzzyQuery) getQuery("term~0.7", null);
-    assertEquals(0.7f, fq.getMinSimilarity(), 0.1f);
+    assertEquals(1, fq.getMaxEdits());
     assertEquals(FuzzyQuery.defaultPrefixLength, fq.getPrefixLength());
     fq = (FuzzyQuery) getQuery("term~", null);
-    assertEquals(2.0f, fq.getMinSimilarity(), 0.1f);
+    assertEquals(2, fq.getMaxEdits());
     assertEquals(FuzzyQuery.defaultPrefixLength, fq.getPrefixLength());
 
     assertQueryNodeException("term~1.1"); // value > 1, throws exception
@@ -567,9 +567,9 @@
     assertWildcardQueryEquals("TE?M", false, "TE?M");
     assertWildcardQueryEquals("Te?m*gerM", false, "Te?m*gerM");
     // Fuzzy queries:
-    assertWildcardQueryEquals("Term~", "term~2.0");
-    assertWildcardQueryEquals("Term~", true, "term~2.0");
-    assertWildcardQueryEquals("Term~", false, "Term~2.0");
+    assertWildcardQueryEquals("Term~", "term~2");
+    assertWildcardQueryEquals("Term~", true, "term~2");
+    assertWildcardQueryEquals("Term~", false, "Term~2");
     // Range queries:
 
     // TODO: implement this on QueryParser
@@ -805,10 +805,10 @@
 
     assertQueryEquals("a:b\\\\?c", a, "a:b\\?c");
 
-    assertQueryEquals("a:b\\-c~", a, "a:b-c~2.0");
-    assertQueryEquals("a:b\\+c~", a, "a:b+c~2.0");
-    assertQueryEquals("a:b\\:c~", a, "a:b:c~2.0");
-    assertQueryEquals("a:b\\\\c~", a, "a:b\\c~2.0");
+    assertQueryEquals("a:b\\-c~", a, "a:b-c~2");
+    assertQueryEquals("a:b\\+c~", a, "a:b+c~2");
+    assertQueryEquals("a:b\\:c~", a, "a:b:c~2");
+    assertQueryEquals("a:b\\\\c~", a, "a:b\\c~2");
 
     // TODO: implement Range queries on QueryParser
     assertQueryEquals("[ a\\- TO a\\+ ]", null, "[a- TO a+]");
Index: lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java
===================================================================
--- lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java	(revision 1332803)
+++ lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java	(working copy)
@@ -282,10 +282,10 @@
   public void testWildcard() throws Exception {
     assertQueryEquals("term*", null, "term*");
     assertQueryEquals("term*^2", null, "term*^2.0");
-    assertQueryEquals("term~", null, "term~2.0");
-    assertQueryEquals("term~0.7", null, "term~0.7");
-    assertQueryEquals("term~^3", null, "term~2.0^3.0");
-    assertQueryEquals("term^3~", null, "term~2.0^3.0");
+    assertQueryEquals("term~", null, "term~2");
+    assertQueryEquals("term~0.7", null, "term~1");
+    assertQueryEquals("term~^3", null, "term~2^3.0");
+    assertQueryEquals("term^3~", null, "term~2^3.0");
     assertQueryEquals("term*germ", null, "term*germ");
     assertQueryEquals("term*germ^3", null, "term*germ^3.0");
 
@@ -294,10 +294,10 @@
     assertTrue(getQuery("term~", null) instanceof FuzzyQuery);
     assertTrue(getQuery("term~0.7", null) instanceof FuzzyQuery);
     FuzzyQuery fq = (FuzzyQuery) getQuery("term~0.7", null);
-    assertEquals(0.7f, fq.getMinSimilarity(), 0.1f);
+    assertEquals(1, fq.getMaxEdits());
     assertEquals(FuzzyQuery.defaultPrefixLength, fq.getPrefixLength());
     fq = (FuzzyQuery) getQuery("term~", null);
-    assertEquals(2.0f, fq.getMinSimilarity(), 0.1f);
+    assertEquals(2, fq.getMaxEdits());
     assertEquals(FuzzyQuery.defaultPrefixLength, fq.getPrefixLength());
     try {
       getQuery("term~1.1", null); // value > 1, throws exception
@@ -336,9 +336,9 @@
     assertWildcardQueryEquals("TE?M", false, "TE?M");
     assertWildcardQueryEquals("Te?m*gerM", false, "Te?m*gerM");
     // Fuzzy queries:
-    assertWildcardQueryEquals("Term~", "term~2.0");
-    assertWildcardQueryEquals("Term~", true, "term~2.0");
-    assertWildcardQueryEquals("Term~", false, "Term~2.0");
+    assertWildcardQueryEquals("Term~", "term~2");
+    assertWildcardQueryEquals("Term~", true, "term~2");
+    assertWildcardQueryEquals("Term~", false, "Term~2");
     // Range queries:
     assertWildcardQueryEquals("[A TO C]", "[a TO c]");
     assertWildcardQueryEquals("[A TO C]", true, "[a TO c]");
@@ -498,10 +498,10 @@
 
     assertQueryEquals("a:b\\\\?c", a, "a:b\\?c");
 
-    assertQueryEquals("a:b\\-c~", a, "a:b-c~2.0");
-    assertQueryEquals("a:b\\+c~", a, "a:b+c~2.0");
-    assertQueryEquals("a:b\\:c~", a, "a:b:c~2.0");
-    assertQueryEquals("a:b\\\\c~", a, "a:b\\c~2.0");
+    assertQueryEquals("a:b\\-c~", a, "a:b-c~2");
+    assertQueryEquals("a:b\\+c~", a, "a:b+c~2");
+    assertQueryEquals("a:b\\:c~", a, "a:b:c~2");
+    assertQueryEquals("a:b\\\\c~", a, "a:b\\c~2");
 
     assertQueryEquals("[ a\\- TO a\\+ ]", null, "[a- TO a+]");
     assertQueryEquals("[ a\\: TO a\\~ ]", null, "[a: TO a~]");
Index: lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java
===================================================================
--- lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java	(revision 1332803)
+++ lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java	(working copy)
@@ -59,8 +59,8 @@
     fuzzyInput = new String[] { "Übersetzung Übersetzung~0.9",
         "Mötley Crüe Mötley~0.75 Crüe~0.5",
         "Renée Zellweger Renée~0.9 Zellweger~" };
-    fuzzyExpected = new String[] { "ubersetzung ubersetzung~0.9",
-        "motley crue motley~0.75 crue~0.5", "renee zellweger renee~0.9 zellweger~2.0" };
+    fuzzyExpected = new String[] { "ubersetzung ubersetzung~1",
+        "motley crue motley~1 crue~2", "renee zellweger renee~0 zellweger~2" };
 
     a = new ASCIIAnalyzer();
   }
Index: lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java
===================================================================
--- lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java	(revision 1332803)
+++ lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java	(working copy)
@@ -420,10 +420,10 @@
   public void testWildcard() throws Exception {
     assertQueryEquals("term*", null, "term*");
     assertQueryEquals("term*^2", null, "term*^2.0");
-    assertQueryEquals("term~", null, "term~2.0");
-    assertQueryEquals("term~0.7", null, "term~0.7");
-    assertQueryEquals("term~^3", null, "term~2.0^3.0");
-    assertQueryEquals("term^3~", null, "term~2.0^3.0");
+    assertQueryEquals("term~", null, "term~2");
+    assertQueryEquals("term~0.7", null, "term~1");
+    assertQueryEquals("term~^3", null, "term~2^3.0");
+    assertQueryEquals("term^3~", null, "term~2^3.0");
     assertQueryEquals("term*germ", null, "term*germ");
     assertQueryEquals("term*germ^3", null, "term*germ^3.0");
 
@@ -432,10 +432,10 @@
     assertTrue(getQuery("term~", null) instanceof FuzzyQuery);
     assertTrue(getQuery("term~0.7", null) instanceof FuzzyQuery);
     FuzzyQuery fq = (FuzzyQuery)getQuery("term~0.7", null);
-    assertEquals(0.7f, fq.getMinSimilarity(), 0.1f);
+    assertEquals(1, fq.getMaxEdits());
     assertEquals(FuzzyQuery.defaultPrefixLength, fq.getPrefixLength());
     fq = (FuzzyQuery)getQuery("term~", null);
-    assertEquals(2.0f, fq.getMinSimilarity(), 0.1f);
+    assertEquals(2, fq.getMaxEdits());
     assertEquals(FuzzyQuery.defaultPrefixLength, fq.getPrefixLength());
     
     assertParseException("term~1.1"); // value > 1, throws exception
@@ -470,9 +470,9 @@
     assertWildcardQueryEquals("TE?M", false, "TE?M");
     assertWildcardQueryEquals("Te?m*gerM", false, "Te?m*gerM");
 //  Fuzzy queries:
-    assertWildcardQueryEquals("Term~", "term~2.0");
-    assertWildcardQueryEquals("Term~", true, "term~2.0");
-    assertWildcardQueryEquals("Term~", false, "Term~2.0");
+    assertWildcardQueryEquals("Term~", "term~2");
+    assertWildcardQueryEquals("Term~", true, "term~2");
+    assertWildcardQueryEquals("Term~", false, "Term~2");
 //  Range queries:
     assertWildcardQueryEquals("[A TO C]", "[a TO c]");
     assertWildcardQueryEquals("[A TO C]", true, "[a TO c]");
@@ -693,10 +693,10 @@
 
     assertQueryEquals("a:b\\\\?c", a, "a:b\\\\?c");
 
-    assertQueryEquals("a:b\\-c~", a, "a:b-c~2.0");
-    assertQueryEquals("a:b\\+c~", a, "a:b+c~2.0");
-    assertQueryEquals("a:b\\:c~", a, "a:b:c~2.0");
-    assertQueryEquals("a:b\\\\c~", a, "a:b\\c~2.0");
+    assertQueryEquals("a:b\\-c~", a, "a:b-c~2");
+    assertQueryEquals("a:b\\+c~", a, "a:b+c~2");
+    assertQueryEquals("a:b\\:c~", a, "a:b:c~2");
+    assertQueryEquals("a:b\\\\c~", a, "a:b\\c~2");
 
     assertQueryEquals("[ a\\- TO a\\+ ]", null, "[a- TO a+]");
     assertQueryEquals("[ a\\: TO a\\~ ]", null, "[a: TO a~]");
@@ -1271,7 +1271,7 @@
   public void testDistanceAsEditsParsing() throws Exception {
     QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "field", new MockAnalyzer(random()));
     FuzzyQuery q = (FuzzyQuery) qp.parse("foobar~2");
-    assertEquals(2f, q.getMinSimilarity(), 0.0001f);
+    assertEquals(2, q.getMaxEdits());
   }
 
   public void testPhraseQueryToString() throws ParseException {
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/FuzzyLikeThisQueryBuilder.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/FuzzyLikeThisQueryBuilder.java	(revision 1332803)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/FuzzyLikeThisQueryBuilder.java	(working copy)
@@ -5,7 +5,7 @@
 import org.apache.lucene.queryparser.xml.ParserException;
 import org.apache.lucene.queryparser.xml.QueryBuilder;
 import org.apache.lucene.sandbox.queries.FuzzyLikeThisQuery;
-import org.apache.lucene.search.FuzzyQuery;
+import org.apache.lucene.sandbox.queries.SlowFuzzyQuery;
 import org.apache.lucene.search.Query;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
@@ -33,7 +33,7 @@
 public class FuzzyLikeThisQueryBuilder implements QueryBuilder {
 
   private static final int DEFAULT_MAX_NUM_TERMS = 50;
-  private static final float DEFAULT_MIN_SIMILARITY = FuzzyQuery.defaultMinSimilarity;
+  private static final float DEFAULT_MIN_SIMILARITY = SlowFuzzyQuery.defaultMinSimilarity;
   private static final int DEFAULT_PREFIX_LENGTH = 1;
   private static final boolean DEFAULT_IGNORE_TF = false;
 
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java	(revision 1332803)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java	(working copy)
@@ -774,7 +774,10 @@
    */
   protected Query newFuzzyQuery(Term term, float minimumSimilarity, int prefixLength) {
     // FuzzyQuery doesn't yet allow constant score rewrite
-    return new FuzzyQuery(term,minimumSimilarity,prefixLength);
+    String text = term.text();
+    int numEdits = FuzzyQuery.floatToEdits(minimumSimilarity, 
+        text.codePointCount(0, text.length()));
+    return new FuzzyQuery(term,numEdits,prefixLength);
   }
 
   // TODO: Should this be protected instead?
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/FuzzyQueryNodeBuilder.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/FuzzyQueryNodeBuilder.java	(revision 1332803)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/FuzzyQueryNodeBuilder.java	(working copy)
@@ -34,9 +34,13 @@
 
   public FuzzyQuery build(QueryNode queryNode) throws QueryNodeException {
     FuzzyQueryNode fuzzyNode = (FuzzyQueryNode) queryNode;
-
+    String text = fuzzyNode.getTextAsString();
+    
+    int numEdits = FuzzyQuery.floatToEdits(fuzzyNode.getSimilarity(), 
+        text.codePointCount(0, text.length()));
+    
     return new FuzzyQuery(new Term(fuzzyNode.getFieldAsString(), fuzzyNode
-        .getTextAsString()), fuzzyNode.getSimilarity(), fuzzyNode
+        .getTextAsString()), numEdits, fuzzyNode
         .getPrefixLength());
 
   }
Index: lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery2.java
===================================================================
--- lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery2.java	(revision 1332803)
+++ lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery2.java	(working copy)
@@ -1,180 +0,0 @@
-package org.apache.lucene.search;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-import org.apache.lucene.analysis.MockAnalyzer;
-import org.apache.lucene.analysis.MockTokenizer;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.document.TextField;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.RandomIndexWriter;
-import org.apache.lucene.index.Term;
-import org.apache.lucene.search.similarities.DefaultSimilarity;
-import org.apache.lucene.store.Directory;
-import org.apache.lucene.util.LuceneTestCase;
-
-/** 
- * Tests the results of fuzzy against pre-recorded output 
- * The format of the file is the following:
- * 
- * Header Row: # of bits: generate 2^n sequential documents 
- * with a value of Integer.toBinaryString
- * 
- * Entries: an entry is a param spec line, a resultCount line, and
- * then 'resultCount' results lines. The results lines are in the
- * expected order.
- * 
- * param spec line: a comma-separated list of params to FuzzyQuery
- *   (query, prefixLen, pqSize, minScore)
- * query = query text as a number (expand with Integer.toBinaryString)
- * prefixLen = prefix length
- * pqSize = priority queue maximum size for TopTermsBoostOnlyBooleanQueryRewrite
- * minScore = minimum similarity
- * 
- * resultCount line: total number of expected hits.
- * 
- * results line: comma-separated docID, score pair
- **/
-public class TestFuzzyQuery2 extends LuceneTestCase {
-  /** epsilon for score comparisons */
-  static final float epsilon = 0.00001f;
-
-  static int[][] mappings = new int[][] {
-    new int[] { 0x40, 0x41 },
-    new int[] { 0x40, 0x0195 },
-    new int[] { 0x40, 0x0906 },
-    new int[] { 0x40, 0x1040F },
-    new int[] { 0x0194, 0x0195 },
-    new int[] { 0x0194, 0x0906 },
-    new int[] { 0x0194, 0x1040F },
-    new int[] { 0x0905, 0x0906 },
-    new int[] { 0x0905, 0x1040F },
-    new int[] { 0x1040E, 0x1040F }
-  };
-  public void testFromTestData() throws Exception {
-    // TODO: randomize!
-    assertFromTestData(mappings[random().nextInt(mappings.length)]);
-  }
-
-  public void assertFromTestData(int codePointTable[]) throws Exception {
-    if (VERBOSE) {
-      System.out.println("TEST: codePointTable=" + codePointTable);
-    }
-    InputStream stream = getClass().getResourceAsStream("fuzzyTestData.txt");
-    BufferedReader reader = new BufferedReader(new InputStreamReader(stream, "UTF-8"));
-    
-    int bits = Integer.parseInt(reader.readLine());
-    int terms = (int) Math.pow(2, bits);
-    
-    Directory dir = newDirectory();
-    RandomIndexWriter writer = new RandomIndexWriter(random(), dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.KEYWORD, false)).setMergePolicy(newLogMergePolicy()));
-
-    Document doc = new Document();
-    Field field = newField("field", "", TextField.TYPE_UNSTORED);
-    doc.add(field);
-    
-    for (int i = 0; i < terms; i++) {
-      field.setStringValue(mapInt(codePointTable, i));
-      writer.addDocument(doc);
-    }   
-    
-    IndexReader r = writer.getReader();
-    IndexSearcher searcher = newSearcher(r);
-    if (VERBOSE) {
-      System.out.println("TEST: searcher=" + searcher);
-    }
-    // even though this uses a boost-only rewrite, this test relies upon queryNorm being the default implementation,
-    // otherwise scores are different!
-    searcher.setSimilarity(new DefaultSimilarity());
-    
-    writer.close();
-    String line;
-    while ((line = reader.readLine()) != null) {
-      String params[] = line.split(",");
-      String query = mapInt(codePointTable, Integer.parseInt(params[0]));
-      int prefix = Integer.parseInt(params[1]);
-      int pqSize = Integer.parseInt(params[2]);
-      float minScore = Float.parseFloat(params[3]);
-      FuzzyQuery q = new FuzzyQuery(new Term("field", query), minScore, prefix);
-      q.setRewriteMethod(new MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite(pqSize));
-      int expectedResults = Integer.parseInt(reader.readLine());
-      TopDocs docs = searcher.search(q, expectedResults);
-      assertEquals(expectedResults, docs.totalHits);
-      for (int i = 0; i < expectedResults; i++) {
-        String scoreDoc[] = reader.readLine().split(",");
-        assertEquals(Integer.parseInt(scoreDoc[0]), docs.scoreDocs[i].doc);
-        assertEquals(Float.parseFloat(scoreDoc[1]), docs.scoreDocs[i].score, epsilon);
-      }
-    }
-    r.close();
-    dir.close();
-  }
-  
-  /* map bits to unicode codepoints */
-  private static String mapInt(int codePointTable[], int i) {
-    StringBuilder sb = new StringBuilder();
-    String binary = Integer.toBinaryString(i);
-    for (int j = 0; j < binary.length(); j++)
-      sb.appendCodePoint(codePointTable[binary.charAt(j) - '0']);
-    return sb.toString();
-  }
-
-  /* Code to generate test data
-  public static void main(String args[]) throws Exception {
-    int bits = 3;
-    System.out.println(bits);
-    int terms = (int) Math.pow(2, bits);
-    
-    RAMDirectory dir = new RAMDirectory();
-    IndexWriter writer = new IndexWriter(dir, new KeywordAnalyzer(),
-        IndexWriter.MaxFieldLength.UNLIMITED);
-    
-    Document doc = new Document();
-    Field field = newField("field", "", Field.Store.NO, Field.Index.ANALYZED);
-    doc.add(field);
-
-    for (int i = 0; i < terms; i++) {
-      field.setValue(Integer.toBinaryString(i));
-      writer.addDocument(doc);
-    }
-    
-    writer.forceMerge(1);
-    writer.close();
-
-    IndexSearcher searcher = new IndexSearcher(dir);
-    for (int prefix = 0; prefix < bits; prefix++)
-      for (int pqsize = 1; pqsize <= terms; pqsize++)
-        for (float minscore = 0.1F; minscore < 1F; minscore += 0.2F)
-          for (int query = 0; query < terms; query++) {
-            FuzzyQuery q = new FuzzyQuery(
-                new Term("field", Integer.toBinaryString(query)), minscore, prefix);
-            q.setRewriteMethod(new MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite(pqsize));
-            System.out.println(query + "," + prefix + "," + pqsize + "," + minscore);
-            TopDocs docs = searcher.search(q, terms);
-            System.out.println(docs.totalHits);
-            for (int i = 0; i < docs.totalHits; i++)
-              System.out.println(docs.scoreDocs[i].doc + "," + docs.scoreDocs[i].score);
-          }
-  }
-  */
-}
Index: lucene/core/src/test/org/apache/lucene/search/fuzzyTestData.txt
===================================================================
--- lucene/core/src/test/org/apache/lucene/search/fuzzyTestData.txt	(revision 1332803)
+++ lucene/core/src/test/org/apache/lucene/search/fuzzyTestData.txt	(working copy)
@@ -1,3721 +0,0 @@
-3
-0,0,1,0.1
-1
-0,1.0
-1,0,1,0.1
-1
-1,1.0
-2,0,1,0.1
-1
-2,1.0
-3,0,1,0.1
-1
-3,1.0
-4,0,1,0.1
-1
-4,1.0
-5,0,1,0.1
-1
-5,1.0
-6,0,1,0.1
-1
-6,1.0
-7,0,1,0.1
-1
-7,1.0
-0,0,1,0.3
-1
-0,1.0
-1,0,1,0.3
-1
-1,1.0
-2,0,1,0.3
-1
-2,1.0
-3,0,1,0.3
-1
-3,1.0
-4,0,1,0.3
-1
-4,1.0
-5,0,1,0.3
-1
-5,1.0
-6,0,1,0.3
-1
-6,1.0
-7,0,1,0.3
-1
-7,1.0
-0,0,1,0.5
-1
-0,1.0
-1,0,1,0.5
-1
-1,1.0
-2,0,1,0.5
-1
-2,1.0
-3,0,1,0.5
-1
-3,1.0
-4,0,1,0.5
-1
-4,1.0
-5,0,1,0.5
-1
-5,1.0
-6,0,1,0.5
-1
-6,1.0
-7,0,1,0.5
-1
-7,1.0
-0,0,1,0.7
-1
-0,1.0
-1,0,1,0.7
-1
-1,1.0
-2,0,1,0.7
-1
-2,1.0
-3,0,1,0.7
-1
-3,1.0
-4,0,1,0.7
-1
-4,1.0
-5,0,1,0.7
-1
-5,1.0
-6,0,1,0.7
-1
-6,1.0
-7,0,1,0.7
-1
-7,1.0
-0,0,1,0.9
-1
-0,1.0
-1,0,1,0.9
-1
-1,1.0
-2,0,1,0.9
-1
-2,1.0
-3,0,1,0.9
-1
-3,1.0
-4,0,1,0.9
-1
-4,1.0
-5,0,1,0.9
-1
-5,1.0
-6,0,1,0.9
-1
-6,1.0
-7,0,1,0.9
-1
-7,1.0
-0,0,2,0.1
-1
-0,1.0
-1,0,2,0.1
-1
-1,1.0
-2,0,2,0.1
-2
-2,0.91381156
-4,0.4061385
-3,0,2,0.1
-2
-3,0.91381156
-2,0.4061385
-4,0,2,0.1
-2
-4,0.84623283
-5,0.53281325
-5,0,2,0.1
-2
-5,0.84623283
-4,0.53281325
-6,0,2,0.1
-2
-6,0.84623283
-4,0.53281325
-7,0,2,0.1
-2
-7,0.84623283
-5,0.53281325
-0,0,2,0.3
-1
-0,1.0
-1,0,2,0.3
-1
-1,1.0
-2,0,2,0.3
-2
-2,0.96152395
-4,0.27472112
-3,0,2,0.3
-2
-3,0.96152395
-2,0.27472112
-4,0,2,0.3
-2
-4,0.88583153
-5,0.4640069
-5,0,2,0.3
-2
-5,0.88583153
-4,0.4640069
-6,0,2,0.3
-2
-6,0.88583153
-4,0.4640069
-7,0,2,0.3
-2
-7,0.88583153
-5,0.4640069
-0,0,2,0.5
-1
-0,1.0
-1,0,2,0.5
-1
-1,1.0
-2,0,2,0.5
-1
-2,1.0
-3,0,2,0.5
-1
-3,1.0
-4,0,2,0.5
-2
-4,0.9486833
-5,0.3162277
-5,0,2,0.5
-2
-5,0.9486833
-4,0.3162277
-6,0,2,0.5
-2
-6,0.9486833
-4,0.3162277
-7,0,2,0.5
-2
-7,0.9486833
-5,0.3162277
-0,0,2,0.7
-1
-0,1.0
-1,0,2,0.7
-1
-1,1.0
-2,0,2,0.7
-1
-2,1.0
-3,0,2,0.7
-1
-3,1.0
-4,0,2,0.7
-1
-4,1.0
-5,0,2,0.7
-1
-5,1.0
-6,0,2,0.7
-1
-6,1.0
-7,0,2,0.7
-1
-7,1.0
-0,0,2,0.9
-1
-0,1.0
-1,0,2,0.9
-1
-1,1.0
-2,0,2,0.9
-1
-2,1.0
-3,0,2,0.9
-1
-3,1.0
-4,0,2,0.9
-1
-4,1.0
-5,0,2,0.9
-1
-5,1.0
-6,0,2,0.9
-1
-6,1.0
-7,0,2,0.9
-1
-7,1.0
-0,0,3,0.1
-1
-0,1.0
-1,0,3,0.1
-1
-1,1.0
-2,0,3,0.1
-3
-2,0.84664875
-4,0.37628835
-5,0.37628835
-3,0,3,0.1
-3
-3,0.84664875
-2,0.37628835
-5,0.37628835
-4,0,3,0.1
-3
-4,0.74683726
-5,0.47023085
-6,0.47023085
-5,0,3,0.1
-3
-5,0.74683726
-4,0.47023085
-7,0.47023085
-6,0,3,0.1
-3
-6,0.74683726
-4,0.47023085
-7,0.47023085
-7,0,3,0.1
-3
-7,0.74683726
-5,0.47023085
-6,0.47023085
-0,0,3,0.3
-1
-0,1.0
-1,0,3,0.3
-1
-1,1.0
-2,0,3,0.3
-3
-2,0.92717266
-4,0.26490647
-5,0.26490647
-3,0,3,0.3
-3
-3,0.92717266
-2,0.26490647
-5,0.26490647
-4,0,3,0.3
-3
-4,0.8035427
-5,0.42090324
-6,0.42090324
-5,0,3,0.3
-3
-5,0.80354273
-4,0.42090327
-7,0.42090327
-6,0,3,0.3
-3
-6,0.80354273
-4,0.42090327
-7,0.42090327
-7,0,3,0.3
-3
-7,0.8035427
-5,0.42090324
-6,0.42090324
-0,0,3,0.5
-1
-0,1.0
-1,0,3,0.5
-1
-1,1.0
-2,0,3,0.5
-1
-2,1.0
-3,0,3,0.5
-1
-3,1.0
-4,0,3,0.5
-3
-4,0.9045341
-5,0.3015113
-6,0.3015113
-5,0,3,0.5
-3
-5,0.9045341
-4,0.3015113
-7,0.3015113
-6,0,3,0.5
-3
-6,0.9045341
-4,0.3015113
-7,0.3015113
-7,0,3,0.5
-3
-7,0.9045341
-5,0.3015113
-6,0.3015113
-0,0,3,0.7
-1
-0,1.0
-1,0,3,0.7
-1
-1,1.0
-2,0,3,0.7
-1
-2,1.0
-3,0,3,0.7
-1
-3,1.0
-4,0,3,0.7
-1
-4,1.0
-5,0,3,0.7
-1
-5,1.0
-6,0,3,0.7
-1
-6,1.0
-7,0,3,0.7
-1
-7,1.0
-0,0,3,0.9
-1
-0,1.0
-1,0,3,0.9
-1
-1,1.0
-2,0,3,0.9
-1
-2,1.0
-3,0,3,0.9
-1
-3,1.0
-4,0,3,0.9
-1
-4,1.0
-5,0,3,0.9
-1
-5,1.0
-6,0,3,0.9
-1
-6,1.0
-7,0,3,0.9
-1
-7,1.0
-0,0,4,0.1
-1
-0,1.0
-1,0,4,0.1
-1
-1,1.0
-2,0,4,0.1
-4
-2,0.7924058
-3,0.35218036
-4,0.35218036
-5,0.35218036
-3,0,4,0.1
-4
-3,0.79240584
-2,0.3521804
-5,0.3521804
-6,0.3521804
-4,0,4,0.1
-4
-4,0.7088104
-5,0.44628802
-6,0.44628802
-2,0.31502685
-5,0,4,0.1
-4
-5,0.7088104
-4,0.44628802
-7,0.44628802
-2,0.31502685
-6,0,4,0.1
-4
-6,0.7088104
-4,0.44628802
-7,0.44628802
-2,0.31502685
-7,0,4,0.1
-4
-7,0.7088104
-5,0.44628802
-6,0.44628802
-3,0.31502685
-0,0,4,0.3
-1
-0,1.0
-1,0,4,0.3
-1
-1,1.0
-2,0,4,0.3
-4
-2,0.8962582
-3,0.25607374
-4,0.25607374
-5,0.25607374
-3,0,4,0.3
-4
-3,0.8962582
-2,0.25607374
-5,0.25607374
-6,0.25607374
-4,0,4,0.3
-4
-4,0.7831679
-5,0.41023073
-6,0.41023073
-2,0.22376224
-5,0,4,0.3
-4
-5,0.7831679
-4,0.41023073
-7,0.41023073
-2,0.22376224
-6,0,4,0.3
-4
-6,0.7831679
-4,0.41023073
-7,0.41023073
-2,0.22376224
-7,0,4,0.3
-4
-7,0.7831679
-5,0.41023073
-6,0.41023073
-3,0.22376224
-0,0,4,0.5
-1
-0,1.0
-1,0,4,0.5
-1
-1,1.0
-2,0,4,0.5
-1
-2,1.0
-3,0,4,0.5
-1
-3,1.0
-4,0,4,0.5
-3
-4,0.9045341
-5,0.3015113
-6,0.3015113
-5,0,4,0.5
-3
-5,0.9045341
-4,0.3015113
-7,0.3015113
-6,0,4,0.5
-3
-6,0.9045341
-4,0.3015113
-7,0.3015113
-7,0,4,0.5
-3
-7,0.9045341
-5,0.3015113
-6,0.3015113
-0,0,4,0.7
-1
-0,1.0
-1,0,4,0.7
-1
-1,1.0
-2,0,4,0.7
-1
-2,1.0
-3,0,4,0.7
-1
-3,1.0
-4,0,4,0.7
-1
-4,1.0
-5,0,4,0.7
-1
-5,1.0
-6,0,4,0.7
-1
-6,1.0
-7,0,4,0.7
-1
-7,1.0
-0,0,4,0.9
-1
-0,1.0
-1,0,4,0.9
-1
-1,1.0
-2,0,4,0.9
-1
-2,1.0
-3,0,4,0.9
-1
-3,1.0
-4,0,4,0.9
-1
-4,1.0
-5,0,4,0.9
-1
-5,1.0
-6,0,4,0.9
-1
-6,1.0
-7,0,4,0.9
-1
-7,1.0
-0,0,5,0.1
-1
-0,1.0
-1,0,5,0.1
-1
-1,1.0
-2,0,5,0.1
-5
-2,0.7474093
-3,0.33218193
-4,0.33218193
-5,0.33218193
-6,0.33218193
-3,0,5,0.1
-5
-3,0.74740934
-2,0.33218196
-5,0.33218196
-6,0.33218196
-7,0.33218196
-4,0,5,0.1
-5
-4,0.697137
-5,0.4389381
-6,0.4389381
-2,0.30983868
-7,0.18073922
-5,0,5,0.1
-5
-5,0.67605716
-4,0.42566562
-7,0.42566562
-2,0.30046988
-3,0.30046988
-6,0,5,0.1
-5
-6,0.67605716
-4,0.42566562
-7,0.42566562
-2,0.30046988
-3,0.30046988
-7,0,5,0.1
-5
-7,0.697137
-5,0.4389381
-6,0.4389381
-3,0.30983868
-4,0.18073922
-0,0,5,0.3
-1
-0,1.0
-1,0,5,0.3
-1
-1,1.0
-2,0,5,0.3
-5
-2,0.86824316
-3,0.24806947
-4,0.24806947
-5,0.24806947
-6,0.24806947
-3,0,5,0.3
-5
-3,0.8682432
-2,0.24806948
-5,0.24806948
-6,0.24806948
-7,0.24806948
-4,0,5,0.3
-5
-4,0.7826238
-5,0.40994576
-6,0.40994576
-2,0.2236068
-7,0.037267767
-5,0,5,0.3
-5
-5,0.7642683
-4,0.40033093
-7,0.40033093
-2,0.21836235
-3,0.21836235
-6,0,5,0.3
-5
-6,0.7642683
-4,0.40033093
-7,0.40033093
-2,0.21836235
-3,0.21836235
-7,0,5,0.3
-5
-7,0.7826238
-5,0.40994576
-6,0.40994576
-3,0.2236068
-4,0.037267767
-0,0,5,0.5
-1
-0,1.0
-1,0,5,0.5
-1
-1,1.0
-2,0,5,0.5
-1
-2,1.0
-3,0,5,0.5
-1
-3,1.0
-4,0,5,0.5
-3
-4,0.9045341
-5,0.3015113
-6,0.3015113
-5,0,5,0.5
-3
-5,0.9045341
-4,0.3015113
-7,0.3015113
-6,0,5,0.5
-3
-6,0.9045341
-4,0.3015113
-7,0.3015113
-7,0,5,0.5
-3
-7,0.9045341
-5,0.3015113
-6,0.3015113
-0,0,5,0.7
-1
-0,1.0
-1,0,5,0.7
-1
-1,1.0
-2,0,5,0.7
-1
-2,1.0
-3,0,5,0.7
-1
-3,1.0
-4,0,5,0.7
-1
-4,1.0
-5,0,5,0.7
-1
-5,1.0
-6,0,5,0.7
-1
-6,1.0
-7,0,5,0.7
-1
-7,1.0
-0,0,5,0.9
-1
-0,1.0
-1,0,5,0.9
-1
-1,1.0
-2,0,5,0.9
-1
-2,1.0
-3,0,5,0.9
-1
-3,1.0
-4,0,5,0.9
-1
-4,1.0
-5,0,5,0.9
-1
-5,1.0
-6,0,5,0.9
-1
-6,1.0
-7,0,5,0.9
-1
-7,1.0
-0,0,6,0.1
-1
-0,1.0
-1,0,6,0.1
-1
-1,1.0
-2,0,6,0.1
-5
-2,0.7474093
-3,0.33218193
-4,0.33218193
-5,0.33218193
-6,0.33218193
-3,0,6,0.1
-5
-3,0.74740934
-2,0.33218196
-5,0.33218196
-6,0.33218196
-7,0.33218196
-4,0,6,0.1
-5
-4,0.697137
-5,0.4389381
-6,0.4389381
-2,0.30983868
-7,0.18073922
-5,0,6,0.1
-6
-5,0.6659059
-4,0.41927406
-7,0.41927406
-2,0.2959582
-3,0.2959582
-6,0.17264226
-6,0,6,0.1
-6
-6,0.6659059
-4,0.41927406
-7,0.41927406
-2,0.2959582
-3,0.2959582
-5,0.17264226
-7,0,6,0.1
-5
-7,0.697137
-5,0.4389381
-6,0.4389381
-3,0.30983868
-4,0.18073922
-0,0,6,0.3
-1
-0,1.0
-1,0,6,0.3
-1
-1,1.0
-2,0,6,0.3
-5
-2,0.86824316
-3,0.24806947
-4,0.24806947
-5,0.24806947
-6,0.24806947
-3,0,6,0.3
-5
-3,0.8682432
-2,0.24806948
-5,0.24806948
-6,0.24806948
-7,0.24806948
-4,0,6,0.3
-5
-4,0.7826238
-5,0.40994576
-6,0.40994576
-2,0.2236068
-7,0.037267767
-5,0,6,0.3
-6
-5,0.76376265
-4,0.40006608
-7,0.40006608
-2,0.2182179
-3,0.2182179
-6,0.036369618
-6,0,6,0.3
-6
-6,0.76376265
-4,0.40006608
-7,0.40006608
-2,0.2182179
-3,0.2182179
-5,0.036369618
-7,0,6,0.3
-5
-7,0.7826238
-5,0.40994576
-6,0.40994576
-3,0.2236068
-4,0.037267767
-0,0,6,0.5
-1
-0,1.0
-1,0,6,0.5
-1
-1,1.0
-2,0,6,0.5
-1
-2,1.0
-3,0,6,0.5
-1
-3,1.0
-4,0,6,0.5
-3
-4,0.9045341
-5,0.3015113
-6,0.3015113
-5,0,6,0.5
-3
-5,0.9045341
-4,0.3015113
-7,0.3015113
-6,0,6,0.5
-3
-6,0.9045341
-4,0.3015113
-7,0.3015113
-7,0,6,0.5
-3
-7,0.9045341
-5,0.3015113
-6,0.3015113
-0,0,6,0.7
-1
-0,1.0
-1,0,6,0.7
-1
-1,1.0
-2,0,6,0.7
-1
-2,1.0
-3,0,6,0.7
-1
-3,1.0
-4,0,6,0.7
-1
-4,1.0
-5,0,6,0.7
-1
-5,1.0
-6,0,6,0.7
-1
-6,1.0
-7,0,6,0.7
-1
-7,1.0
-0,0,6,0.9
-1
-0,1.0
-1,0,6,0.9
-1
-1,1.0
-2,0,6,0.9
-1
-2,1.0
-3,0,6,0.9
-1
-3,1.0
-4,0,6,0.9
-1
-4,1.0
-5,0,6,0.9
-1
-5,1.0
-6,0,6,0.9
-1
-6,1.0
-7,0,6,0.9
-1
-7,1.0
-0,0,7,0.1
-1
-0,1.0
-1,0,7,0.1
-1
-1,1.0
-2,0,7,0.1
-5
-2,0.7474093
-3,0.33218193
-4,0.33218193
-5,0.33218193
-6,0.33218193
-3,0,7,0.1
-5
-3,0.74740934
-2,0.33218196
-5,0.33218196
-6,0.33218196
-7,0.33218196
-4,0,7,0.1
-5
-4,0.697137
-5,0.4389381
-6,0.4389381
-2,0.30983868
-7,0.18073922
-5,0,7,0.1
-6
-5,0.6659059
-4,0.41927406
-7,0.41927406
-2,0.2959582
-3,0.2959582
-6,0.17264226
-6,0,7,0.1
-6
-6,0.6659059
-4,0.41927406
-7,0.41927406
-2,0.2959582
-3,0.2959582
-5,0.17264226
-7,0,7,0.1
-5
-7,0.697137
-5,0.4389381
-6,0.4389381
-3,0.30983868
-4,0.18073922
-0,0,7,0.3
-1
-0,1.0
-1,0,7,0.3
-1
-1,1.0
-2,0,7,0.3
-5
-2,0.86824316
-3,0.24806947
-4,0.24806947
-5,0.24806947
-6,0.24806947
-3,0,7,0.3
-5
-3,0.8682432
-2,0.24806948
-5,0.24806948
-6,0.24806948
-7,0.24806948
-4,0,7,0.3
-5
-4,0.7826238
-5,0.40994576
-6,0.40994576
-2,0.2236068
-7,0.037267767
-5,0,7,0.3
-6
-5,0.76376265
-4,0.40006608
-7,0.40006608
-2,0.2182179
-3,0.2182179
-6,0.036369618
-6,0,7,0.3
-6
-6,0.76376265
-4,0.40006608
-7,0.40006608
-2,0.2182179
-3,0.2182179
-5,0.036369618
-7,0,7,0.3
-5
-7,0.7826238
-5,0.40994576
-6,0.40994576
-3,0.2236068
-4,0.037267767
-0,0,7,0.5
-1
-0,1.0
-1,0,7,0.5
-1
-1,1.0
-2,0,7,0.5
-1
-2,1.0
-3,0,7,0.5
-1
-3,1.0
-4,0,7,0.5
-3
-4,0.9045341
-5,0.3015113
-6,0.3015113
-5,0,7,0.5
-3
-5,0.9045341
-4,0.3015113
-7,0.3015113
-6,0,7,0.5
-3
-6,0.9045341
-4,0.3015113
-7,0.3015113
-7,0,7,0.5
-3
-7,0.9045341
-5,0.3015113
-6,0.3015113
-0,0,7,0.7
-1
-0,1.0
-1,0,7,0.7
-1
-1,1.0
-2,0,7,0.7
-1
-2,1.0
-3,0,7,0.7
-1
-3,1.0
-4,0,7,0.7
-1
-4,1.0
-5,0,7,0.7
-1
-5,1.0
-6,0,7,0.7
-1
-6,1.0
-7,0,7,0.7
-1
-7,1.0
-0,0,7,0.9
-1
-0,1.0
-1,0,7,0.9
-1
-1,1.0
-2,0,7,0.9
-1
-2,1.0
-3,0,7,0.9
-1
-3,1.0
-4,0,7,0.9
-1
-4,1.0
-5,0,7,0.9
-1
-5,1.0
-6,0,7,0.9
-1
-6,1.0
-7,0,7,0.9
-1
-7,1.0
-0,0,8,0.1
-1
-0,1.0
-1,0,8,0.1
-1
-1,1.0
-2,0,8,0.1
-5
-2,0.7474093
-3,0.33218193
-4,0.33218193
-5,0.33218193
-6,0.33218193
-3,0,8,0.1
-5
-3,0.74740934
-2,0.33218196
-5,0.33218196
-6,0.33218196
-7,0.33218196
-4,0,8,0.1
-5
-4,0.697137
-5,0.4389381
-6,0.4389381
-2,0.30983868
-7,0.18073922
-5,0,8,0.1
-6
-5,0.6659059
-4,0.41927406
-7,0.41927406
-2,0.2959582
-3,0.2959582
-6,0.17264226
-6,0,8,0.1
-6
-6,0.6659059
-4,0.41927406
-7,0.41927406
-2,0.2959582
-3,0.2959582
-5,0.17264226
-7,0,8,0.1
-5
-7,0.697137
-5,0.4389381
-6,0.4389381
-3,0.30983868
-4,0.18073922
-0,0,8,0.3
-1
-0,1.0
-1,0,8,0.3
-1
-1,1.0
-2,0,8,0.3
-5
-2,0.86824316
-3,0.24806947
-4,0.24806947
-5,0.24806947
-6,0.24806947
-3,0,8,0.3
-5
-3,0.8682432
-2,0.24806948
-5,0.24806948
-6,0.24806948
-7,0.24806948
-4,0,8,0.3
-5
-4,0.7826238
-5,0.40994576
-6,0.40994576
-2,0.2236068
-7,0.037267767
-5,0,8,0.3
-6
-5,0.76376265
-4,0.40006608
-7,0.40006608
-2,0.2182179
-3,0.2182179
-6,0.036369618
-6,0,8,0.3
-6
-6,0.76376265
-4,0.40006608
-7,0.40006608
-2,0.2182179
-3,0.2182179
-5,0.036369618
-7,0,8,0.3
-5
-7,0.7826238
-5,0.40994576
-6,0.40994576
-3,0.2236068
-4,0.037267767
-0,0,8,0.5
-1
-0,1.0
-1,0,8,0.5
-1
-1,1.0
-2,0,8,0.5
-1
-2,1.0
-3,0,8,0.5
-1
-3,1.0
-4,0,8,0.5
-3
-4,0.9045341
-5,0.3015113
-6,0.3015113
-5,0,8,0.5
-3
-5,0.9045341
-4,0.3015113
-7,0.3015113
-6,0,8,0.5
-3
-6,0.9045341
-4,0.3015113
-7,0.3015113
-7,0,8,0.5
-3
-7,0.9045341
-5,0.3015113
-6,0.3015113
-0,0,8,0.7
-1
-0,1.0
-1,0,8,0.7
-1
-1,1.0
-2,0,8,0.7
-1
-2,1.0
-3,0,8,0.7
-1
-3,1.0
-4,0,8,0.7
-1
-4,1.0
-5,0,8,0.7
-1
-5,1.0
-6,0,8,0.7
-1
-6,1.0
-7,0,8,0.7
-1
-7,1.0
-0,0,8,0.9
-1
-0,1.0
-1,0,8,0.9
-1
-1,1.0
-2,0,8,0.9
-1
-2,1.0
-3,0,8,0.9
-1
-3,1.0
-4,0,8,0.9
-1
-4,1.0
-5,0,8,0.9
-1
-5,1.0
-6,0,8,0.9
-1
-6,1.0
-7,0,8,0.9
-1
-7,1.0
-0,1,1,0.1
-1
-0,1.0
-1,1,1,0.1
-1
-1,1.0
-2,1,1,0.1
-1
-2,1.0
-3,1,1,0.1
-1
-3,1.0
-4,1,1,0.1
-1
-4,1.0
-5,1,1,0.1
-1
-5,1.0
-6,1,1,0.1
-1
-6,1.0
-7,1,1,0.1
-1
-7,1.0
-0,1,1,0.3
-1
-0,1.0
-1,1,1,0.3
-1
-1,1.0
-2,1,1,0.3
-1
-2,1.0
-3,1,1,0.3
-1
-3,1.0
-4,1,1,0.3
-1
-4,1.0
-5,1,1,0.3
-1
-5,1.0
-6,1,1,0.3
-1
-6,1.0
-7,1,1,0.3
-1
-7,1.0
-0,1,1,0.5
-1
-0,1.0
-1,1,1,0.5
-1
-1,1.0
-2,1,1,0.5
-1
-2,1.0
-3,1,1,0.5
-1
-3,1.0
-4,1,1,0.5
-1
-4,1.0
-5,1,1,0.5
-1
-5,1.0
-6,1,1,0.5
-1
-6,1.0
-7,1,1,0.5
-1
-7,1.0
-0,1,1,0.7
-1
-0,1.0
-1,1,1,0.7
-1
-1,1.0
-2,1,1,0.7
-1
-2,1.0
-3,1,1,0.7
-1
-3,1.0
-4,1,1,0.7
-1
-4,1.0
-5,1,1,0.7
-1
-5,1.0
-6,1,1,0.7
-1
-6,1.0
-7,1,1,0.7
-1
-7,1.0
-0,1,1,0.9
-1
-0,1.0
-1,1,1,0.9
-1
-1,1.0
-2,1,1,0.9
-1
-2,1.0
-3,1,1,0.9
-1
-3,1.0
-4,1,1,0.9
-1
-4,1.0
-5,1,1,0.9
-1
-5,1.0
-6,1,1,0.9
-1
-6,1.0
-7,1,1,0.9
-1
-7,1.0
-0,1,2,0.1
-1
-0,1.0
-1,1,2,0.1
-1
-1,1.0
-2,1,2,0.1
-2
-2,0.91381156
-4,0.4061385
-3,1,2,0.1
-2
-3,0.91381156
-2,0.4061385
-4,1,2,0.1
-2
-4,0.84623283
-5,0.53281325
-5,1,2,0.1
-2
-5,0.84623283
-4,0.53281325
-6,1,2,0.1
-2
-6,0.84623283
-4,0.53281325
-7,1,2,0.1
-2
-7,0.84623283
-5,0.53281325
-0,1,2,0.3
-1
-0,1.0
-1,1,2,0.3
-1
-1,1.0
-2,1,2,0.3
-2
-2,0.96152395
-4,0.27472112
-3,1,2,0.3
-2
-3,0.96152395
-2,0.27472112
-4,1,2,0.3
-2
-4,0.88583153
-5,0.4640069
-5,1,2,0.3
-2
-5,0.88583153
-4,0.4640069
-6,1,2,0.3
-2
-6,0.88583153
-4,0.4640069
-7,1,2,0.3
-2
-7,0.88583153
-5,0.4640069
-0,1,2,0.5
-1
-0,1.0
-1,1,2,0.5
-1
-1,1.0
-2,1,2,0.5
-1
-2,1.0
-3,1,2,0.5
-1
-3,1.0
-4,1,2,0.5
-2
-4,0.9486833
-5,0.3162277
-5,1,2,0.5
-2
-5,0.9486833
-4,0.3162277
-6,1,2,0.5
-2
-6,0.9486833
-4,0.3162277
-7,1,2,0.5
-2
-7,0.9486833
-5,0.3162277
-0,1,2,0.7
-1
-0,1.0
-1,1,2,0.7
-1
-1,1.0
-2,1,2,0.7
-1
-2,1.0
-3,1,2,0.7
-1
-3,1.0
-4,1,2,0.7
-1
-4,1.0
-5,1,2,0.7
-1
-5,1.0
-6,1,2,0.7
-1
-6,1.0
-7,1,2,0.7
-1
-7,1.0
-0,1,2,0.9
-1
-0,1.0
-1,1,2,0.9
-1
-1,1.0
-2,1,2,0.9
-1
-2,1.0
-3,1,2,0.9
-1
-3,1.0
-4,1,2,0.9
-1
-4,1.0
-5,1,2,0.9
-1
-5,1.0
-6,1,2,0.9
-1
-6,1.0
-7,1,2,0.9
-1
-7,1.0
-0,1,3,0.1
-1
-0,1.0
-1,1,3,0.1
-1
-1,1.0
-2,1,3,0.1
-3
-2,0.84664875
-4,0.37628835
-5,0.37628835
-3,1,3,0.1
-3
-3,0.84664875
-2,0.37628835
-5,0.37628835
-4,1,3,0.1
-3
-4,0.74683726
-5,0.47023085
-6,0.47023085
-5,1,3,0.1
-3
-5,0.74683726
-4,0.47023085
-7,0.47023085
-6,1,3,0.1
-3
-6,0.74683726
-4,0.47023085
-7,0.47023085
-7,1,3,0.1
-3
-7,0.74683726
-5,0.47023085
-6,0.47023085
-0,1,3,0.3
-1
-0,1.0
-1,1,3,0.3
-1
-1,1.0
-2,1,3,0.3
-3
-2,0.92717266
-4,0.26490647
-5,0.26490647
-3,1,3,0.3
-3
-3,0.92717266
-2,0.26490647
-5,0.26490647
-4,1,3,0.3
-3
-4,0.8035427
-5,0.42090324
-6,0.42090324
-5,1,3,0.3
-3
-5,0.80354273
-4,0.42090327
-7,0.42090327
-6,1,3,0.3
-3
-6,0.80354273
-4,0.42090327
-7,0.42090327
-7,1,3,0.3
-3
-7,0.8035427
-5,0.42090324
-6,0.42090324
-0,1,3,0.5
-1
-0,1.0
-1,1,3,0.5
-1
-1,1.0
-2,1,3,0.5
-1
-2,1.0
-3,1,3,0.5
-1
-3,1.0
-4,1,3,0.5
-3
-4,0.9045341
-5,0.3015113
-6,0.3015113
-5,1,3,0.5
-3
-5,0.9045341
-4,0.3015113
-7,0.3015113
-6,1,3,0.5
-3
-6,0.9045341
-4,0.3015113
-7,0.3015113
-7,1,3,0.5
-3
-7,0.9045341
-5,0.3015113
-6,0.3015113
-0,1,3,0.7
-1
-0,1.0
-1,1,3,0.7
-1
-1,1.0
-2,1,3,0.7
-1
-2,1.0
-3,1,3,0.7
-1
-3,1.0
-4,1,3,0.7
-1
-4,1.0
-5,1,3,0.7
-1
-5,1.0
-6,1,3,0.7
-1
-6,1.0
-7,1,3,0.7
-1
-7,1.0
-0,1,3,0.9
-1
-0,1.0
-1,1,3,0.9
-1
-1,1.0
-2,1,3,0.9
-1
-2,1.0
-3,1,3,0.9
-1
-3,1.0
-4,1,3,0.9
-1
-4,1.0
-5,1,3,0.9
-1
-5,1.0
-6,1,3,0.9
-1
-6,1.0
-7,1,3,0.9
-1
-7,1.0
-0,1,4,0.1
-1
-0,1.0
-1,1,4,0.1
-1
-1,1.0
-2,1,4,0.1
-4
-2,0.7924058
-3,0.35218036
-4,0.35218036
-5,0.35218036
-3,1,4,0.1
-4
-3,0.79240584
-2,0.3521804
-5,0.3521804
-6,0.3521804
-4,1,4,0.1
-4
-4,0.7088104
-5,0.44628802
-6,0.44628802
-2,0.31502685
-5,1,4,0.1
-4
-5,0.7088104
-4,0.44628802
-7,0.44628802
-2,0.31502685
-6,1,4,0.1
-4
-6,0.7088104
-4,0.44628802
-7,0.44628802
-2,0.31502685
-7,1,4,0.1
-4
-7,0.7088104
-5,0.44628802
-6,0.44628802
-3,0.31502685
-0,1,4,0.3
-1
-0,1.0
-1,1,4,0.3
-1
-1,1.0
-2,1,4,0.3
-4
-2,0.8962582
-3,0.25607374
-4,0.25607374
-5,0.25607374
-3,1,4,0.3
-4
-3,0.8962582
-2,0.25607374
-5,0.25607374
-6,0.25607374
-4,1,4,0.3
-4
-4,0.7831679
-5,0.41023073
-6,0.41023073
-2,0.22376224
-5,1,4,0.3
-4
-5,0.7831679
-4,0.41023073
-7,0.41023073
-2,0.22376224
-6,1,4,0.3
-4
-6,0.7831679
-4,0.41023073
-7,0.41023073
-2,0.22376224
-7,1,4,0.3
-4
-7,0.7831679
-5,0.41023073
-6,0.41023073
-3,0.22376224
-0,1,4,0.5
-1
-0,1.0
-1,1,4,0.5
-1
-1,1.0
-2,1,4,0.5
-1
-2,1.0
-3,1,4,0.5
-1
-3,1.0
-4,1,4,0.5
-3
-4,0.9045341
-5,0.3015113
-6,0.3015113
-5,1,4,0.5
-3
-5,0.9045341
-4,0.3015113
-7,0.3015113
-6,1,4,0.5
-3
-6,0.9045341
-4,0.3015113
-7,0.3015113
-7,1,4,0.5
-3
-7,0.9045341
-5,0.3015113
-6,0.3015113
-0,1,4,0.7
-1
-0,1.0
-1,1,4,0.7
-1
-1,1.0
-2,1,4,0.7
-1
-2,1.0
-3,1,4,0.7
-1
-3,1.0
-4,1,4,0.7
-1
-4,1.0
-5,1,4,0.7
-1
-5,1.0
-6,1,4,0.7
-1
-6,1.0
-7,1,4,0.7
-1
-7,1.0
-0,1,4,0.9
-1
-0,1.0
-1,1,4,0.9
-1
-1,1.0
-2,1,4,0.9
-1
-2,1.0
-3,1,4,0.9
-1
-3,1.0
-4,1,4,0.9
-1
-4,1.0
-5,1,4,0.9
-1
-5,1.0
-6,1,4,0.9
-1
-6,1.0
-7,1,4,0.9
-1
-7,1.0
-0,1,5,0.1
-1
-0,1.0
-1,1,5,0.1
-1
-1,1.0
-2,1,5,0.1
-5
-2,0.7474093
-3,0.33218193
-4,0.33218193
-5,0.33218193
-6,0.33218193
-3,1,5,0.1
-5
-3,0.74740934
-2,0.33218196
-5,0.33218196
-6,0.33218196
-7,0.33218196
-4,1,5,0.1
-5
-4,0.697137
-5,0.4389381
-6,0.4389381
-2,0.30983868
-7,0.18073922
-5,1,5,0.1
-5
-5,0.67605716
-4,0.42566562
-7,0.42566562
-2,0.30046988
-3,0.30046988
-6,1,5,0.1
-5
-6,0.67605716
-4,0.42566562
-7,0.42566562
-2,0.30046988
-3,0.30046988
-7,1,5,0.1
-5
-7,0.697137
-5,0.4389381
-6,0.4389381
-3,0.30983868
-4,0.18073922
-0,1,5,0.3
-1
-0,1.0
-1,1,5,0.3
-1
-1,1.0
-2,1,5,0.3
-5
-2,0.86824316
-3,0.24806947
-4,0.24806947
-5,0.24806947
-6,0.24806947
-3,1,5,0.3
-5
-3,0.8682432
-2,0.24806948
-5,0.24806948
-6,0.24806948
-7,0.24806948
-4,1,5,0.3
-5
-4,0.7826238
-5,0.40994576
-6,0.40994576
-2,0.2236068
-7,0.037267767
-5,1,5,0.3
-5
-5,0.7642683
-4,0.40033093
-7,0.40033093
-2,0.21836235
-3,0.21836235
-6,1,5,0.3
-5
-6,0.7642683
-4,0.40033093
-7,0.40033093
-2,0.21836235
-3,0.21836235
-7,1,5,0.3
-5
-7,0.7826238
-5,0.40994576
-6,0.40994576
-3,0.2236068
-4,0.037267767
-0,1,5,0.5
-1
-0,1.0
-1,1,5,0.5
-1
-1,1.0
-2,1,5,0.5
-1
-2,1.0
-3,1,5,0.5
-1
-3,1.0
-4,1,5,0.5
-3
-4,0.9045341
-5,0.3015113
-6,0.3015113
-5,1,5,0.5
-3
-5,0.9045341
-4,0.3015113
-7,0.3015113
-6,1,5,0.5
-3
-6,0.9045341
-4,0.3015113
-7,0.3015113
-7,1,5,0.5
-3
-7,0.9045341
-5,0.3015113
-6,0.3015113
-0,1,5,0.7
-1
-0,1.0
-1,1,5,0.7
-1
-1,1.0
-2,1,5,0.7
-1
-2,1.0
-3,1,5,0.7
-1
-3,1.0
-4,1,5,0.7
-1
-4,1.0
-5,1,5,0.7
-1
-5,1.0
-6,1,5,0.7
-1
-6,1.0
-7,1,5,0.7
-1
-7,1.0
-0,1,5,0.9
-1
-0,1.0
-1,1,5,0.9
-1
-1,1.0
-2,1,5,0.9
-1
-2,1.0
-3,1,5,0.9
-1
-3,1.0
-4,1,5,0.9
-1
-4,1.0
-5,1,5,0.9
-1
-5,1.0
-6,1,5,0.9
-1
-6,1.0
-7,1,5,0.9
-1
-7,1.0
-0,1,6,0.1
-1
-0,1.0
-1,1,6,0.1
-1
-1,1.0
-2,1,6,0.1
-5
-2,0.7474093
-3,0.33218193
-4,0.33218193
-5,0.33218193
-6,0.33218193
-3,1,6,0.1
-5
-3,0.74740934
-2,0.33218196
-5,0.33218196
-6,0.33218196
-7,0.33218196
-4,1,6,0.1
-5
-4,0.697137
-5,0.4389381
-6,0.4389381
-2,0.30983868
-7,0.18073922
-5,1,6,0.1
-6
-5,0.6659059
-4,0.41927406
-7,0.41927406
-2,0.2959582
-3,0.2959582
-6,0.17264226
-6,1,6,0.1
-6
-6,0.6659059
-4,0.41927406
-7,0.41927406
-2,0.2959582
-3,0.2959582
-5,0.17264226
-7,1,6,0.1
-5
-7,0.697137
-5,0.4389381
-6,0.4389381
-3,0.30983868
-4,0.18073922
-0,1,6,0.3
-1
-0,1.0
-1,1,6,0.3
-1
-1,1.0
-2,1,6,0.3
-5
-2,0.86824316
-3,0.24806947
-4,0.24806947
-5,0.24806947
-6,0.24806947
-3,1,6,0.3
-5
-3,0.8682432
-2,0.24806948
-5,0.24806948
-6,0.24806948
-7,0.24806948
-4,1,6,0.3
-5
-4,0.7826238
-5,0.40994576
-6,0.40994576
-2,0.2236068
-7,0.037267767
-5,1,6,0.3
-6
-5,0.76376265
-4,0.40006608
-7,0.40006608
-2,0.2182179
-3,0.2182179
-6,0.036369618
-6,1,6,0.3
-6
-6,0.76376265
-4,0.40006608
-7,0.40006608
-2,0.2182179
-3,0.2182179
-5,0.036369618
-7,1,6,0.3
-5
-7,0.7826238
-5,0.40994576
-6,0.40994576
-3,0.2236068
-4,0.037267767
-0,1,6,0.5
-1
-0,1.0
-1,1,6,0.5
-1
-1,1.0
-2,1,6,0.5
-1
-2,1.0
-3,1,6,0.5
-1
-3,1.0
-4,1,6,0.5
-3
-4,0.9045341
-5,0.3015113
-6,0.3015113
-5,1,6,0.5
-3
-5,0.9045341
-4,0.3015113
-7,0.3015113
-6,1,6,0.5
-3
-6,0.9045341
-4,0.3015113
-7,0.3015113
-7,1,6,0.5
-3
-7,0.9045341
-5,0.3015113
-6,0.3015113
-0,1,6,0.7
-1
-0,1.0
-1,1,6,0.7
-1
-1,1.0
-2,1,6,0.7
-1
-2,1.0
-3,1,6,0.7
-1
-3,1.0
-4,1,6,0.7
-1
-4,1.0
-5,1,6,0.7
-1
-5,1.0
-6,1,6,0.7
-1
-6,1.0
-7,1,6,0.7
-1
-7,1.0
-0,1,6,0.9
-1
-0,1.0
-1,1,6,0.9
-1
-1,1.0
-2,1,6,0.9
-1
-2,1.0
-3,1,6,0.9
-1
-3,1.0
-4,1,6,0.9
-1
-4,1.0
-5,1,6,0.9
-1
-5,1.0
-6,1,6,0.9
-1
-6,1.0
-7,1,6,0.9
-1
-7,1.0
-0,1,7,0.1
-1
-0,1.0
-1,1,7,0.1
-1
-1,1.0
-2,1,7,0.1
-5
-2,0.7474093
-3,0.33218193
-4,0.33218193
-5,0.33218193
-6,0.33218193
-3,1,7,0.1
-5
-3,0.74740934
-2,0.33218196
-5,0.33218196
-6,0.33218196
-7,0.33218196
-4,1,7,0.1
-5
-4,0.697137
-5,0.4389381
-6,0.4389381
-2,0.30983868
-7,0.18073922
-5,1,7,0.1
-6
-5,0.6659059
-4,0.41927406
-7,0.41927406
-2,0.2959582
-3,0.2959582
-6,0.17264226
-6,1,7,0.1
-6
-6,0.6659059
-4,0.41927406
-7,0.41927406
-2,0.2959582
-3,0.2959582
-5,0.17264226
-7,1,7,0.1
-5
-7,0.697137
-5,0.4389381
-6,0.4389381
-3,0.30983868
-4,0.18073922
-0,1,7,0.3
-1
-0,1.0
-1,1,7,0.3
-1
-1,1.0
-2,1,7,0.3
-5
-2,0.86824316
-3,0.24806947
-4,0.24806947
-5,0.24806947
-6,0.24806947
-3,1,7,0.3
-5
-3,0.8682432
-2,0.24806948
-5,0.24806948
-6,0.24806948
-7,0.24806948
-4,1,7,0.3
-5
-4,0.7826238
-5,0.40994576
-6,0.40994576
-2,0.2236068
-7,0.037267767
-5,1,7,0.3
-6
-5,0.76376265
-4,0.40006608
-7,0.40006608
-2,0.2182179
-3,0.2182179
-6,0.036369618
-6,1,7,0.3
-6
-6,0.76376265
-4,0.40006608
-7,0.40006608
-2,0.2182179
-3,0.2182179
-5,0.036369618
-7,1,7,0.3
-5
-7,0.7826238
-5,0.40994576
-6,0.40994576
-3,0.2236068
-4,0.037267767
-0,1,7,0.5
-1
-0,1.0
-1,1,7,0.5
-1
-1,1.0
-2,1,7,0.5
-1
-2,1.0
-3,1,7,0.5
-1
-3,1.0
-4,1,7,0.5
-3
-4,0.9045341
-5,0.3015113
-6,0.3015113
-5,1,7,0.5
-3
-5,0.9045341
-4,0.3015113
-7,0.3015113
-6,1,7,0.5
-3
-6,0.9045341
-4,0.3015113
-7,0.3015113
-7,1,7,0.5
-3
-7,0.9045341
-5,0.3015113
-6,0.3015113
-0,1,7,0.7
-1
-0,1.0
-1,1,7,0.7
-1
-1,1.0
-2,1,7,0.7
-1
-2,1.0
-3,1,7,0.7
-1
-3,1.0
-4,1,7,0.7
-1
-4,1.0
-5,1,7,0.7
-1
-5,1.0
-6,1,7,0.7
-1
-6,1.0
-7,1,7,0.7
-1
-7,1.0
-0,1,7,0.9
-1
-0,1.0
-1,1,7,0.9
-1
-1,1.0
-2,1,7,0.9
-1
-2,1.0
-3,1,7,0.9
-1
-3,1.0
-4,1,7,0.9
-1
-4,1.0
-5,1,7,0.9
-1
-5,1.0
-6,1,7,0.9
-1
-6,1.0
-7,1,7,0.9
-1
-7,1.0
-0,1,8,0.1
-1
-0,1.0
-1,1,8,0.1
-1
-1,1.0
-2,1,8,0.1
-5
-2,0.7474093
-3,0.33218193
-4,0.33218193
-5,0.33218193
-6,0.33218193
-3,1,8,0.1
-5
-3,0.74740934
-2,0.33218196
-5,0.33218196
-6,0.33218196
-7,0.33218196
-4,1,8,0.1
-5
-4,0.697137
-5,0.4389381
-6,0.4389381
-2,0.30983868
-7,0.18073922
-5,1,8,0.1
-6
-5,0.6659059
-4,0.41927406
-7,0.41927406
-2,0.2959582
-3,0.2959582
-6,0.17264226
-6,1,8,0.1
-6
-6,0.6659059
-4,0.41927406
-7,0.41927406
-2,0.2959582
-3,0.2959582
-5,0.17264226
-7,1,8,0.1
-5
-7,0.697137
-5,0.4389381
-6,0.4389381
-3,0.30983868
-4,0.18073922
-0,1,8,0.3
-1
-0,1.0
-1,1,8,0.3
-1
-1,1.0
-2,1,8,0.3
-5
-2,0.86824316
-3,0.24806947
-4,0.24806947
-5,0.24806947
-6,0.24806947
-3,1,8,0.3
-5
-3,0.8682432
-2,0.24806948
-5,0.24806948
-6,0.24806948
-7,0.24806948
-4,1,8,0.3
-5
-4,0.7826238
-5,0.40994576
-6,0.40994576
-2,0.2236068
-7,0.037267767
-5,1,8,0.3
-6
-5,0.76376265
-4,0.40006608
-7,0.40006608
-2,0.2182179
-3,0.2182179
-6,0.036369618
-6,1,8,0.3
-6
-6,0.76376265
-4,0.40006608
-7,0.40006608
-2,0.2182179
-3,0.2182179
-5,0.036369618
-7,1,8,0.3
-5
-7,0.7826238
-5,0.40994576
-6,0.40994576
-3,0.2236068
-4,0.037267767
-0,1,8,0.5
-1
-0,1.0
-1,1,8,0.5
-1
-1,1.0
-2,1,8,0.5
-1
-2,1.0
-3,1,8,0.5
-1
-3,1.0
-4,1,8,0.5
-3
-4,0.9045341
-5,0.3015113
-6,0.3015113
-5,1,8,0.5
-3
-5,0.9045341
-4,0.3015113
-7,0.3015113
-6,1,8,0.5
-3
-6,0.9045341
-4,0.3015113
-7,0.3015113
-7,1,8,0.5
-3
-7,0.9045341
-5,0.3015113
-6,0.3015113
-0,1,8,0.7
-1
-0,1.0
-1,1,8,0.7
-1
-1,1.0
-2,1,8,0.7
-1
-2,1.0
-3,1,8,0.7
-1
-3,1.0
-4,1,8,0.7
-1
-4,1.0
-5,1,8,0.7
-1
-5,1.0
-6,1,8,0.7
-1
-6,1.0
-7,1,8,0.7
-1
-7,1.0
-0,1,8,0.9
-1
-0,1.0
-1,1,8,0.9
-1
-1,1.0
-2,1,8,0.9
-1
-2,1.0
-3,1,8,0.9
-1
-3,1.0
-4,1,8,0.9
-1
-4,1.0
-5,1,8,0.9
-1
-5,1.0
-6,1,8,0.9
-1
-6,1.0
-7,1,8,0.9
-1
-7,1.0
-0,2,1,0.1
-1
-0,1.0
-1,2,1,0.1
-1
-1,1.0
-2,2,1,0.1
-1
-2,1.0
-3,2,1,0.1
-1
-3,1.0
-4,2,1,0.1
-1
-4,1.0
-5,2,1,0.1
-1
-5,1.0
-6,2,1,0.1
-1
-6,1.0
-7,2,1,0.1
-1
-7,1.0
-0,2,1,0.3
-1
-0,1.0
-1,2,1,0.3
-1
-1,1.0
-2,2,1,0.3
-1
-2,1.0
-3,2,1,0.3
-1
-3,1.0
-4,2,1,0.3
-1
-4,1.0
-5,2,1,0.3
-1
-5,1.0
-6,2,1,0.3
-1
-6,1.0
-7,2,1,0.3
-1
-7,1.0
-0,2,1,0.5
-1
-0,1.0
-1,2,1,0.5
-1
-1,1.0
-2,2,1,0.5
-1
-2,1.0
-3,2,1,0.5
-1
-3,1.0
-4,2,1,0.5
-1
-4,1.0
-5,2,1,0.5
-1
-5,1.0
-6,2,1,0.5
-1
-6,1.0
-7,2,1,0.5
-1
-7,1.0
-0,2,1,0.7
-1
-0,1.0
-1,2,1,0.7
-1
-1,1.0
-2,2,1,0.7
-1
-2,1.0
-3,2,1,0.7
-1
-3,1.0
-4,2,1,0.7
-1
-4,1.0
-5,2,1,0.7
-1
-5,1.0
-6,2,1,0.7
-1
-6,1.0
-7,2,1,0.7
-1
-7,1.0
-0,2,1,0.9
-1
-0,1.0
-1,2,1,0.9
-1
-1,1.0
-2,2,1,0.9
-1
-2,1.0
-3,2,1,0.9
-1
-3,1.0
-4,2,1,0.9
-1
-4,1.0
-5,2,1,0.9
-1
-5,1.0
-6,2,1,0.9
-1
-6,1.0
-7,2,1,0.9
-1
-7,1.0
-0,2,2,0.1
-1
-0,1.0
-1,2,2,0.1
-1
-1,1.0
-2,2,2,0.1
-2
-2,0.91381156
-4,0.4061385
-3,2,2,0.1
-2
-3,0.91381156
-6,0.4061385
-4,2,2,0.1
-2
-4,0.84623283
-5,0.53281325
-5,2,2,0.1
-2
-5,0.84623283
-4,0.53281325
-6,2,2,0.1
-2
-6,0.84623283
-7,0.53281325
-7,2,2,0.1
-2
-7,0.84623283
-6,0.53281325
-0,2,2,0.3
-1
-0,1.0
-1,2,2,0.3
-1
-1,1.0
-2,2,2,0.3
-2
-2,0.96152395
-4,0.27472112
-3,2,2,0.3
-2
-3,0.96152395
-6,0.27472112
-4,2,2,0.3
-2
-4,0.88583153
-5,0.4640069
-5,2,2,0.3
-2
-5,0.88583153
-4,0.4640069
-6,2,2,0.3
-2
-6,0.88583153
-7,0.4640069
-7,2,2,0.3
-2
-7,0.88583153
-6,0.4640069
-0,2,2,0.5
-1
-0,1.0
-1,2,2,0.5
-1
-1,1.0
-2,2,2,0.5
-1
-2,1.0
-3,2,2,0.5
-1
-3,1.0
-4,2,2,0.5
-2
-4,0.9486833
-5,0.3162277
-5,2,2,0.5
-2
-5,0.9486833
-4,0.3162277
-6,2,2,0.5
-2
-6,0.9486833
-7,0.3162277
-7,2,2,0.5
-2
-7,0.9486833
-6,0.3162277
-0,2,2,0.7
-1
-0,1.0
-1,2,2,0.7
-1
-1,1.0
-2,2,2,0.7
-1
-2,1.0
-3,2,2,0.7
-1
-3,1.0
-4,2,2,0.7
-1
-4,1.0
-5,2,2,0.7
-1
-5,1.0
-6,2,2,0.7
-1
-6,1.0
-7,2,2,0.7
-1
-7,1.0
-0,2,2,0.9
-1
-0,1.0
-1,2,2,0.9
-1
-1,1.0
-2,2,2,0.9
-1
-2,1.0
-3,2,2,0.9
-1
-3,1.0
-4,2,2,0.9
-1
-4,1.0
-5,2,2,0.9
-1
-5,1.0
-6,2,2,0.9
-1
-6,1.0
-7,2,2,0.9
-1
-7,1.0
-0,2,3,0.1
-1
-0,1.0
-1,2,3,0.1
-1
-1,1.0
-2,2,3,0.1
-3
-2,0.84664875
-4,0.37628835
-5,0.37628835
-3,2,3,0.1
-3
-3,0.84664875
-6,0.37628835
-7,0.37628835
-4,2,3,0.1
-3
-4,0.7920648
-5,0.49870744
-2,0.35202882
-5,2,3,0.1
-3
-5,0.7920648
-4,0.49870744
-2,0.35202882
-6,2,3,0.1
-3
-6,0.7920648
-7,0.49870744
-3,0.35202882
-7,2,3,0.1
-3
-7,0.7920648
-6,0.49870744
-3,0.35202882
-0,2,3,0.3
-1
-0,1.0
-1,2,3,0.3
-1
-1,1.0
-2,2,3,0.3
-3
-2,0.92717266
-4,0.26490647
-5,0.26490647
-3,2,3,0.3
-3
-3,0.92717266
-6,0.26490647
-7,0.26490647
-4,2,3,0.3
-3
-4,0.85875386
-5,0.44982338
-2,0.24535823
-5,2,3,0.3
-3
-5,0.85875386
-4,0.44982338
-2,0.24535823
-6,2,3,0.3
-3
-6,0.85875386
-7,0.44982338
-3,0.24535823
-7,2,3,0.3
-3
-7,0.85875386
-6,0.44982338
-3,0.24535823
-0,2,3,0.5
-1
-0,1.0
-1,2,3,0.5
-1
-1,1.0
-2,2,3,0.5
-1
-2,1.0
-3,2,3,0.5
-1
-3,1.0
-4,2,3,0.5
-2
-4,0.9486833
-5,0.3162277
-5,2,3,0.5
-2
-5,0.9486833
-4,0.3162277
-6,2,3,0.5
-2
-6,0.9486833
-7,0.3162277
-7,2,3,0.5
-2
-7,0.9486833
-6,0.3162277
-0,2,3,0.7
-1
-0,1.0
-1,2,3,0.7
-1
-1,1.0
-2,2,3,0.7
-1
-2,1.0
-3,2,3,0.7
-1
-3,1.0
-4,2,3,0.7
-1
-4,1.0
-5,2,3,0.7
-1
-5,1.0
-6,2,3,0.7
-1
-6,1.0
-7,2,3,0.7
-1
-7,1.0
-0,2,3,0.9
-1
-0,1.0
-1,2,3,0.9
-1
-1,1.0
-2,2,3,0.9
-1
-2,1.0
-3,2,3,0.9
-1
-3,1.0
-4,2,3,0.9
-1
-4,1.0
-5,2,3,0.9
-1
-5,1.0
-6,2,3,0.9
-1
-6,1.0
-7,2,3,0.9
-1
-7,1.0
-0,2,4,0.1
-1
-0,1.0
-1,2,4,0.1
-1
-1,1.0
-2,2,4,0.1
-3
-2,0.84664875
-4,0.37628835
-5,0.37628835
-3,2,4,0.1
-3
-3,0.84664875
-6,0.37628835
-7,0.37628835
-4,2,4,0.1
-3
-4,0.7920648
-5,0.49870744
-2,0.35202882
-5,2,4,0.1
-3
-5,0.7920648
-4,0.49870744
-2,0.35202882
-6,2,4,0.1
-3
-6,0.7920648
-7,0.49870744
-3,0.35202882
-7,2,4,0.1
-3
-7,0.7920648
-6,0.49870744
-3,0.35202882
-0,2,4,0.3
-1
-0,1.0
-1,2,4,0.3
-1
-1,1.0
-2,2,4,0.3
-3
-2,0.92717266
-4,0.26490647
-5,0.26490647
-3,2,4,0.3
-3
-3,0.92717266
-6,0.26490647
-7,0.26490647
-4,2,4,0.3
-3
-4,0.85875386
-5,0.44982338
-2,0.24535823
-5,2,4,0.3
-3
-5,0.85875386
-4,0.44982338
-2,0.24535823
-6,2,4,0.3
-3
-6,0.85875386
-7,0.44982338
-3,0.24535823
-7,2,4,0.3
-3
-7,0.85875386
-6,0.44982338
-3,0.24535823
-0,2,4,0.5
-1
-0,1.0
-1,2,4,0.5
-1
-1,1.0
-2,2,4,0.5
-1
-2,1.0
-3,2,4,0.5
-1
-3,1.0
-4,2,4,0.5
-2
-4,0.9486833
-5,0.3162277
-5,2,4,0.5
-2
-5,0.9486833
-4,0.3162277
-6,2,4,0.5
-2
-6,0.9486833
-7,0.3162277
-7,2,4,0.5
-2
-7,0.9486833
-6,0.3162277
-0,2,4,0.7
-1
-0,1.0
-1,2,4,0.7
-1
-1,1.0
-2,2,4,0.7
-1
-2,1.0
-3,2,4,0.7
-1
-3,1.0
-4,2,4,0.7
-1
-4,1.0
-5,2,4,0.7
-1
-5,1.0
-6,2,4,0.7
-1
-6,1.0
-7,2,4,0.7
-1
-7,1.0
-0,2,4,0.9
-1
-0,1.0
-1,2,4,0.9
-1
-1,1.0
-2,2,4,0.9
-1
-2,1.0
-3,2,4,0.9
-1
-3,1.0
-4,2,4,0.9
-1
-4,1.0
-5,2,4,0.9
-1
-5,1.0
-6,2,4,0.9
-1
-6,1.0
-7,2,4,0.9
-1
-7,1.0
-0,2,5,0.1
-1
-0,1.0
-1,2,5,0.1
-1
-1,1.0
-2,2,5,0.1
-3
-2,0.84664875
-4,0.37628835
-5,0.37628835
-3,2,5,0.1
-3
-3,0.84664875
-6,0.37628835
-7,0.37628835
-4,2,5,0.1
-3
-4,0.7920648
-5,0.49870744
-2,0.35202882
-5,2,5,0.1
-3
-5,0.7920648
-4,0.49870744
-2,0.35202882
-6,2,5,0.1
-3
-6,0.7920648
-7,0.49870744
-3,0.35202882
-7,2,5,0.1
-3
-7,0.7920648
-6,0.49870744
-3,0.35202882
-0,2,5,0.3
-1
-0,1.0
-1,2,5,0.3
-1
-1,1.0
-2,2,5,0.3
-3
-2,0.92717266
-4,0.26490647
-5,0.26490647
-3,2,5,0.3
-3
-3,0.92717266
-6,0.26490647
-7,0.26490647
-4,2,5,0.3
-3
-4,0.85875386
-5,0.44982338
-2,0.24535823
-5,2,5,0.3
-3
-5,0.85875386
-4,0.44982338
-2,0.24535823
-6,2,5,0.3
-3
-6,0.85875386
-7,0.44982338
-3,0.24535823
-7,2,5,0.3
-3
-7,0.85875386
-6,0.44982338
-3,0.24535823
-0,2,5,0.5
-1
-0,1.0
-1,2,5,0.5
-1
-1,1.0
-2,2,5,0.5
-1
-2,1.0
-3,2,5,0.5
-1
-3,1.0
-4,2,5,0.5
-2
-4,0.9486833
-5,0.3162277
-5,2,5,0.5
-2
-5,0.9486833
-4,0.3162277
-6,2,5,0.5
-2
-6,0.9486833
-7,0.3162277
-7,2,5,0.5
-2
-7,0.9486833
-6,0.3162277
-0,2,5,0.7
-1
-0,1.0
-1,2,5,0.7
-1
-1,1.0
-2,2,5,0.7
-1
-2,1.0
-3,2,5,0.7
-1
-3,1.0
-4,2,5,0.7
-1
-4,1.0
-5,2,5,0.7
-1
-5,1.0
-6,2,5,0.7
-1
-6,1.0
-7,2,5,0.7
-1
-7,1.0
-0,2,5,0.9
-1
-0,1.0
-1,2,5,0.9
-1
-1,1.0
-2,2,5,0.9
-1
-2,1.0
-3,2,5,0.9
-1
-3,1.0
-4,2,5,0.9
-1
-4,1.0
-5,2,5,0.9
-1
-5,1.0
-6,2,5,0.9
-1
-6,1.0
-7,2,5,0.9
-1
-7,1.0
-0,2,6,0.1
-1
-0,1.0
-1,2,6,0.1
-1
-1,1.0
-2,2,6,0.1
-3
-2,0.84664875
-4,0.37628835
-5,0.37628835
-3,2,6,0.1
-3
-3,0.84664875
-6,0.37628835
-7,0.37628835
-4,2,6,0.1
-3
-4,0.7920648
-5,0.49870744
-2,0.35202882
-5,2,6,0.1
-3
-5,0.7920648
-4,0.49870744
-2,0.35202882
-6,2,6,0.1
-3
-6,0.7920648
-7,0.49870744
-3,0.35202882
-7,2,6,0.1
-3
-7,0.7920648
-6,0.49870744
-3,0.35202882
-0,2,6,0.3
-1
-0,1.0
-1,2,6,0.3
-1
-1,1.0
-2,2,6,0.3
-3
-2,0.92717266
-4,0.26490647
-5,0.26490647
-3,2,6,0.3
-3
-3,0.92717266
-6,0.26490647
-7,0.26490647
-4,2,6,0.3
-3
-4,0.85875386
-5,0.44982338
-2,0.24535823
-5,2,6,0.3
-3
-5,0.85875386
-4,0.44982338
-2,0.24535823
-6,2,6,0.3
-3
-6,0.85875386
-7,0.44982338
-3,0.24535823
-7,2,6,0.3
-3
-7,0.85875386
-6,0.44982338
-3,0.24535823
-0,2,6,0.5
-1
-0,1.0
-1,2,6,0.5
-1
-1,1.0
-2,2,6,0.5
-1
-2,1.0
-3,2,6,0.5
-1
-3,1.0
-4,2,6,0.5
-2
-4,0.9486833
-5,0.3162277
-5,2,6,0.5
-2
-5,0.9486833
-4,0.3162277
-6,2,6,0.5
-2
-6,0.9486833
-7,0.3162277
-7,2,6,0.5
-2
-7,0.9486833
-6,0.3162277
-0,2,6,0.7
-1
-0,1.0
-1,2,6,0.7
-1
-1,1.0
-2,2,6,0.7
-1
-2,1.0
-3,2,6,0.7
-1
-3,1.0
-4,2,6,0.7
-1
-4,1.0
-5,2,6,0.7
-1
-5,1.0
-6,2,6,0.7
-1
-6,1.0
-7,2,6,0.7
-1
-7,1.0
-0,2,6,0.9
-1
-0,1.0
-1,2,6,0.9
-1
-1,1.0
-2,2,6,0.9
-1
-2,1.0
-3,2,6,0.9
-1
-3,1.0
-4,2,6,0.9
-1
-4,1.0
-5,2,6,0.9
-1
-5,1.0
-6,2,6,0.9
-1
-6,1.0
-7,2,6,0.9
-1
-7,1.0
-0,2,7,0.1
-1
-0,1.0
-1,2,7,0.1
-1
-1,1.0
-2,2,7,0.1
-3
-2,0.84664875
-4,0.37628835
-5,0.37628835
-3,2,7,0.1
-3
-3,0.84664875
-6,0.37628835
-7,0.37628835
-4,2,7,0.1
-3
-4,0.7920648
-5,0.49870744
-2,0.35202882
-5,2,7,0.1
-3
-5,0.7920648
-4,0.49870744
-2,0.35202882
-6,2,7,0.1
-3
-6,0.7920648
-7,0.49870744
-3,0.35202882
-7,2,7,0.1
-3
-7,0.7920648
-6,0.49870744
-3,0.35202882
-0,2,7,0.3
-1
-0,1.0
-1,2,7,0.3
-1
-1,1.0
-2,2,7,0.3
-3
-2,0.92717266
-4,0.26490647
-5,0.26490647
-3,2,7,0.3
-3
-3,0.92717266
-6,0.26490647
-7,0.26490647
-4,2,7,0.3
-3
-4,0.85875386
-5,0.44982338
-2,0.24535823
-5,2,7,0.3
-3
-5,0.85875386
-4,0.44982338
-2,0.24535823
-6,2,7,0.3
-3
-6,0.85875386
-7,0.44982338
-3,0.24535823
-7,2,7,0.3
-3
-7,0.85875386
-6,0.44982338
-3,0.24535823
-0,2,7,0.5
-1
-0,1.0
-1,2,7,0.5
-1
-1,1.0
-2,2,7,0.5
-1
-2,1.0
-3,2,7,0.5
-1
-3,1.0
-4,2,7,0.5
-2
-4,0.9486833
-5,0.3162277
-5,2,7,0.5
-2
-5,0.9486833
-4,0.3162277
-6,2,7,0.5
-2
-6,0.9486833
-7,0.3162277
-7,2,7,0.5
-2
-7,0.9486833
-6,0.3162277
-0,2,7,0.7
-1
-0,1.0
-1,2,7,0.7
-1
-1,1.0
-2,2,7,0.7
-1
-2,1.0
-3,2,7,0.7
-1
-3,1.0
-4,2,7,0.7
-1
-4,1.0
-5,2,7,0.7
-1
-5,1.0
-6,2,7,0.7
-1
-6,1.0
-7,2,7,0.7
-1
-7,1.0
-0,2,7,0.9
-1
-0,1.0
-1,2,7,0.9
-1
-1,1.0
-2,2,7,0.9
-1
-2,1.0
-3,2,7,0.9
-1
-3,1.0
-4,2,7,0.9
-1
-4,1.0
-5,2,7,0.9
-1
-5,1.0
-6,2,7,0.9
-1
-6,1.0
-7,2,7,0.9
-1
-7,1.0
-0,2,8,0.1
-1
-0,1.0
-1,2,8,0.1
-1
-1,1.0
-2,2,8,0.1
-3
-2,0.84664875
-4,0.37628835
-5,0.37628835
-3,2,8,0.1
-3
-3,0.84664875
-6,0.37628835
-7,0.37628835
-4,2,8,0.1
-3
-4,0.7920648
-5,0.49870744
-2,0.35202882
-5,2,8,0.1
-3
-5,0.7920648
-4,0.49870744
-2,0.35202882
-6,2,8,0.1
-3
-6,0.7920648
-7,0.49870744
-3,0.35202882
-7,2,8,0.1
-3
-7,0.7920648
-6,0.49870744
-3,0.35202882
-0,2,8,0.3
-1
-0,1.0
-1,2,8,0.3
-1
-1,1.0
-2,2,8,0.3
-3
-2,0.92717266
-4,0.26490647
-5,0.26490647
-3,2,8,0.3
-3
-3,0.92717266
-6,0.26490647
-7,0.26490647
-4,2,8,0.3
-3
-4,0.85875386
-5,0.44982338
-2,0.24535823
-5,2,8,0.3
-3
-5,0.85875386
-4,0.44982338
-2,0.24535823
-6,2,8,0.3
-3
-6,0.85875386
-7,0.44982338
-3,0.24535823
-7,2,8,0.3
-3
-7,0.85875386
-6,0.44982338
-3,0.24535823
-0,2,8,0.5
-1
-0,1.0
-1,2,8,0.5
-1
-1,1.0
-2,2,8,0.5
-1
-2,1.0
-3,2,8,0.5
-1
-3,1.0
-4,2,8,0.5
-2
-4,0.9486833
-5,0.3162277
-5,2,8,0.5
-2
-5,0.9486833
-4,0.3162277
-6,2,8,0.5
-2
-6,0.9486833
-7,0.3162277
-7,2,8,0.5
-2
-7,0.9486833
-6,0.3162277
-0,2,8,0.7
-1
-0,1.0
-1,2,8,0.7
-1
-1,1.0
-2,2,8,0.7
-1
-2,1.0
-3,2,8,0.7
-1
-3,1.0
-4,2,8,0.7
-1
-4,1.0
-5,2,8,0.7
-1
-5,1.0
-6,2,8,0.7
-1
-6,1.0
-7,2,8,0.7
-1
-7,1.0
-0,2,8,0.9
-1
-0,1.0
-1,2,8,0.9
-1
-1,1.0
-2,2,8,0.9
-1
-2,1.0
-3,2,8,0.9
-1
-3,1.0
-4,2,8,0.9
-1
-4,1.0
-5,2,8,0.9
-1
-5,1.0
-6,2,8,0.9
-1
-6,1.0
-7,2,8,0.9
-1
-7,1.0
Index: lucene/core/src/test/org/apache/lucene/search/spans/TestSpanMultiTermQueryWrapper.java
===================================================================
--- lucene/core/src/test/org/apache/lucene/search/spans/TestSpanMultiTermQueryWrapper.java	(revision 1332803)
+++ lucene/core/src/test/org/apache/lucene/search/spans/TestSpanMultiTermQueryWrapper.java	(working copy)
@@ -90,7 +90,7 @@
   
   public void testFuzzy2() throws Exception {
     // maximum of 1 term expansion
-    FuzzyQuery fq = new FuzzyQuery(new Term("field", "broan"), 1f, 0, 1);
+    FuzzyQuery fq = new FuzzyQuery(new Term("field", "broan"), 1, 0, 1, false);
     SpanQuery sfq = new SpanMultiTermQueryWrapper<FuzzyQuery>(fq);
     // will only match jumps over lazy broun dog
     SpanPositionRangeQuery sprq = new SpanPositionRangeQuery(sfq, 0, 100);
Index: lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java
===================================================================
--- lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java	(revision 1332803)
+++ lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java	(working copy)
@@ -52,32 +52,32 @@
     IndexSearcher searcher = newSearcher(reader);
     writer.close();
 
-    FuzzyQuery query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMinSimilarity, 0);   
+    FuzzyQuery query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMaxEdits, 0);   
     ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(3, hits.length);
     
     // same with prefix
-    query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMinSimilarity, 1);   
+    query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMaxEdits, 1);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(3, hits.length);
-    query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMinSimilarity, 2);   
+    query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMaxEdits, 2);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(3, hits.length);
-    query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMinSimilarity, 3);   
+    query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMaxEdits, 3);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(3, hits.length);
-    query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMinSimilarity, 4);   
+    query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMaxEdits, 4);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(2, hits.length);
-    query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMinSimilarity, 5);   
+    query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMaxEdits, 5);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(1, hits.length);
-    query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMinSimilarity, 6);   
+    query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMaxEdits, 6);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(1, hits.length);
     
     // test scoring
-    query = new FuzzyQuery(new Term("field", "bbbbb"), FuzzyQuery.defaultMinSimilarity, 0);   
+    query = new FuzzyQuery(new Term("field", "bbbbb"), FuzzyQuery.defaultMaxEdits, 0);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("3 documents should match", 3, hits.length);
     List<String> order = Arrays.asList("bbbbb","abbbb","aabbb");
@@ -89,7 +89,7 @@
 
     // test pq size by supplying maxExpansions=2
     // This query would normally return 3 documents, because 3 terms match (see above):
-    query = new FuzzyQuery(new Term("field", "bbbbb"), FuzzyQuery.defaultMinSimilarity, 0, 2); 
+    query = new FuzzyQuery(new Term("field", "bbbbb"), FuzzyQuery.defaultMaxEdits, 0, 2, false); 
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("only 2 documents should match", 2, hits.length);
     order = Arrays.asList("bbbbb","abbbb");
@@ -100,15 +100,15 @@
     }
 
     // not similar enough:
-    query = new FuzzyQuery(new Term("field", "xxxxx"), FuzzyQuery.defaultMinSimilarity, 0);  	
+    query = new FuzzyQuery(new Term("field", "xxxxx"), FuzzyQuery.defaultMaxEdits, 0);  	
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(0, hits.length);
-    query = new FuzzyQuery(new Term("field", "aaccc"), FuzzyQuery.defaultMinSimilarity, 0);   // edit distance to "aaaaa" = 3
+    query = new FuzzyQuery(new Term("field", "aaccc"), FuzzyQuery.defaultMaxEdits, 0);   // edit distance to "aaaaa" = 3
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(0, hits.length);
 
     // query identical to a word in the index:
-    query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMinSimilarity, 0);   
+    query = new FuzzyQuery(new Term("field", "aaaaa"), FuzzyQuery.defaultMaxEdits, 0);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(3, hits.length);
     assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaa"));
@@ -117,7 +117,7 @@
     assertEquals(searcher.doc(hits[2].doc).get("field"), ("aaabb"));
 
     // query similar to a word in the index:
-    query = new FuzzyQuery(new Term("field", "aaaac"), FuzzyQuery.defaultMinSimilarity, 0);   
+    query = new FuzzyQuery(new Term("field", "aaaac"), FuzzyQuery.defaultMaxEdits, 0);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(3, hits.length);
     assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaa"));
@@ -125,158 +125,69 @@
     assertEquals(searcher.doc(hits[2].doc).get("field"), ("aaabb"));
     
     // now with prefix
-    query = new FuzzyQuery(new Term("field", "aaaac"), FuzzyQuery.defaultMinSimilarity, 1);   
+    query = new FuzzyQuery(new Term("field", "aaaac"), FuzzyQuery.defaultMaxEdits, 1);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(3, hits.length);
     assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaa"));
     assertEquals(searcher.doc(hits[1].doc).get("field"), ("aaaab"));
     assertEquals(searcher.doc(hits[2].doc).get("field"), ("aaabb"));
-    query = new FuzzyQuery(new Term("field", "aaaac"), FuzzyQuery.defaultMinSimilarity, 2);   
+    query = new FuzzyQuery(new Term("field", "aaaac"), FuzzyQuery.defaultMaxEdits, 2);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(3, hits.length);
     assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaa"));
     assertEquals(searcher.doc(hits[1].doc).get("field"), ("aaaab"));
     assertEquals(searcher.doc(hits[2].doc).get("field"), ("aaabb"));
-    query = new FuzzyQuery(new Term("field", "aaaac"), FuzzyQuery.defaultMinSimilarity, 3);   
+    query = new FuzzyQuery(new Term("field", "aaaac"), FuzzyQuery.defaultMaxEdits, 3);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(3, hits.length);
     assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaa"));
     assertEquals(searcher.doc(hits[1].doc).get("field"), ("aaaab"));
     assertEquals(searcher.doc(hits[2].doc).get("field"), ("aaabb"));
-    query = new FuzzyQuery(new Term("field", "aaaac"), FuzzyQuery.defaultMinSimilarity, 4);   
+    query = new FuzzyQuery(new Term("field", "aaaac"), FuzzyQuery.defaultMaxEdits, 4);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(2, hits.length);
     assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaa"));
     assertEquals(searcher.doc(hits[1].doc).get("field"), ("aaaab"));
-    query = new FuzzyQuery(new Term("field", "aaaac"), FuzzyQuery.defaultMinSimilarity, 5);   
+    query = new FuzzyQuery(new Term("field", "aaaac"), FuzzyQuery.defaultMaxEdits, 5);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(0, hits.length);
     
 
-    query = new FuzzyQuery(new Term("field", "ddddX"), FuzzyQuery.defaultMinSimilarity, 0);   
+    query = new FuzzyQuery(new Term("field", "ddddX"), FuzzyQuery.defaultMaxEdits, 0);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(1, hits.length);
     assertEquals(searcher.doc(hits[0].doc).get("field"), ("ddddd"));
     
     // now with prefix
-    query = new FuzzyQuery(new Term("field", "ddddX"), FuzzyQuery.defaultMinSimilarity, 1);   
+    query = new FuzzyQuery(new Term("field", "ddddX"), FuzzyQuery.defaultMaxEdits, 1);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(1, hits.length);
     assertEquals(searcher.doc(hits[0].doc).get("field"), ("ddddd"));
-    query = new FuzzyQuery(new Term("field", "ddddX"), FuzzyQuery.defaultMinSimilarity, 2);   
+    query = new FuzzyQuery(new Term("field", "ddddX"), FuzzyQuery.defaultMaxEdits, 2);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(1, hits.length);
     assertEquals(searcher.doc(hits[0].doc).get("field"), ("ddddd"));
-    query = new FuzzyQuery(new Term("field", "ddddX"), FuzzyQuery.defaultMinSimilarity, 3);   
+    query = new FuzzyQuery(new Term("field", "ddddX"), FuzzyQuery.defaultMaxEdits, 3);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(1, hits.length);
     assertEquals(searcher.doc(hits[0].doc).get("field"), ("ddddd"));
-    query = new FuzzyQuery(new Term("field", "ddddX"), FuzzyQuery.defaultMinSimilarity, 4);   
+    query = new FuzzyQuery(new Term("field", "ddddX"), FuzzyQuery.defaultMaxEdits, 4);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(1, hits.length);
     assertEquals(searcher.doc(hits[0].doc).get("field"), ("ddddd"));
-    query = new FuzzyQuery(new Term("field", "ddddX"), FuzzyQuery.defaultMinSimilarity, 5);   
+    query = new FuzzyQuery(new Term("field", "ddddX"), FuzzyQuery.defaultMaxEdits, 5);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(0, hits.length);
     
 
     // different field = no match:
-    query = new FuzzyQuery(new Term("anotherfield", "ddddX"), FuzzyQuery.defaultMinSimilarity, 0);   
+    query = new FuzzyQuery(new Term("anotherfield", "ddddX"), FuzzyQuery.defaultMaxEdits, 0);   
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals(0, hits.length);
 
     reader.close();
     directory.close();
   }
-
-  public void testFuzzinessLong() throws Exception {
-    Directory directory = newDirectory();
-    RandomIndexWriter writer = new RandomIndexWriter(random(), directory);
-    addDoc("aaaaaaa", writer);
-    addDoc("segment", writer);
-
-    IndexReader reader = writer.getReader();
-    IndexSearcher searcher = newSearcher(reader);
-    writer.close();
-
-    FuzzyQuery query;
-    // not similar enough:
-    query = new FuzzyQuery(new Term("field", "xxxxx"), 0.5f, 0);   
-    ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(0, hits.length);
-    // edit distance to "aaaaaaa" = 3, this matches because the string is longer than
-    // in testDefaultFuzziness so a bigger difference is allowed:
-    query = new FuzzyQuery(new Term("field", "aaaaccc"), 0.5f, 0);   
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(1, hits.length);
-    assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaaaa"));
-    
-    // now with prefix
-    query = new FuzzyQuery(new Term("field", "aaaaccc"), 0.5f, 1);   
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(1, hits.length);
-    assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaaaa"));
-    query = new FuzzyQuery(new Term("field", "aaaaccc"), 0.5f, 4);   
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(1, hits.length);
-    assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaaaa"));
-    query = new FuzzyQuery(new Term("field", "aaaaccc"), 0.5f, 5);   
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(0, hits.length);
-
-    // no match, more than half of the characters is wrong:
-    query = new FuzzyQuery(new Term("field", "aaacccc"), 0.5f, 0);   
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(0, hits.length);
-    
-    // now with prefix
-    query = new FuzzyQuery(new Term("field", "aaacccc"), 0.5f, 2);   
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(0, hits.length);
-
-    // "student" and "stellent" are indeed similar to "segment" by default:
-    query = new FuzzyQuery(new Term("field", "student"), 0.5f, 0);   
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(1, hits.length);
-    query = new FuzzyQuery(new Term("field", "stellent"), 0.5f, 0);   
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(1, hits.length);
-    
-    // now with prefix
-    query = new FuzzyQuery(new Term("field", "student"), 0.5f, 1);   
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(1, hits.length);
-    query = new FuzzyQuery(new Term("field", "stellent"), 0.5f, 1);   
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(1, hits.length);
-    query = new FuzzyQuery(new Term("field", "student"), 0.5f, 2);   
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(0, hits.length);
-    query = new FuzzyQuery(new Term("field", "stellent"), 0.5f, 2);   
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(0, hits.length);
-    
-    // "student" doesn't match anymore thanks to increased minimum similarity:
-    query = new FuzzyQuery(new Term("field", "student"), 0.6f, 0);   
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(0, hits.length);
-
-    try {
-      query = new FuzzyQuery(new Term("field", "student"), 1.1f);
-      fail("Expected IllegalArgumentException");
-    } catch (IllegalArgumentException e) {
-      // expecting exception
-    }
-    try {
-      query = new FuzzyQuery(new Term("field", "student"), -0.1f);
-      fail("Expected IllegalArgumentException");
-    } catch (IllegalArgumentException e) {
-      // expecting exception
-    }
-
-    reader.close();
-    directory.close();
-  }
   
   /** 
    * MultiTermQuery provides (via attribute) information about which values
@@ -307,7 +218,7 @@
     
     MultiReader mr = new MultiReader(ir1, ir2);
     IndexSearcher searcher = newSearcher(mr);
-    FuzzyQuery fq = new FuzzyQuery(new Term("field", "z123456"), 1f, 0, 2);
+    FuzzyQuery fq = new FuzzyQuery(new Term("field", "z123456"), 1, 0, 2, false);
     TopDocs docs = searcher.search(fq, 2);
     assertEquals(5, docs.totalHits); // 5 docs, from the a and b's
     mr.close();
@@ -319,41 +230,6 @@
     directory2.close(); 
   }
   
-  public void testTokenLengthOpt() throws IOException {
-    Directory directory = newDirectory();
-    RandomIndexWriter writer = new RandomIndexWriter(random(), directory);
-    addDoc("12345678911", writer);
-    addDoc("segment", writer);
-
-    IndexReader reader = writer.getReader();
-    IndexSearcher searcher = newSearcher(reader);
-    writer.close();
-
-    Query query;
-    // term not over 10 chars, so optimization shortcuts
-    query = new FuzzyQuery(new Term("field", "1234569"), 0.9f);
-    ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(0, hits.length);
-
-    // 10 chars, so no optimization
-    query = new FuzzyQuery(new Term("field", "1234567891"), 0.9f);
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(0, hits.length);
-    
-    // over 10 chars, so no optimization
-    query = new FuzzyQuery(new Term("field", "12345678911"), 0.9f);
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(1, hits.length);
-
-    // over 10 chars, no match
-    query = new FuzzyQuery(new Term("field", "sdfsdfsdfsdf"), 0.9f);
-    hits = searcher.search(query, null, 1000).scoreDocs;
-    assertEquals(0, hits.length);
-    
-    reader.close();
-    directory.close();
-  }
-  
   /** Test the TopTermsBoostOnlyBooleanQueryRewrite rewrite method. */
   public void testBoostOnlyRewrite() throws Exception {
     Directory directory = newDirectory();
@@ -404,7 +280,7 @@
     IndexReader r = w.getReader();
     w.close();
 
-    Query q = new FuzzyQuery(new Term("field", "giga"), 0.9f);
+    Query q = new FuzzyQuery(new Term("field", "giga"), 0);
 
     // 3. search
     IndexSearcher searcher = newSearcher(r);
@@ -435,26 +311,17 @@
     assertEquals(1, hits.length);
     assertEquals("foobar", searcher.doc(hits[0].doc).get("field"));
     
-    q = new FuzzyQuery(new Term("field", "t"), 3);
-    hits = searcher.search(q, 10).scoreDocs;
-    assertEquals(1, hits.length);
-    assertEquals("test", searcher.doc(hits[0].doc).get("field"));
-    
-    q = new FuzzyQuery(new Term("field", "a"), 4f, 0, 50);
-    hits = searcher.search(q, 10).scoreDocs;
-    assertEquals(1, hits.length);
-    assertEquals("test", searcher.doc(hits[0].doc).get("field"));
-    
-    q = new FuzzyQuery(new Term("field", "a"), 6f, 0, 50);
-    hits = searcher.search(q, 10).scoreDocs;
-    assertEquals(2, hits.length);
-    assertEquals("test", searcher.doc(hits[0].doc).get("field"));
-    assertEquals("foobar", searcher.doc(hits[1].doc).get("field"));
-    
+    try {
+      q = new FuzzyQuery(new Term("field", "t"), 3);
+      fail();
+    } catch (IllegalArgumentException expected) {
+      // expected
+    }
+      
     reader.close();
     index.close();
   }
-
+  
   private void addDoc(String text, RandomIndexWriter writer) throws IOException {
     Document doc = new Document();
     doc.add(newField("field", text, TextField.TYPE_STORED));
Index: lucene/core/src/java/org/apache/lucene/search/FuzzyQuery.java
===================================================================
--- lucene/core/src/java/org/apache/lucene/search/FuzzyQuery.java	(revision 1332803)
+++ lucene/core/src/java/org/apache/lucene/search/FuzzyQuery.java	(working copy)
@@ -37,94 +37,80 @@
  */
 public class FuzzyQuery extends MultiTermQuery {
   
-  public final static float defaultMinSimilarity = LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE;
+  public final static int defaultMaxEdits = LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE;
   public final static int defaultPrefixLength = 0;
   public final static int defaultMaxExpansions = 50;
+  public final static boolean defaultTranspositions = true;
   
-  private float minimumSimilarity;
-  private int prefixLength;
-  private boolean termLongEnough = false;
+  private final int maxEdits;
+  private final int maxExpansions;
+  private final boolean transpositions;
+  private final int prefixLength;
+  private final Term term;
   
-  protected Term term;
-  
   /**
-   * Create a new FuzzyQuery that will match terms with a similarity 
-   * of at least <code>minimumSimilarity</code> to <code>term</code>.
+   * Create a new FuzzyQuery that will match terms with an edit distance 
+   * of at most <code>maxEdits</code> to <code>term</code>.
    * If a <code>prefixLength</code> &gt; 0 is specified, a common prefix
    * of that length is also required.
    * 
    * @param term the term to search for
-   * @param minimumSimilarity a value between 0 and 1 to set the required similarity
-   *  between the query term and the matching terms. For example, for a
-   *  <code>minimumSimilarity</code> of <code>0.5</code> a term of the same length
-   *  as the query term is considered similar to the query term if the edit distance
-   *  between both terms is less than <code>length(term)*0.5</code>
-   *  <p>
-   *  Alternatively, if <code>minimumSimilarity</code> is >= 1f, it is interpreted 
-   *  as a pure Levenshtein edit distance. For example, a value of <code>2f</code>
-   *  will match all terms within an edit distance of <code>2</code> from the 
-   *  query term. Edit distances specified in this way may not be fractional.
-   *  
+   * @param maxEdits must be >= 0 and <= {@link LevenshteinAutomata#MAXIMUM_SUPPORTED_DISTANCE}.
    * @param prefixLength length of common (non-fuzzy) prefix
    * @param maxExpansions the maximum number of terms to match. If this number is
    *  greater than {@link BooleanQuery#getMaxClauseCount} when the query is rewritten, 
    *  then the maxClauseCount will be used instead.
-   * @throws IllegalArgumentException if minimumSimilarity is &gt;= 1 or &lt; 0
-   * or if prefixLength &lt; 0
+   * @param transpositions true if transpositions should be treated as a primitive
+   *        edit operation.
    */
-  public FuzzyQuery(Term term, float minimumSimilarity, int prefixLength,
-      int maxExpansions) {
+  public FuzzyQuery(Term term, int maxEdits, int prefixLength, int maxExpansions, boolean transpositions) {
     super(term.field());
-    this.term = term;
     
-    if (minimumSimilarity >= 1.0f && minimumSimilarity != (int)minimumSimilarity)
-      throw new IllegalArgumentException("fractional edit distances are not allowed");
-    if (minimumSimilarity < 0.0f)
-      throw new IllegalArgumentException("minimumSimilarity < 0");
-    if (prefixLength < 0)
-      throw new IllegalArgumentException("prefixLength < 0");
-    if (maxExpansions < 0)
-      throw new IllegalArgumentException("maxExpansions < 0");
-    
-    setRewriteMethod(new MultiTermQuery.TopTermsScoringBooleanQueryRewrite(maxExpansions));
-    
-    String text = term.text();
-    int len = text.codePointCount(0, text.length());
-    if (len > 0 && (minimumSimilarity >= 1f || len > 1.0f / (1.0f - minimumSimilarity))) {
-      this.termLongEnough = true;
+    if (maxEdits < 0 || maxEdits > LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE) {
+      throw new IllegalArgumentException("maxEdits must be between 0 and " + LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE);
     }
+    if (prefixLength < 0) {
+      throw new IllegalArgumentException("prefixLength cannot be negative.");
+    }
+    if (maxExpansions < 0) {
+      throw new IllegalArgumentException("maxExpansions cannot be negative.");
+    }
     
-    this.minimumSimilarity = minimumSimilarity;
+    this.term = term;
+    this.maxEdits = maxEdits;
     this.prefixLength = prefixLength;
+    this.transpositions = transpositions;
+    this.maxExpansions = maxExpansions;
+    setRewriteMethod(new MultiTermQuery.TopTermsScoringBooleanQueryRewrite(maxExpansions));
   }
   
   /**
-   * Calls {@link #FuzzyQuery(Term, float) FuzzyQuery(term, minimumSimilarity, prefixLength, defaultMaxExpansions)}.
+   * Calls {@link #FuzzyQuery(Term, int, int, int, boolean) 
+   * FuzzyQuery(term, minimumSimilarity, prefixLength, defaultMaxExpansions, defaultTranspositions)}.
    */
-  public FuzzyQuery(Term term, float minimumSimilarity, int prefixLength) {
-    this(term, minimumSimilarity, prefixLength, defaultMaxExpansions);
+  public FuzzyQuery(Term term, int maxEdits, int prefixLength) {
+    this(term, maxEdits, prefixLength, defaultMaxExpansions, defaultTranspositions);
   }
   
   /**
-   * Calls {@link #FuzzyQuery(Term, float) FuzzyQuery(term, minimumSimilarity, 0, defaultMaxExpansions)}.
+   * Calls {@link #FuzzyQuery(Term, int, int) FuzzyQuery(term, maxEdits, defaultPrefixLength)}.
    */
-  public FuzzyQuery(Term term, float minimumSimilarity) {
-    this(term, minimumSimilarity, defaultPrefixLength, defaultMaxExpansions);
+  public FuzzyQuery(Term term, int maxEdits) {
+    this(term, maxEdits, defaultPrefixLength);
   }
 
   /**
-   * Calls {@link #FuzzyQuery(Term, float) FuzzyQuery(term, defaultMinSimilarity, 0, defaultMaxExpansions)}.
+   * Calls {@link #FuzzyQuery(Term, int) FuzzyQuery(term, defaultMaxEdits)}.
    */
   public FuzzyQuery(Term term) {
-    this(term, defaultMinSimilarity, defaultPrefixLength, defaultMaxExpansions);
+    this(term, defaultMaxEdits);
   }
   
   /**
-   * Returns the minimum similarity that is required for this query to match.
-   * @return float value between 0.0 and 1.0
+   * @return the maximum number of edit distances allowed for this query to match.
    */
-  public float getMinSimilarity() {
-    return minimumSimilarity;
+  public int getMaxEdits() {
+    return maxEdits;
   }
     
   /**
@@ -138,13 +124,10 @@
 
   @Override
   protected TermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws IOException {
-    if (!termLongEnough) {  // can only match if it's exact
+    if (maxEdits == 0 || prefixLength >= term.text().length()) {  // can only match if it's exact
       return new SingleTermsEnum(terms.iterator(null), term.bytes());
     }
-    // TODO: should we expose the transpositions option to this query?
-    // maybe move the old/slowish stuff (lev without transpositions, n > 2, etc) all to contrib,
-    // deprecate it, and just have a faster/simpler/better one in core?
-    return new FuzzyTermsEnum(terms, atts, getTerm(), minimumSimilarity, prefixLength, false);
+    return new FuzzyTermsEnum(terms, atts, getTerm(), maxEdits, prefixLength, transpositions);
   }
   
   /**
@@ -163,7 +146,7 @@
     }
     buffer.append(term.text());
     buffer.append('~');
-    buffer.append(Float.toString(minimumSimilarity));
+    buffer.append(Integer.toString(maxEdits));
     buffer.append(ToStringUtils.boost(getBoost()));
     return buffer.toString();
   }
@@ -172,8 +155,10 @@
   public int hashCode() {
     final int prime = 31;
     int result = super.hashCode();
-    result = prime * result + Float.floatToIntBits(minimumSimilarity);
+    result = prime * result + maxEdits;
     result = prime * result + prefixLength;
+    result = prime * result + maxExpansions;
+    result = prime * result + (transpositions ? 0 : 1);
     result = prime * result + ((term == null) ? 0 : term.hashCode());
     return result;
   }
@@ -187,11 +172,14 @@
     if (getClass() != obj.getClass())
       return false;
     FuzzyQuery other = (FuzzyQuery) obj;
-    if (Float.floatToIntBits(minimumSimilarity) != Float
-        .floatToIntBits(other.minimumSimilarity))
+    if (maxEdits != other.maxEdits)
       return false;
     if (prefixLength != other.prefixLength)
       return false;
+    if (maxExpansions != other.maxExpansions)
+      return false;
+    if (transpositions != other.transpositions)
+      return false;
     if (term == null) {
       if (other.term != null)
         return false;
@@ -199,6 +187,19 @@
       return false;
     return true;
   }
-
-
+  
+  @Deprecated
+  public final static float defaultMinSimilarity = LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE;
+  // nocommit: javadocs
+  @Deprecated
+  public static int floatToEdits(float minimumSimilarity, int termLen) {
+    if (minimumSimilarity > 1f) {
+      return (int) Math.min(minimumSimilarity, LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE);
+    } else if (minimumSimilarity == 0.0f) {
+      return 0; // 0 means exact, not infinite # of edits!
+    } else {
+      return Math.min((int) ((1D-minimumSimilarity) * termLen), 
+        LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE);
+    }
+  }
 }
Index: lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java
===================================================================
--- lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java	(revision 1332803)
+++ lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java	(working copy)
@@ -34,8 +34,6 @@
 import org.apache.lucene.util.AttributeSource;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.IntsRef;
-import org.apache.lucene.util.StringHelper;
 import org.apache.lucene.util.UnicodeUtil;
 import org.apache.lucene.util.automaton.Automaton;
 import org.apache.lucene.util.automaton.BasicAutomata;
@@ -51,7 +49,7 @@
  * {@link #getComparator}.  Each term in the enumeration is
  * greater than all that precede it.</p>
  */
-public final class FuzzyTermsEnum extends TermsEnum {
+public class FuzzyTermsEnum extends TermsEnum {
   private TermsEnum actualEnum;
   private BoostAttribute actualBoostAtt;
   
@@ -67,18 +65,18 @@
   // TODO: chicken-and-egg
   private final Comparator<BytesRef> termComparator = BytesRef.getUTF8SortedAsUnicodeComparator();
   
-  private final float minSimilarity;
-  private final float scale_factor;
+  protected final float minSimilarity;
+  protected final float scale_factor;
   
-  private final int termLength;
+  protected final int termLength;
   
-  private int maxEdits;
-  private final boolean raw;
+  protected int maxEdits;
+  protected final boolean raw;
 
-  private final Terms terms;
+  protected final Terms terms;
   private final Term term;
-  private final int termText[];
-  private final int realPrefixLength;
+  protected final int termText[];
+  protected final int realPrefixLength;
   
   private final boolean transpositions;
   
@@ -149,7 +147,7 @@
    * return an automata-based enum for matching up to editDistance from
    * lastTerm, if possible
    */
-  private TermsEnum getAutomatonEnum(int editDistance, BytesRef lastTerm)
+  protected TermsEnum getAutomatonEnum(int editDistance, BytesRef lastTerm)
       throws IOException {
     final List<CompiledAutomaton> runAutomata = initAutomata(editDistance);
     if (editDistance < runAutomata.size()) {
@@ -187,7 +185,7 @@
   }
 
   /** swap in a new actual enum to proxy to */
-  private void setEnum(TermsEnum actualEnum) {
+  protected void setEnum(TermsEnum actualEnum) {
     this.actualEnum = actualEnum;
     this.actualBoostAtt = actualEnum.attributes().addAttribute(BoostAttribute.class);
   }
@@ -209,14 +207,21 @@
       maxEdits--;
     
     if (oldMaxEdits != maxEdits || init) { // the maximum n has changed
-      TermsEnum newEnum = getAutomatonEnum(maxEdits, lastTerm);
-      if (newEnum != null) {
-        setEnum(newEnum);
-      } else if (init) {
-        setEnum(new LinearFuzzyTermsEnum());      
-      }
+      maxEditDistanceChanged(lastTerm, maxEdits, init);
     }
   }
+  
+  protected void maxEditDistanceChanged(BytesRef lastTerm, int maxEdits, boolean init)
+      throws IOException {
+    TermsEnum newEnum = getAutomatonEnum(maxEdits, lastTerm);
+    // instead of assert, we do a hard check in case someone uses our enum directly
+    // assert newEnum != null;
+    if (newEnum == null) {
+      assert maxEdits > LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE;
+      throw new IllegalArgumentException("maxEdits cannot be > LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE");
+    }
+    setEnum(newEnum);
+  }
 
   // for some raw min similarity and input term length, the maximum # of edits
   private int initialMaxDistance(float minimumSimilarity, int termLen) {
@@ -383,194 +388,6 @@
     }
   }
 
-  /**
-   * Implement fuzzy enumeration with linear brute force.
-   */
-  private class LinearFuzzyTermsEnum extends FilteredTermsEnum {
-    /* Allows us save time required to create a new array
-     * every time similarity is called.
-     */
-    private int[] d;
-    private int[] p;
-    
-    // this is the text, minus the prefix
-    private final int[] text;
-    
-    private final BoostAttribute boostAtt =
-      attributes().addAttribute(BoostAttribute.class);
-    
-    /**
-     * Constructor for enumeration of all terms from specified <code>reader</code> which share a prefix of
-     * length <code>prefixLength</code> with <code>term</code> and which have a fuzzy similarity &gt;
-     * <code>minSimilarity</code>.
-     * <p>
-     * After calling the constructor the enumeration is already pointing to the first 
-     * valid term if such a term exists.
-     *
-     * @throws IOException
-     */
-    public LinearFuzzyTermsEnum() throws IOException {
-      super(terms.iterator(null));
-
-      this.text = new int[termLength - realPrefixLength];
-      System.arraycopy(termText, realPrefixLength, text, 0, text.length);
-      final String prefix = UnicodeUtil.newString(termText, 0, realPrefixLength);
-      prefixBytesRef = new BytesRef(prefix);
-      this.d = new int[this.text.length + 1];
-      this.p = new int[this.text.length + 1];
-      
-      setInitialSeekTerm(prefixBytesRef);
-    }
-    
-    private final BytesRef prefixBytesRef;
-    // used for unicode conversion from BytesRef byte[] to int[]
-    private final IntsRef utf32 = new IntsRef(20);
-    
-    /**
-     * The termCompare method in FuzzyTermEnum uses Levenshtein distance to 
-     * calculate the distance between the given term and the comparing term. 
-     */
-    @Override
-    protected final AcceptStatus accept(BytesRef term) {
-      if (StringHelper.startsWith(term, prefixBytesRef)) {
-        UnicodeUtil.UTF8toUTF32(term, utf32);
-        final float similarity = similarity(utf32.ints, realPrefixLength, utf32.length - realPrefixLength);
-        if (similarity > minSimilarity) {
-          boostAtt.setBoost((similarity - minSimilarity) * scale_factor);
-          return AcceptStatus.YES;
-        } else return AcceptStatus.NO;
-      } else {
-        return AcceptStatus.END;
-      }
-    }
-    
-    /******************************
-     * Compute Levenshtein distance
-     ******************************/
-    
-    /**
-     * <p>Similarity returns a number that is 1.0f or less (including negative numbers)
-     * based on how similar the Term is compared to a target term.  It returns
-     * exactly 0.0f when
-     * <pre>
-     *    editDistance &gt; maximumEditDistance</pre>
-     * Otherwise it returns:
-     * <pre>
-     *    1 - (editDistance / length)</pre>
-     * where length is the length of the shortest term (text or target) including a
-     * prefix that are identical and editDistance is the Levenshtein distance for
-     * the two words.</p>
-     *
-     * <p>Embedded within this algorithm is a fail-fast Levenshtein distance
-     * algorithm.  The fail-fast algorithm differs from the standard Levenshtein
-     * distance algorithm in that it is aborted if it is discovered that the
-     * minimum distance between the words is greater than some threshold.
-     *
-     * <p>To calculate the maximum distance threshold we use the following formula:
-     * <pre>
-     *     (1 - minimumSimilarity) * length</pre>
-     * where length is the shortest term including any prefix that is not part of the
-     * similarity comparison.  This formula was derived by solving for what maximum value
-     * of distance returns false for the following statements:
-     * <pre>
-     *   similarity = 1 - ((float)distance / (float) (prefixLength + Math.min(textlen, targetlen)));
-     *   return (similarity > minimumSimilarity);</pre>
-     * where distance is the Levenshtein distance for the two words.
-     * </p>
-     * <p>Levenshtein distance (also known as edit distance) is a measure of similarity
-     * between two strings where the distance is measured as the number of character
-     * deletions, insertions or substitutions required to transform one string to
-     * the other string.
-     * @param target the target word or phrase
-     * @return the similarity,  0.0 or less indicates that it matches less than the required
-     * threshold and 1.0 indicates that the text and target are identical
-     */
-    private final float similarity(final int[] target, int offset, int length) {
-      final int m = length;
-      final int n = text.length;
-      if (n == 0)  {
-        //we don't have anything to compare.  That means if we just add
-        //the letters for m we get the new word
-        return realPrefixLength == 0 ? 0.0f : 1.0f - ((float) m / realPrefixLength);
-      }
-      if (m == 0) {
-        return realPrefixLength == 0 ? 0.0f : 1.0f - ((float) n / realPrefixLength);
-      }
-      
-      final int maxDistance = calculateMaxDistance(m);
-      
-      if (maxDistance < Math.abs(m-n)) {
-        //just adding the characters of m to n or vice-versa results in
-        //too many edits
-        //for example "pre" length is 3 and "prefixes" length is 8.  We can see that
-        //given this optimal circumstance, the edit distance cannot be less than 5.
-        //which is 8-3 or more precisely Math.abs(3-8).
-        //if our maximum edit distance is 4, then we can discard this word
-        //without looking at it.
-        return Float.NEGATIVE_INFINITY;
-      }
-      
-      // init matrix d
-      for (int i = 0; i <=n; ++i) {
-        p[i] = i;
-      }
-      
-      // start computing edit distance
-      for (int j = 1; j<=m; ++j) { // iterates through target
-        int bestPossibleEditDistance = m;
-        final int t_j = target[offset+j-1]; // jth character of t
-        d[0] = j;
-
-        for (int i=1; i<=n; ++i) { // iterates through text
-          // minimum of cell to the left+1, to the top+1, diagonally left and up +(0|1)
-          if (t_j != text[i-1]) {
-            d[i] = Math.min(Math.min(d[i-1], p[i]),  p[i-1]) + 1;
-          } else {
-            d[i] = Math.min(Math.min(d[i-1]+1, p[i]+1),  p[i-1]);
-          }
-          bestPossibleEditDistance = Math.min(bestPossibleEditDistance, d[i]);
-        }
-
-        //After calculating row i, the best possible edit distance
-        //can be found by found by finding the smallest value in a given column.
-        //If the bestPossibleEditDistance is greater than the max distance, abort.
-
-        if (j > maxDistance && bestPossibleEditDistance > maxDistance) {  //equal is okay, but not greater
-          //the closest the target can be to the text is just too far away.
-          //this target is leaving the party early.
-          return Float.NEGATIVE_INFINITY;
-        }
-
-        // copy current distance counts to 'previous row' distance counts: swap p and d
-        int _d[] = p;
-        p = d;
-        d = _d;
-      }
-      
-      // our last action in the above loop was to switch d and p, so p now
-      // actually has the most recent cost counts
-
-      // this will return less than 0.0 when the edit distance is
-      // greater than the number of characters in the shorter word.
-      // but this was the formula that was previously used in FuzzyTermEnum,
-      // so it has not been changed (even though minimumSimilarity must be
-      // greater than 0.0)
-      return 1.0f - ((float)p[n] / (float) (realPrefixLength + Math.min(n, m)));
-    }
-    
-    /**
-     * The max Distance is the maximum Levenshtein distance for the text
-     * compared to some other value that results in score that is
-     * better than the minimum similarity.
-     * @param m the length of the "other value"
-     * @return the maximum levenshtein distance that we care about
-     */
-    private int calculateMaxDistance(int m) {
-      return raw ? maxEdits : Math.min(maxEdits, 
-          (int)((1-minSimilarity) * (Math.min(text.length, m) + realPrefixLength)));
-    }
-  }
-  
   /** @lucene.internal */
   public float getMinSimilarity() {
     return minSimilarity;
Index: lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
===================================================================
--- lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java	(revision 1332803)
+++ lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java	(working copy)
@@ -669,12 +669,12 @@
       @Override
       public void run() throws Exception {
         numHighlights = 0;
-        FuzzyQuery fuzzyQuery = new FuzzyQuery(new Term(FIELD_NAME, "kinnedy"), 0.5f);
+        FuzzyQuery fuzzyQuery = new FuzzyQuery(new Term(FIELD_NAME, "kinnedy"), 2);
         fuzzyQuery.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
         doSearching(fuzzyQuery);
         doStandardHighlights(analyzer, searcher, hits, query, HighlighterTest.this, true);
         assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
-            numHighlights == 5);
+            numHighlights == 4);
       }
     };
 
Index: lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery2.java
===================================================================
--- lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery2.java	(revision 0)
+++ lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery2.java	(working copy)
@@ -0,0 +1,183 @@
+package org.apache.lucene.sandbox.queries;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.analysis.MockTokenizer;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+import org.apache.lucene.document.TextField;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.RandomIndexWriter;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.MultiTermQuery;
+import org.apache.lucene.search.TopDocs;
+import org.apache.lucene.search.similarities.DefaultSimilarity;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.util.LuceneTestCase;
+
+/** 
+ * Tests the results of fuzzy against pre-recorded output 
+ * The format of the file is the following:
+ * 
+ * Header Row: # of bits: generate 2^n sequential documents 
+ * with a value of Integer.toBinaryString
+ * 
+ * Entries: an entry is a param spec line, a resultCount line, and
+ * then 'resultCount' results lines. The results lines are in the
+ * expected order.
+ * 
+ * param spec line: a comma-separated list of params to FuzzyQuery
+ *   (query, prefixLen, pqSize, minScore)
+ * query = query text as a number (expand with Integer.toBinaryString)
+ * prefixLen = prefix length
+ * pqSize = priority queue maximum size for TopTermsBoostOnlyBooleanQueryRewrite
+ * minScore = minimum similarity
+ * 
+ * resultCount line: total number of expected hits.
+ * 
+ * results line: comma-separated docID, score pair
+ **/
+public class TestSlowFuzzyQuery2 extends LuceneTestCase {
+  /** epsilon for score comparisons */
+  static final float epsilon = 0.00001f;
+
+  static int[][] mappings = new int[][] {
+    new int[] { 0x40, 0x41 },
+    new int[] { 0x40, 0x0195 },
+    new int[] { 0x40, 0x0906 },
+    new int[] { 0x40, 0x1040F },
+    new int[] { 0x0194, 0x0195 },
+    new int[] { 0x0194, 0x0906 },
+    new int[] { 0x0194, 0x1040F },
+    new int[] { 0x0905, 0x0906 },
+    new int[] { 0x0905, 0x1040F },
+    new int[] { 0x1040E, 0x1040F }
+  };
+  public void testFromTestData() throws Exception {
+    // TODO: randomize!
+    assertFromTestData(mappings[random().nextInt(mappings.length)]);
+  }
+
+  public void assertFromTestData(int codePointTable[]) throws Exception {
+    if (VERBOSE) {
+      System.out.println("TEST: codePointTable=" + codePointTable);
+    }
+    InputStream stream = getClass().getResourceAsStream("fuzzyTestData.txt");
+    BufferedReader reader = new BufferedReader(new InputStreamReader(stream, "UTF-8"));
+    
+    int bits = Integer.parseInt(reader.readLine());
+    int terms = (int) Math.pow(2, bits);
+    
+    Directory dir = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random(), dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.KEYWORD, false)).setMergePolicy(newLogMergePolicy()));
+
+    Document doc = new Document();
+    Field field = newField("field", "", TextField.TYPE_UNSTORED);
+    doc.add(field);
+    
+    for (int i = 0; i < terms; i++) {
+      field.setStringValue(mapInt(codePointTable, i));
+      writer.addDocument(doc);
+    }   
+    
+    IndexReader r = writer.getReader();
+    IndexSearcher searcher = newSearcher(r);
+    if (VERBOSE) {
+      System.out.println("TEST: searcher=" + searcher);
+    }
+    // even though this uses a boost-only rewrite, this test relies upon queryNorm being the default implementation,
+    // otherwise scores are different!
+    searcher.setSimilarity(new DefaultSimilarity());
+    
+    writer.close();
+    String line;
+    while ((line = reader.readLine()) != null) {
+      String params[] = line.split(",");
+      String query = mapInt(codePointTable, Integer.parseInt(params[0]));
+      int prefix = Integer.parseInt(params[1]);
+      int pqSize = Integer.parseInt(params[2]);
+      float minScore = Float.parseFloat(params[3]);
+      SlowFuzzyQuery q = new SlowFuzzyQuery(new Term("field", query), minScore, prefix);
+      q.setRewriteMethod(new MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite(pqSize));
+      int expectedResults = Integer.parseInt(reader.readLine());
+      TopDocs docs = searcher.search(q, expectedResults);
+      assertEquals(expectedResults, docs.totalHits);
+      for (int i = 0; i < expectedResults; i++) {
+        String scoreDoc[] = reader.readLine().split(",");
+        assertEquals(Integer.parseInt(scoreDoc[0]), docs.scoreDocs[i].doc);
+        assertEquals(Float.parseFloat(scoreDoc[1]), docs.scoreDocs[i].score, epsilon);
+      }
+    }
+    r.close();
+    dir.close();
+  }
+  
+  /* map bits to unicode codepoints */
+  private static String mapInt(int codePointTable[], int i) {
+    StringBuilder sb = new StringBuilder();
+    String binary = Integer.toBinaryString(i);
+    for (int j = 0; j < binary.length(); j++)
+      sb.appendCodePoint(codePointTable[binary.charAt(j) - '0']);
+    return sb.toString();
+  }
+
+  /* Code to generate test data
+  public static void main(String args[]) throws Exception {
+    int bits = 3;
+    System.out.println(bits);
+    int terms = (int) Math.pow(2, bits);
+    
+    RAMDirectory dir = new RAMDirectory();
+    IndexWriter writer = new IndexWriter(dir, new KeywordAnalyzer(),
+        IndexWriter.MaxFieldLength.UNLIMITED);
+    
+    Document doc = new Document();
+    Field field = newField("field", "", Field.Store.NO, Field.Index.ANALYZED);
+    doc.add(field);
+
+    for (int i = 0; i < terms; i++) {
+      field.setValue(Integer.toBinaryString(i));
+      writer.addDocument(doc);
+    }
+    
+    writer.forceMerge(1);
+    writer.close();
+
+    IndexSearcher searcher = new IndexSearcher(dir);
+    for (int prefix = 0; prefix < bits; prefix++)
+      for (int pqsize = 1; pqsize <= terms; pqsize++)
+        for (float minscore = 0.1F; minscore < 1F; minscore += 0.2F)
+          for (int query = 0; query < terms; query++) {
+            FuzzyQuery q = new FuzzyQuery(
+                new Term("field", Integer.toBinaryString(query)), minscore, prefix);
+            q.setRewriteMethod(new MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite(pqsize));
+            System.out.println(query + "," + prefix + "," + pqsize + "," + minscore);
+            TopDocs docs = searcher.search(q, terms);
+            System.out.println(docs.totalHits);
+            for (int i = 0; i < docs.totalHits; i++)
+              System.out.println(docs.scoreDocs[i].doc + "," + docs.scoreDocs[i].score);
+          }
+  }
+  */
+}

Property changes on: lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery2.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
Index: lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/fuzzyTestData.txt
===================================================================
--- lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/fuzzyTestData.txt	(revision 0)
+++ lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/fuzzyTestData.txt	(working copy)
@@ -0,0 +1,3721 @@
+3
+0,0,1,0.1
+1
+0,1.0
+1,0,1,0.1
+1
+1,1.0
+2,0,1,0.1
+1
+2,1.0
+3,0,1,0.1
+1
+3,1.0
+4,0,1,0.1
+1
+4,1.0
+5,0,1,0.1
+1
+5,1.0
+6,0,1,0.1
+1
+6,1.0
+7,0,1,0.1
+1
+7,1.0
+0,0,1,0.3
+1
+0,1.0
+1,0,1,0.3
+1
+1,1.0
+2,0,1,0.3
+1
+2,1.0
+3,0,1,0.3
+1
+3,1.0
+4,0,1,0.3
+1
+4,1.0
+5,0,1,0.3
+1
+5,1.0
+6,0,1,0.3
+1
+6,1.0
+7,0,1,0.3
+1
+7,1.0
+0,0,1,0.5
+1
+0,1.0
+1,0,1,0.5
+1
+1,1.0
+2,0,1,0.5
+1
+2,1.0
+3,0,1,0.5
+1
+3,1.0
+4,0,1,0.5
+1
+4,1.0
+5,0,1,0.5
+1
+5,1.0
+6,0,1,0.5
+1
+6,1.0
+7,0,1,0.5
+1
+7,1.0
+0,0,1,0.7
+1
+0,1.0
+1,0,1,0.7
+1
+1,1.0
+2,0,1,0.7
+1
+2,1.0
+3,0,1,0.7
+1
+3,1.0
+4,0,1,0.7
+1
+4,1.0
+5,0,1,0.7
+1
+5,1.0
+6,0,1,0.7
+1
+6,1.0
+7,0,1,0.7
+1
+7,1.0
+0,0,1,0.9
+1
+0,1.0
+1,0,1,0.9
+1
+1,1.0
+2,0,1,0.9
+1
+2,1.0
+3,0,1,0.9
+1
+3,1.0
+4,0,1,0.9
+1
+4,1.0
+5,0,1,0.9
+1
+5,1.0
+6,0,1,0.9
+1
+6,1.0
+7,0,1,0.9
+1
+7,1.0
+0,0,2,0.1
+1
+0,1.0
+1,0,2,0.1
+1
+1,1.0
+2,0,2,0.1
+2
+2,0.91381156
+4,0.4061385
+3,0,2,0.1
+2
+3,0.91381156
+2,0.4061385
+4,0,2,0.1
+2
+4,0.84623283
+5,0.53281325
+5,0,2,0.1
+2
+5,0.84623283
+4,0.53281325
+6,0,2,0.1
+2
+6,0.84623283
+4,0.53281325
+7,0,2,0.1
+2
+7,0.84623283
+5,0.53281325
+0,0,2,0.3
+1
+0,1.0
+1,0,2,0.3
+1
+1,1.0
+2,0,2,0.3
+2
+2,0.96152395
+4,0.27472112
+3,0,2,0.3
+2
+3,0.96152395
+2,0.27472112
+4,0,2,0.3
+2
+4,0.88583153
+5,0.4640069
+5,0,2,0.3
+2
+5,0.88583153
+4,0.4640069
+6,0,2,0.3
+2
+6,0.88583153
+4,0.4640069
+7,0,2,0.3
+2
+7,0.88583153
+5,0.4640069
+0,0,2,0.5
+1
+0,1.0
+1,0,2,0.5
+1
+1,1.0
+2,0,2,0.5
+1
+2,1.0
+3,0,2,0.5
+1
+3,1.0
+4,0,2,0.5
+2
+4,0.9486833
+5,0.3162277
+5,0,2,0.5
+2
+5,0.9486833
+4,0.3162277
+6,0,2,0.5
+2
+6,0.9486833
+4,0.3162277
+7,0,2,0.5
+2
+7,0.9486833
+5,0.3162277
+0,0,2,0.7
+1
+0,1.0
+1,0,2,0.7
+1
+1,1.0
+2,0,2,0.7
+1
+2,1.0
+3,0,2,0.7
+1
+3,1.0
+4,0,2,0.7
+1
+4,1.0
+5,0,2,0.7
+1
+5,1.0
+6,0,2,0.7
+1
+6,1.0
+7,0,2,0.7
+1
+7,1.0
+0,0,2,0.9
+1
+0,1.0
+1,0,2,0.9
+1
+1,1.0
+2,0,2,0.9
+1
+2,1.0
+3,0,2,0.9
+1
+3,1.0
+4,0,2,0.9
+1
+4,1.0
+5,0,2,0.9
+1
+5,1.0
+6,0,2,0.9
+1
+6,1.0
+7,0,2,0.9
+1
+7,1.0
+0,0,3,0.1
+1
+0,1.0
+1,0,3,0.1
+1
+1,1.0
+2,0,3,0.1
+3
+2,0.84664875
+4,0.37628835
+5,0.37628835
+3,0,3,0.1
+3
+3,0.84664875
+2,0.37628835
+5,0.37628835
+4,0,3,0.1
+3
+4,0.74683726
+5,0.47023085
+6,0.47023085
+5,0,3,0.1
+3
+5,0.74683726
+4,0.47023085
+7,0.47023085
+6,0,3,0.1
+3
+6,0.74683726
+4,0.47023085
+7,0.47023085
+7,0,3,0.1
+3
+7,0.74683726
+5,0.47023085
+6,0.47023085
+0,0,3,0.3
+1
+0,1.0
+1,0,3,0.3
+1
+1,1.0
+2,0,3,0.3
+3
+2,0.92717266
+4,0.26490647
+5,0.26490647
+3,0,3,0.3
+3
+3,0.92717266
+2,0.26490647
+5,0.26490647
+4,0,3,0.3
+3
+4,0.8035427
+5,0.42090324
+6,0.42090324
+5,0,3,0.3
+3
+5,0.80354273
+4,0.42090327
+7,0.42090327
+6,0,3,0.3
+3
+6,0.80354273
+4,0.42090327
+7,0.42090327
+7,0,3,0.3
+3
+7,0.8035427
+5,0.42090324
+6,0.42090324
+0,0,3,0.5
+1
+0,1.0
+1,0,3,0.5
+1
+1,1.0
+2,0,3,0.5
+1
+2,1.0
+3,0,3,0.5
+1
+3,1.0
+4,0,3,0.5
+3
+4,0.9045341
+5,0.3015113
+6,0.3015113
+5,0,3,0.5
+3
+5,0.9045341
+4,0.3015113
+7,0.3015113
+6,0,3,0.5
+3
+6,0.9045341
+4,0.3015113
+7,0.3015113
+7,0,3,0.5
+3
+7,0.9045341
+5,0.3015113
+6,0.3015113
+0,0,3,0.7
+1
+0,1.0
+1,0,3,0.7
+1
+1,1.0
+2,0,3,0.7
+1
+2,1.0
+3,0,3,0.7
+1
+3,1.0
+4,0,3,0.7
+1
+4,1.0
+5,0,3,0.7
+1
+5,1.0
+6,0,3,0.7
+1
+6,1.0
+7,0,3,0.7
+1
+7,1.0
+0,0,3,0.9
+1
+0,1.0
+1,0,3,0.9
+1
+1,1.0
+2,0,3,0.9
+1
+2,1.0
+3,0,3,0.9
+1
+3,1.0
+4,0,3,0.9
+1
+4,1.0
+5,0,3,0.9
+1
+5,1.0
+6,0,3,0.9
+1
+6,1.0
+7,0,3,0.9
+1
+7,1.0
+0,0,4,0.1
+1
+0,1.0
+1,0,4,0.1
+1
+1,1.0
+2,0,4,0.1
+4
+2,0.7924058
+3,0.35218036
+4,0.35218036
+5,0.35218036
+3,0,4,0.1
+4
+3,0.79240584
+2,0.3521804
+5,0.3521804
+6,0.3521804
+4,0,4,0.1
+4
+4,0.7088104
+5,0.44628802
+6,0.44628802
+2,0.31502685
+5,0,4,0.1
+4
+5,0.7088104
+4,0.44628802
+7,0.44628802
+2,0.31502685
+6,0,4,0.1
+4
+6,0.7088104
+4,0.44628802
+7,0.44628802
+2,0.31502685
+7,0,4,0.1
+4
+7,0.7088104
+5,0.44628802
+6,0.44628802
+3,0.31502685
+0,0,4,0.3
+1
+0,1.0
+1,0,4,0.3
+1
+1,1.0
+2,0,4,0.3
+4
+2,0.8962582
+3,0.25607374
+4,0.25607374
+5,0.25607374
+3,0,4,0.3
+4
+3,0.8962582
+2,0.25607374
+5,0.25607374
+6,0.25607374
+4,0,4,0.3
+4
+4,0.7831679
+5,0.41023073
+6,0.41023073
+2,0.22376224
+5,0,4,0.3
+4
+5,0.7831679
+4,0.41023073
+7,0.41023073
+2,0.22376224
+6,0,4,0.3
+4
+6,0.7831679
+4,0.41023073
+7,0.41023073
+2,0.22376224
+7,0,4,0.3
+4
+7,0.7831679
+5,0.41023073
+6,0.41023073
+3,0.22376224
+0,0,4,0.5
+1
+0,1.0
+1,0,4,0.5
+1
+1,1.0
+2,0,4,0.5
+1
+2,1.0
+3,0,4,0.5
+1
+3,1.0
+4,0,4,0.5
+3
+4,0.9045341
+5,0.3015113
+6,0.3015113
+5,0,4,0.5
+3
+5,0.9045341
+4,0.3015113
+7,0.3015113
+6,0,4,0.5
+3
+6,0.9045341
+4,0.3015113
+7,0.3015113
+7,0,4,0.5
+3
+7,0.9045341
+5,0.3015113
+6,0.3015113
+0,0,4,0.7
+1
+0,1.0
+1,0,4,0.7
+1
+1,1.0
+2,0,4,0.7
+1
+2,1.0
+3,0,4,0.7
+1
+3,1.0
+4,0,4,0.7
+1
+4,1.0
+5,0,4,0.7
+1
+5,1.0
+6,0,4,0.7
+1
+6,1.0
+7,0,4,0.7
+1
+7,1.0
+0,0,4,0.9
+1
+0,1.0
+1,0,4,0.9
+1
+1,1.0
+2,0,4,0.9
+1
+2,1.0
+3,0,4,0.9
+1
+3,1.0
+4,0,4,0.9
+1
+4,1.0
+5,0,4,0.9
+1
+5,1.0
+6,0,4,0.9
+1
+6,1.0
+7,0,4,0.9
+1
+7,1.0
+0,0,5,0.1
+1
+0,1.0
+1,0,5,0.1
+1
+1,1.0
+2,0,5,0.1
+5
+2,0.7474093
+3,0.33218193
+4,0.33218193
+5,0.33218193
+6,0.33218193
+3,0,5,0.1
+5
+3,0.74740934
+2,0.33218196
+5,0.33218196
+6,0.33218196
+7,0.33218196
+4,0,5,0.1
+5
+4,0.697137
+5,0.4389381
+6,0.4389381
+2,0.30983868
+7,0.18073922
+5,0,5,0.1
+5
+5,0.67605716
+4,0.42566562
+7,0.42566562
+2,0.30046988
+3,0.30046988
+6,0,5,0.1
+5
+6,0.67605716
+4,0.42566562
+7,0.42566562
+2,0.30046988
+3,0.30046988
+7,0,5,0.1
+5
+7,0.697137
+5,0.4389381
+6,0.4389381
+3,0.30983868
+4,0.18073922
+0,0,5,0.3
+1
+0,1.0
+1,0,5,0.3
+1
+1,1.0
+2,0,5,0.3
+5
+2,0.86824316
+3,0.24806947
+4,0.24806947
+5,0.24806947
+6,0.24806947
+3,0,5,0.3
+5
+3,0.8682432
+2,0.24806948
+5,0.24806948
+6,0.24806948
+7,0.24806948
+4,0,5,0.3
+5
+4,0.7826238
+5,0.40994576
+6,0.40994576
+2,0.2236068
+7,0.037267767
+5,0,5,0.3
+5
+5,0.7642683
+4,0.40033093
+7,0.40033093
+2,0.21836235
+3,0.21836235
+6,0,5,0.3
+5
+6,0.7642683
+4,0.40033093
+7,0.40033093
+2,0.21836235
+3,0.21836235
+7,0,5,0.3
+5
+7,0.7826238
+5,0.40994576
+6,0.40994576
+3,0.2236068
+4,0.037267767
+0,0,5,0.5
+1
+0,1.0
+1,0,5,0.5
+1
+1,1.0
+2,0,5,0.5
+1
+2,1.0
+3,0,5,0.5
+1
+3,1.0
+4,0,5,0.5
+3
+4,0.9045341
+5,0.3015113
+6,0.3015113
+5,0,5,0.5
+3
+5,0.9045341
+4,0.3015113
+7,0.3015113
+6,0,5,0.5
+3
+6,0.9045341
+4,0.3015113
+7,0.3015113
+7,0,5,0.5
+3
+7,0.9045341
+5,0.3015113
+6,0.3015113
+0,0,5,0.7
+1
+0,1.0
+1,0,5,0.7
+1
+1,1.0
+2,0,5,0.7
+1
+2,1.0
+3,0,5,0.7
+1
+3,1.0
+4,0,5,0.7
+1
+4,1.0
+5,0,5,0.7
+1
+5,1.0
+6,0,5,0.7
+1
+6,1.0
+7,0,5,0.7
+1
+7,1.0
+0,0,5,0.9
+1
+0,1.0
+1,0,5,0.9
+1
+1,1.0
+2,0,5,0.9
+1
+2,1.0
+3,0,5,0.9
+1
+3,1.0
+4,0,5,0.9
+1
+4,1.0
+5,0,5,0.9
+1
+5,1.0
+6,0,5,0.9
+1
+6,1.0
+7,0,5,0.9
+1
+7,1.0
+0,0,6,0.1
+1
+0,1.0
+1,0,6,0.1
+1
+1,1.0
+2,0,6,0.1
+5
+2,0.7474093
+3,0.33218193
+4,0.33218193
+5,0.33218193
+6,0.33218193
+3,0,6,0.1
+5
+3,0.74740934
+2,0.33218196
+5,0.33218196
+6,0.33218196
+7,0.33218196
+4,0,6,0.1
+5
+4,0.697137
+5,0.4389381
+6,0.4389381
+2,0.30983868
+7,0.18073922
+5,0,6,0.1
+6
+5,0.6659059
+4,0.41927406
+7,0.41927406
+2,0.2959582
+3,0.2959582
+6,0.17264226
+6,0,6,0.1
+6
+6,0.6659059
+4,0.41927406
+7,0.41927406
+2,0.2959582
+3,0.2959582
+5,0.17264226
+7,0,6,0.1
+5
+7,0.697137
+5,0.4389381
+6,0.4389381
+3,0.30983868
+4,0.18073922
+0,0,6,0.3
+1
+0,1.0
+1,0,6,0.3
+1
+1,1.0
+2,0,6,0.3
+5
+2,0.86824316
+3,0.24806947
+4,0.24806947
+5,0.24806947
+6,0.24806947
+3,0,6,0.3
+5
+3,0.8682432
+2,0.24806948
+5,0.24806948
+6,0.24806948
+7,0.24806948
+4,0,6,0.3
+5
+4,0.7826238
+5,0.40994576
+6,0.40994576
+2,0.2236068
+7,0.037267767
+5,0,6,0.3
+6
+5,0.76376265
+4,0.40006608
+7,0.40006608
+2,0.2182179
+3,0.2182179
+6,0.036369618
+6,0,6,0.3
+6
+6,0.76376265
+4,0.40006608
+7,0.40006608
+2,0.2182179
+3,0.2182179
+5,0.036369618
+7,0,6,0.3
+5
+7,0.7826238
+5,0.40994576
+6,0.40994576
+3,0.2236068
+4,0.037267767
+0,0,6,0.5
+1
+0,1.0
+1,0,6,0.5
+1
+1,1.0
+2,0,6,0.5
+1
+2,1.0
+3,0,6,0.5
+1
+3,1.0
+4,0,6,0.5
+3
+4,0.9045341
+5,0.3015113
+6,0.3015113
+5,0,6,0.5
+3
+5,0.9045341
+4,0.3015113
+7,0.3015113
+6,0,6,0.5
+3
+6,0.9045341
+4,0.3015113
+7,0.3015113
+7,0,6,0.5
+3
+7,0.9045341
+5,0.3015113
+6,0.3015113
+0,0,6,0.7
+1
+0,1.0
+1,0,6,0.7
+1
+1,1.0
+2,0,6,0.7
+1
+2,1.0
+3,0,6,0.7
+1
+3,1.0
+4,0,6,0.7
+1
+4,1.0
+5,0,6,0.7
+1
+5,1.0
+6,0,6,0.7
+1
+6,1.0
+7,0,6,0.7
+1
+7,1.0
+0,0,6,0.9
+1
+0,1.0
+1,0,6,0.9
+1
+1,1.0
+2,0,6,0.9
+1
+2,1.0
+3,0,6,0.9
+1
+3,1.0
+4,0,6,0.9
+1
+4,1.0
+5,0,6,0.9
+1
+5,1.0
+6,0,6,0.9
+1
+6,1.0
+7,0,6,0.9
+1
+7,1.0
+0,0,7,0.1
+1
+0,1.0
+1,0,7,0.1
+1
+1,1.0
+2,0,7,0.1
+5
+2,0.7474093
+3,0.33218193
+4,0.33218193
+5,0.33218193
+6,0.33218193
+3,0,7,0.1
+5
+3,0.74740934
+2,0.33218196
+5,0.33218196
+6,0.33218196
+7,0.33218196
+4,0,7,0.1
+5
+4,0.697137
+5,0.4389381
+6,0.4389381
+2,0.30983868
+7,0.18073922
+5,0,7,0.1
+6
+5,0.6659059
+4,0.41927406
+7,0.41927406
+2,0.2959582
+3,0.2959582
+6,0.17264226
+6,0,7,0.1
+6
+6,0.6659059
+4,0.41927406
+7,0.41927406
+2,0.2959582
+3,0.2959582
+5,0.17264226
+7,0,7,0.1
+5
+7,0.697137
+5,0.4389381
+6,0.4389381
+3,0.30983868
+4,0.18073922
+0,0,7,0.3
+1
+0,1.0
+1,0,7,0.3
+1
+1,1.0
+2,0,7,0.3
+5
+2,0.86824316
+3,0.24806947
+4,0.24806947
+5,0.24806947
+6,0.24806947
+3,0,7,0.3
+5
+3,0.8682432
+2,0.24806948
+5,0.24806948
+6,0.24806948
+7,0.24806948
+4,0,7,0.3
+5
+4,0.7826238
+5,0.40994576
+6,0.40994576
+2,0.2236068
+7,0.037267767
+5,0,7,0.3
+6
+5,0.76376265
+4,0.40006608
+7,0.40006608
+2,0.2182179
+3,0.2182179
+6,0.036369618
+6,0,7,0.3
+6
+6,0.76376265
+4,0.40006608
+7,0.40006608
+2,0.2182179
+3,0.2182179
+5,0.036369618
+7,0,7,0.3
+5
+7,0.7826238
+5,0.40994576
+6,0.40994576
+3,0.2236068
+4,0.037267767
+0,0,7,0.5
+1
+0,1.0
+1,0,7,0.5
+1
+1,1.0
+2,0,7,0.5
+1
+2,1.0
+3,0,7,0.5
+1
+3,1.0
+4,0,7,0.5
+3
+4,0.9045341
+5,0.3015113
+6,0.3015113
+5,0,7,0.5
+3
+5,0.9045341
+4,0.3015113
+7,0.3015113
+6,0,7,0.5
+3
+6,0.9045341
+4,0.3015113
+7,0.3015113
+7,0,7,0.5
+3
+7,0.9045341
+5,0.3015113
+6,0.3015113
+0,0,7,0.7
+1
+0,1.0
+1,0,7,0.7
+1
+1,1.0
+2,0,7,0.7
+1
+2,1.0
+3,0,7,0.7
+1
+3,1.0
+4,0,7,0.7
+1
+4,1.0
+5,0,7,0.7
+1
+5,1.0
+6,0,7,0.7
+1
+6,1.0
+7,0,7,0.7
+1
+7,1.0
+0,0,7,0.9
+1
+0,1.0
+1,0,7,0.9
+1
+1,1.0
+2,0,7,0.9
+1
+2,1.0
+3,0,7,0.9
+1
+3,1.0
+4,0,7,0.9
+1
+4,1.0
+5,0,7,0.9
+1
+5,1.0
+6,0,7,0.9
+1
+6,1.0
+7,0,7,0.9
+1
+7,1.0
+0,0,8,0.1
+1
+0,1.0
+1,0,8,0.1
+1
+1,1.0
+2,0,8,0.1
+5
+2,0.7474093
+3,0.33218193
+4,0.33218193
+5,0.33218193
+6,0.33218193
+3,0,8,0.1
+5
+3,0.74740934
+2,0.33218196
+5,0.33218196
+6,0.33218196
+7,0.33218196
+4,0,8,0.1
+5
+4,0.697137
+5,0.4389381
+6,0.4389381
+2,0.30983868
+7,0.18073922
+5,0,8,0.1
+6
+5,0.6659059
+4,0.41927406
+7,0.41927406
+2,0.2959582
+3,0.2959582
+6,0.17264226
+6,0,8,0.1
+6
+6,0.6659059
+4,0.41927406
+7,0.41927406
+2,0.2959582
+3,0.2959582
+5,0.17264226
+7,0,8,0.1
+5
+7,0.697137
+5,0.4389381
+6,0.4389381
+3,0.30983868
+4,0.18073922
+0,0,8,0.3
+1
+0,1.0
+1,0,8,0.3
+1
+1,1.0
+2,0,8,0.3
+5
+2,0.86824316
+3,0.24806947
+4,0.24806947
+5,0.24806947
+6,0.24806947
+3,0,8,0.3
+5
+3,0.8682432
+2,0.24806948
+5,0.24806948
+6,0.24806948
+7,0.24806948
+4,0,8,0.3
+5
+4,0.7826238
+5,0.40994576
+6,0.40994576
+2,0.2236068
+7,0.037267767
+5,0,8,0.3
+6
+5,0.76376265
+4,0.40006608
+7,0.40006608
+2,0.2182179
+3,0.2182179
+6,0.036369618
+6,0,8,0.3
+6
+6,0.76376265
+4,0.40006608
+7,0.40006608
+2,0.2182179
+3,0.2182179
+5,0.036369618
+7,0,8,0.3
+5
+7,0.7826238
+5,0.40994576
+6,0.40994576
+3,0.2236068
+4,0.037267767
+0,0,8,0.5
+1
+0,1.0
+1,0,8,0.5
+1
+1,1.0
+2,0,8,0.5
+1
+2,1.0
+3,0,8,0.5
+1
+3,1.0
+4,0,8,0.5
+3
+4,0.9045341
+5,0.3015113
+6,0.3015113
+5,0,8,0.5
+3
+5,0.9045341
+4,0.3015113
+7,0.3015113
+6,0,8,0.5
+3
+6,0.9045341
+4,0.3015113
+7,0.3015113
+7,0,8,0.5
+3
+7,0.9045341
+5,0.3015113
+6,0.3015113
+0,0,8,0.7
+1
+0,1.0
+1,0,8,0.7
+1
+1,1.0
+2,0,8,0.7
+1
+2,1.0
+3,0,8,0.7
+1
+3,1.0
+4,0,8,0.7
+1
+4,1.0
+5,0,8,0.7
+1
+5,1.0
+6,0,8,0.7
+1
+6,1.0
+7,0,8,0.7
+1
+7,1.0
+0,0,8,0.9
+1
+0,1.0
+1,0,8,0.9
+1
+1,1.0
+2,0,8,0.9
+1
+2,1.0
+3,0,8,0.9
+1
+3,1.0
+4,0,8,0.9
+1
+4,1.0
+5,0,8,0.9
+1
+5,1.0
+6,0,8,0.9
+1
+6,1.0
+7,0,8,0.9
+1
+7,1.0
+0,1,1,0.1
+1
+0,1.0
+1,1,1,0.1
+1
+1,1.0
+2,1,1,0.1
+1
+2,1.0
+3,1,1,0.1
+1
+3,1.0
+4,1,1,0.1
+1
+4,1.0
+5,1,1,0.1
+1
+5,1.0
+6,1,1,0.1
+1
+6,1.0
+7,1,1,0.1
+1
+7,1.0
+0,1,1,0.3
+1
+0,1.0
+1,1,1,0.3
+1
+1,1.0
+2,1,1,0.3
+1
+2,1.0
+3,1,1,0.3
+1
+3,1.0
+4,1,1,0.3
+1
+4,1.0
+5,1,1,0.3
+1
+5,1.0
+6,1,1,0.3
+1
+6,1.0
+7,1,1,0.3
+1
+7,1.0
+0,1,1,0.5
+1
+0,1.0
+1,1,1,0.5
+1
+1,1.0
+2,1,1,0.5
+1
+2,1.0
+3,1,1,0.5
+1
+3,1.0
+4,1,1,0.5
+1
+4,1.0
+5,1,1,0.5
+1
+5,1.0
+6,1,1,0.5
+1
+6,1.0
+7,1,1,0.5
+1
+7,1.0
+0,1,1,0.7
+1
+0,1.0
+1,1,1,0.7
+1
+1,1.0
+2,1,1,0.7
+1
+2,1.0
+3,1,1,0.7
+1
+3,1.0
+4,1,1,0.7
+1
+4,1.0
+5,1,1,0.7
+1
+5,1.0
+6,1,1,0.7
+1
+6,1.0
+7,1,1,0.7
+1
+7,1.0
+0,1,1,0.9
+1
+0,1.0
+1,1,1,0.9
+1
+1,1.0
+2,1,1,0.9
+1
+2,1.0
+3,1,1,0.9
+1
+3,1.0
+4,1,1,0.9
+1
+4,1.0
+5,1,1,0.9
+1
+5,1.0
+6,1,1,0.9
+1
+6,1.0
+7,1,1,0.9
+1
+7,1.0
+0,1,2,0.1
+1
+0,1.0
+1,1,2,0.1
+1
+1,1.0
+2,1,2,0.1
+2
+2,0.91381156
+4,0.4061385
+3,1,2,0.1
+2
+3,0.91381156
+2,0.4061385
+4,1,2,0.1
+2
+4,0.84623283
+5,0.53281325
+5,1,2,0.1
+2
+5,0.84623283
+4,0.53281325
+6,1,2,0.1
+2
+6,0.84623283
+4,0.53281325
+7,1,2,0.1
+2
+7,0.84623283
+5,0.53281325
+0,1,2,0.3
+1
+0,1.0
+1,1,2,0.3
+1
+1,1.0
+2,1,2,0.3
+2
+2,0.96152395
+4,0.27472112
+3,1,2,0.3
+2
+3,0.96152395
+2,0.27472112
+4,1,2,0.3
+2
+4,0.88583153
+5,0.4640069
+5,1,2,0.3
+2
+5,0.88583153
+4,0.4640069
+6,1,2,0.3
+2
+6,0.88583153
+4,0.4640069
+7,1,2,0.3
+2
+7,0.88583153
+5,0.4640069
+0,1,2,0.5
+1
+0,1.0
+1,1,2,0.5
+1
+1,1.0
+2,1,2,0.5
+1
+2,1.0
+3,1,2,0.5
+1
+3,1.0
+4,1,2,0.5
+2
+4,0.9486833
+5,0.3162277
+5,1,2,0.5
+2
+5,0.9486833
+4,0.3162277
+6,1,2,0.5
+2
+6,0.9486833
+4,0.3162277
+7,1,2,0.5
+2
+7,0.9486833
+5,0.3162277
+0,1,2,0.7
+1
+0,1.0
+1,1,2,0.7
+1
+1,1.0
+2,1,2,0.7
+1
+2,1.0
+3,1,2,0.7
+1
+3,1.0
+4,1,2,0.7
+1
+4,1.0
+5,1,2,0.7
+1
+5,1.0
+6,1,2,0.7
+1
+6,1.0
+7,1,2,0.7
+1
+7,1.0
+0,1,2,0.9
+1
+0,1.0
+1,1,2,0.9
+1
+1,1.0
+2,1,2,0.9
+1
+2,1.0
+3,1,2,0.9
+1
+3,1.0
+4,1,2,0.9
+1
+4,1.0
+5,1,2,0.9
+1
+5,1.0
+6,1,2,0.9
+1
+6,1.0
+7,1,2,0.9
+1
+7,1.0
+0,1,3,0.1
+1
+0,1.0
+1,1,3,0.1
+1
+1,1.0
+2,1,3,0.1
+3
+2,0.84664875
+4,0.37628835
+5,0.37628835
+3,1,3,0.1
+3
+3,0.84664875
+2,0.37628835
+5,0.37628835
+4,1,3,0.1
+3
+4,0.74683726
+5,0.47023085
+6,0.47023085
+5,1,3,0.1
+3
+5,0.74683726
+4,0.47023085
+7,0.47023085
+6,1,3,0.1
+3
+6,0.74683726
+4,0.47023085
+7,0.47023085
+7,1,3,0.1
+3
+7,0.74683726
+5,0.47023085
+6,0.47023085
+0,1,3,0.3
+1
+0,1.0
+1,1,3,0.3
+1
+1,1.0
+2,1,3,0.3
+3
+2,0.92717266
+4,0.26490647
+5,0.26490647
+3,1,3,0.3
+3
+3,0.92717266
+2,0.26490647
+5,0.26490647
+4,1,3,0.3
+3
+4,0.8035427
+5,0.42090324
+6,0.42090324
+5,1,3,0.3
+3
+5,0.80354273
+4,0.42090327
+7,0.42090327
+6,1,3,0.3
+3
+6,0.80354273
+4,0.42090327
+7,0.42090327
+7,1,3,0.3
+3
+7,0.8035427
+5,0.42090324
+6,0.42090324
+0,1,3,0.5
+1
+0,1.0
+1,1,3,0.5
+1
+1,1.0
+2,1,3,0.5
+1
+2,1.0
+3,1,3,0.5
+1
+3,1.0
+4,1,3,0.5
+3
+4,0.9045341
+5,0.3015113
+6,0.3015113
+5,1,3,0.5
+3
+5,0.9045341
+4,0.3015113
+7,0.3015113
+6,1,3,0.5
+3
+6,0.9045341
+4,0.3015113
+7,0.3015113
+7,1,3,0.5
+3
+7,0.9045341
+5,0.3015113
+6,0.3015113
+0,1,3,0.7
+1
+0,1.0
+1,1,3,0.7
+1
+1,1.0
+2,1,3,0.7
+1
+2,1.0
+3,1,3,0.7
+1
+3,1.0
+4,1,3,0.7
+1
+4,1.0
+5,1,3,0.7
+1
+5,1.0
+6,1,3,0.7
+1
+6,1.0
+7,1,3,0.7
+1
+7,1.0
+0,1,3,0.9
+1
+0,1.0
+1,1,3,0.9
+1
+1,1.0
+2,1,3,0.9
+1
+2,1.0
+3,1,3,0.9
+1
+3,1.0
+4,1,3,0.9
+1
+4,1.0
+5,1,3,0.9
+1
+5,1.0
+6,1,3,0.9
+1
+6,1.0
+7,1,3,0.9
+1
+7,1.0
+0,1,4,0.1
+1
+0,1.0
+1,1,4,0.1
+1
+1,1.0
+2,1,4,0.1
+4
+2,0.7924058
+3,0.35218036
+4,0.35218036
+5,0.35218036
+3,1,4,0.1
+4
+3,0.79240584
+2,0.3521804
+5,0.3521804
+6,0.3521804
+4,1,4,0.1
+4
+4,0.7088104
+5,0.44628802
+6,0.44628802
+2,0.31502685
+5,1,4,0.1
+4
+5,0.7088104
+4,0.44628802
+7,0.44628802
+2,0.31502685
+6,1,4,0.1
+4
+6,0.7088104
+4,0.44628802
+7,0.44628802
+2,0.31502685
+7,1,4,0.1
+4
+7,0.7088104
+5,0.44628802
+6,0.44628802
+3,0.31502685
+0,1,4,0.3
+1
+0,1.0
+1,1,4,0.3
+1
+1,1.0
+2,1,4,0.3
+4
+2,0.8962582
+3,0.25607374
+4,0.25607374
+5,0.25607374
+3,1,4,0.3
+4
+3,0.8962582
+2,0.25607374
+5,0.25607374
+6,0.25607374
+4,1,4,0.3
+4
+4,0.7831679
+5,0.41023073
+6,0.41023073
+2,0.22376224
+5,1,4,0.3
+4
+5,0.7831679
+4,0.41023073
+7,0.41023073
+2,0.22376224
+6,1,4,0.3
+4
+6,0.7831679
+4,0.41023073
+7,0.41023073
+2,0.22376224
+7,1,4,0.3
+4
+7,0.7831679
+5,0.41023073
+6,0.41023073
+3,0.22376224
+0,1,4,0.5
+1
+0,1.0
+1,1,4,0.5
+1
+1,1.0
+2,1,4,0.5
+1
+2,1.0
+3,1,4,0.5
+1
+3,1.0
+4,1,4,0.5
+3
+4,0.9045341
+5,0.3015113
+6,0.3015113
+5,1,4,0.5
+3
+5,0.9045341
+4,0.3015113
+7,0.3015113
+6,1,4,0.5
+3
+6,0.9045341
+4,0.3015113
+7,0.3015113
+7,1,4,0.5
+3
+7,0.9045341
+5,0.3015113
+6,0.3015113
+0,1,4,0.7
+1
+0,1.0
+1,1,4,0.7
+1
+1,1.0
+2,1,4,0.7
+1
+2,1.0
+3,1,4,0.7
+1
+3,1.0
+4,1,4,0.7
+1
+4,1.0
+5,1,4,0.7
+1
+5,1.0
+6,1,4,0.7
+1
+6,1.0
+7,1,4,0.7
+1
+7,1.0
+0,1,4,0.9
+1
+0,1.0
+1,1,4,0.9
+1
+1,1.0
+2,1,4,0.9
+1
+2,1.0
+3,1,4,0.9
+1
+3,1.0
+4,1,4,0.9
+1
+4,1.0
+5,1,4,0.9
+1
+5,1.0
+6,1,4,0.9
+1
+6,1.0
+7,1,4,0.9
+1
+7,1.0
+0,1,5,0.1
+1
+0,1.0
+1,1,5,0.1
+1
+1,1.0
+2,1,5,0.1
+5
+2,0.7474093
+3,0.33218193
+4,0.33218193
+5,0.33218193
+6,0.33218193
+3,1,5,0.1
+5
+3,0.74740934
+2,0.33218196
+5,0.33218196
+6,0.33218196
+7,0.33218196
+4,1,5,0.1
+5
+4,0.697137
+5,0.4389381
+6,0.4389381
+2,0.30983868
+7,0.18073922
+5,1,5,0.1
+5
+5,0.67605716
+4,0.42566562
+7,0.42566562
+2,0.30046988
+3,0.30046988
+6,1,5,0.1
+5
+6,0.67605716
+4,0.42566562
+7,0.42566562
+2,0.30046988
+3,0.30046988
+7,1,5,0.1
+5
+7,0.697137
+5,0.4389381
+6,0.4389381
+3,0.30983868
+4,0.18073922
+0,1,5,0.3
+1
+0,1.0
+1,1,5,0.3
+1
+1,1.0
+2,1,5,0.3
+5
+2,0.86824316
+3,0.24806947
+4,0.24806947
+5,0.24806947
+6,0.24806947
+3,1,5,0.3
+5
+3,0.8682432
+2,0.24806948
+5,0.24806948
+6,0.24806948
+7,0.24806948
+4,1,5,0.3
+5
+4,0.7826238
+5,0.40994576
+6,0.40994576
+2,0.2236068
+7,0.037267767
+5,1,5,0.3
+5
+5,0.7642683
+4,0.40033093
+7,0.40033093
+2,0.21836235
+3,0.21836235
+6,1,5,0.3
+5
+6,0.7642683
+4,0.40033093
+7,0.40033093
+2,0.21836235
+3,0.21836235
+7,1,5,0.3
+5
+7,0.7826238
+5,0.40994576
+6,0.40994576
+3,0.2236068
+4,0.037267767
+0,1,5,0.5
+1
+0,1.0
+1,1,5,0.5
+1
+1,1.0
+2,1,5,0.5
+1
+2,1.0
+3,1,5,0.5
+1
+3,1.0
+4,1,5,0.5
+3
+4,0.9045341
+5,0.3015113
+6,0.3015113
+5,1,5,0.5
+3
+5,0.9045341
+4,0.3015113
+7,0.3015113
+6,1,5,0.5
+3
+6,0.9045341
+4,0.3015113
+7,0.3015113
+7,1,5,0.5
+3
+7,0.9045341
+5,0.3015113
+6,0.3015113
+0,1,5,0.7
+1
+0,1.0
+1,1,5,0.7
+1
+1,1.0
+2,1,5,0.7
+1
+2,1.0
+3,1,5,0.7
+1
+3,1.0
+4,1,5,0.7
+1
+4,1.0
+5,1,5,0.7
+1
+5,1.0
+6,1,5,0.7
+1
+6,1.0
+7,1,5,0.7
+1
+7,1.0
+0,1,5,0.9
+1
+0,1.0
+1,1,5,0.9
+1
+1,1.0
+2,1,5,0.9
+1
+2,1.0
+3,1,5,0.9
+1
+3,1.0
+4,1,5,0.9
+1
+4,1.0
+5,1,5,0.9
+1
+5,1.0
+6,1,5,0.9
+1
+6,1.0
+7,1,5,0.9
+1
+7,1.0
+0,1,6,0.1
+1
+0,1.0
+1,1,6,0.1
+1
+1,1.0
+2,1,6,0.1
+5
+2,0.7474093
+3,0.33218193
+4,0.33218193
+5,0.33218193
+6,0.33218193
+3,1,6,0.1
+5
+3,0.74740934
+2,0.33218196
+5,0.33218196
+6,0.33218196
+7,0.33218196
+4,1,6,0.1
+5
+4,0.697137
+5,0.4389381
+6,0.4389381
+2,0.30983868
+7,0.18073922
+5,1,6,0.1
+6
+5,0.6659059
+4,0.41927406
+7,0.41927406
+2,0.2959582
+3,0.2959582
+6,0.17264226
+6,1,6,0.1
+6
+6,0.6659059
+4,0.41927406
+7,0.41927406
+2,0.2959582
+3,0.2959582
+5,0.17264226
+7,1,6,0.1
+5
+7,0.697137
+5,0.4389381
+6,0.4389381
+3,0.30983868
+4,0.18073922
+0,1,6,0.3
+1
+0,1.0
+1,1,6,0.3
+1
+1,1.0
+2,1,6,0.3
+5
+2,0.86824316
+3,0.24806947
+4,0.24806947
+5,0.24806947
+6,0.24806947
+3,1,6,0.3
+5
+3,0.8682432
+2,0.24806948
+5,0.24806948
+6,0.24806948
+7,0.24806948
+4,1,6,0.3
+5
+4,0.7826238
+5,0.40994576
+6,0.40994576
+2,0.2236068
+7,0.037267767
+5,1,6,0.3
+6
+5,0.76376265
+4,0.40006608
+7,0.40006608
+2,0.2182179
+3,0.2182179
+6,0.036369618
+6,1,6,0.3
+6
+6,0.76376265
+4,0.40006608
+7,0.40006608
+2,0.2182179
+3,0.2182179
+5,0.036369618
+7,1,6,0.3
+5
+7,0.7826238
+5,0.40994576
+6,0.40994576
+3,0.2236068
+4,0.037267767
+0,1,6,0.5
+1
+0,1.0
+1,1,6,0.5
+1
+1,1.0
+2,1,6,0.5
+1
+2,1.0
+3,1,6,0.5
+1
+3,1.0
+4,1,6,0.5
+3
+4,0.9045341
+5,0.3015113
+6,0.3015113
+5,1,6,0.5
+3
+5,0.9045341
+4,0.3015113
+7,0.3015113
+6,1,6,0.5
+3
+6,0.9045341
+4,0.3015113
+7,0.3015113
+7,1,6,0.5
+3
+7,0.9045341
+5,0.3015113
+6,0.3015113
+0,1,6,0.7
+1
+0,1.0
+1,1,6,0.7
+1
+1,1.0
+2,1,6,0.7
+1
+2,1.0
+3,1,6,0.7
+1
+3,1.0
+4,1,6,0.7
+1
+4,1.0
+5,1,6,0.7
+1
+5,1.0
+6,1,6,0.7
+1
+6,1.0
+7,1,6,0.7
+1
+7,1.0
+0,1,6,0.9
+1
+0,1.0
+1,1,6,0.9
+1
+1,1.0
+2,1,6,0.9
+1
+2,1.0
+3,1,6,0.9
+1
+3,1.0
+4,1,6,0.9
+1
+4,1.0
+5,1,6,0.9
+1
+5,1.0
+6,1,6,0.9
+1
+6,1.0
+7,1,6,0.9
+1
+7,1.0
+0,1,7,0.1
+1
+0,1.0
+1,1,7,0.1
+1
+1,1.0
+2,1,7,0.1
+5
+2,0.7474093
+3,0.33218193
+4,0.33218193
+5,0.33218193
+6,0.33218193
+3,1,7,0.1
+5
+3,0.74740934
+2,0.33218196
+5,0.33218196
+6,0.33218196
+7,0.33218196
+4,1,7,0.1
+5
+4,0.697137
+5,0.4389381
+6,0.4389381
+2,0.30983868
+7,0.18073922
+5,1,7,0.1
+6
+5,0.6659059
+4,0.41927406
+7,0.41927406
+2,0.2959582
+3,0.2959582
+6,0.17264226
+6,1,7,0.1
+6
+6,0.6659059
+4,0.41927406
+7,0.41927406
+2,0.2959582
+3,0.2959582
+5,0.17264226
+7,1,7,0.1
+5
+7,0.697137
+5,0.4389381
+6,0.4389381
+3,0.30983868
+4,0.18073922
+0,1,7,0.3
+1
+0,1.0
+1,1,7,0.3
+1
+1,1.0
+2,1,7,0.3
+5
+2,0.86824316
+3,0.24806947
+4,0.24806947
+5,0.24806947
+6,0.24806947
+3,1,7,0.3
+5
+3,0.8682432
+2,0.24806948
+5,0.24806948
+6,0.24806948
+7,0.24806948
+4,1,7,0.3
+5
+4,0.7826238
+5,0.40994576
+6,0.40994576
+2,0.2236068
+7,0.037267767
+5,1,7,0.3
+6
+5,0.76376265
+4,0.40006608
+7,0.40006608
+2,0.2182179
+3,0.2182179
+6,0.036369618
+6,1,7,0.3
+6
+6,0.76376265
+4,0.40006608
+7,0.40006608
+2,0.2182179
+3,0.2182179
+5,0.036369618
+7,1,7,0.3
+5
+7,0.7826238
+5,0.40994576
+6,0.40994576
+3,0.2236068
+4,0.037267767
+0,1,7,0.5
+1
+0,1.0
+1,1,7,0.5
+1
+1,1.0
+2,1,7,0.5
+1
+2,1.0
+3,1,7,0.5
+1
+3,1.0
+4,1,7,0.5
+3
+4,0.9045341
+5,0.3015113
+6,0.3015113
+5,1,7,0.5
+3
+5,0.9045341
+4,0.3015113
+7,0.3015113
+6,1,7,0.5
+3
+6,0.9045341
+4,0.3015113
+7,0.3015113
+7,1,7,0.5
+3
+7,0.9045341
+5,0.3015113
+6,0.3015113
+0,1,7,0.7
+1
+0,1.0
+1,1,7,0.7
+1
+1,1.0
+2,1,7,0.7
+1
+2,1.0
+3,1,7,0.7
+1
+3,1.0
+4,1,7,0.7
+1
+4,1.0
+5,1,7,0.7
+1
+5,1.0
+6,1,7,0.7
+1
+6,1.0
+7,1,7,0.7
+1
+7,1.0
+0,1,7,0.9
+1
+0,1.0
+1,1,7,0.9
+1
+1,1.0
+2,1,7,0.9
+1
+2,1.0
+3,1,7,0.9
+1
+3,1.0
+4,1,7,0.9
+1
+4,1.0
+5,1,7,0.9
+1
+5,1.0
+6,1,7,0.9
+1
+6,1.0
+7,1,7,0.9
+1
+7,1.0
+0,1,8,0.1
+1
+0,1.0
+1,1,8,0.1
+1
+1,1.0
+2,1,8,0.1
+5
+2,0.7474093
+3,0.33218193
+4,0.33218193
+5,0.33218193
+6,0.33218193
+3,1,8,0.1
+5
+3,0.74740934
+2,0.33218196
+5,0.33218196
+6,0.33218196
+7,0.33218196
+4,1,8,0.1
+5
+4,0.697137
+5,0.4389381
+6,0.4389381
+2,0.30983868
+7,0.18073922
+5,1,8,0.1
+6
+5,0.6659059
+4,0.41927406
+7,0.41927406
+2,0.2959582
+3,0.2959582
+6,0.17264226
+6,1,8,0.1
+6
+6,0.6659059
+4,0.41927406
+7,0.41927406
+2,0.2959582
+3,0.2959582
+5,0.17264226
+7,1,8,0.1
+5
+7,0.697137
+5,0.4389381
+6,0.4389381
+3,0.30983868
+4,0.18073922
+0,1,8,0.3
+1
+0,1.0
+1,1,8,0.3
+1
+1,1.0
+2,1,8,0.3
+5
+2,0.86824316
+3,0.24806947
+4,0.24806947
+5,0.24806947
+6,0.24806947
+3,1,8,0.3
+5
+3,0.8682432
+2,0.24806948
+5,0.24806948
+6,0.24806948
+7,0.24806948
+4,1,8,0.3
+5
+4,0.7826238
+5,0.40994576
+6,0.40994576
+2,0.2236068
+7,0.037267767
+5,1,8,0.3
+6
+5,0.76376265
+4,0.40006608
+7,0.40006608
+2,0.2182179
+3,0.2182179
+6,0.036369618
+6,1,8,0.3
+6
+6,0.76376265
+4,0.40006608
+7,0.40006608
+2,0.2182179
+3,0.2182179
+5,0.036369618
+7,1,8,0.3
+5
+7,0.7826238
+5,0.40994576
+6,0.40994576
+3,0.2236068
+4,0.037267767
+0,1,8,0.5
+1
+0,1.0
+1,1,8,0.5
+1
+1,1.0
+2,1,8,0.5
+1
+2,1.0
+3,1,8,0.5
+1
+3,1.0
+4,1,8,0.5
+3
+4,0.9045341
+5,0.3015113
+6,0.3015113
+5,1,8,0.5
+3
+5,0.9045341
+4,0.3015113
+7,0.3015113
+6,1,8,0.5
+3
+6,0.9045341
+4,0.3015113
+7,0.3015113
+7,1,8,0.5
+3
+7,0.9045341
+5,0.3015113
+6,0.3015113
+0,1,8,0.7
+1
+0,1.0
+1,1,8,0.7
+1
+1,1.0
+2,1,8,0.7
+1
+2,1.0
+3,1,8,0.7
+1
+3,1.0
+4,1,8,0.7
+1
+4,1.0
+5,1,8,0.7
+1
+5,1.0
+6,1,8,0.7
+1
+6,1.0
+7,1,8,0.7
+1
+7,1.0
+0,1,8,0.9
+1
+0,1.0
+1,1,8,0.9
+1
+1,1.0
+2,1,8,0.9
+1
+2,1.0
+3,1,8,0.9
+1
+3,1.0
+4,1,8,0.9
+1
+4,1.0
+5,1,8,0.9
+1
+5,1.0
+6,1,8,0.9
+1
+6,1.0
+7,1,8,0.9
+1
+7,1.0
+0,2,1,0.1
+1
+0,1.0
+1,2,1,0.1
+1
+1,1.0
+2,2,1,0.1
+1
+2,1.0
+3,2,1,0.1
+1
+3,1.0
+4,2,1,0.1
+1
+4,1.0
+5,2,1,0.1
+1
+5,1.0
+6,2,1,0.1
+1
+6,1.0
+7,2,1,0.1
+1
+7,1.0
+0,2,1,0.3
+1
+0,1.0
+1,2,1,0.3
+1
+1,1.0
+2,2,1,0.3
+1
+2,1.0
+3,2,1,0.3
+1
+3,1.0
+4,2,1,0.3
+1
+4,1.0
+5,2,1,0.3
+1
+5,1.0
+6,2,1,0.3
+1
+6,1.0
+7,2,1,0.3
+1
+7,1.0
+0,2,1,0.5
+1
+0,1.0
+1,2,1,0.5
+1
+1,1.0
+2,2,1,0.5
+1
+2,1.0
+3,2,1,0.5
+1
+3,1.0
+4,2,1,0.5
+1
+4,1.0
+5,2,1,0.5
+1
+5,1.0
+6,2,1,0.5
+1
+6,1.0
+7,2,1,0.5
+1
+7,1.0
+0,2,1,0.7
+1
+0,1.0
+1,2,1,0.7
+1
+1,1.0
+2,2,1,0.7
+1
+2,1.0
+3,2,1,0.7
+1
+3,1.0
+4,2,1,0.7
+1
+4,1.0
+5,2,1,0.7
+1
+5,1.0
+6,2,1,0.7
+1
+6,1.0
+7,2,1,0.7
+1
+7,1.0
+0,2,1,0.9
+1
+0,1.0
+1,2,1,0.9
+1
+1,1.0
+2,2,1,0.9
+1
+2,1.0
+3,2,1,0.9
+1
+3,1.0
+4,2,1,0.9
+1
+4,1.0
+5,2,1,0.9
+1
+5,1.0
+6,2,1,0.9
+1
+6,1.0
+7,2,1,0.9
+1
+7,1.0
+0,2,2,0.1
+1
+0,1.0
+1,2,2,0.1
+1
+1,1.0
+2,2,2,0.1
+2
+2,0.91381156
+4,0.4061385
+3,2,2,0.1
+2
+3,0.91381156
+6,0.4061385
+4,2,2,0.1
+2
+4,0.84623283
+5,0.53281325
+5,2,2,0.1
+2
+5,0.84623283
+4,0.53281325
+6,2,2,0.1
+2
+6,0.84623283
+7,0.53281325
+7,2,2,0.1
+2
+7,0.84623283
+6,0.53281325
+0,2,2,0.3
+1
+0,1.0
+1,2,2,0.3
+1
+1,1.0
+2,2,2,0.3
+2
+2,0.96152395
+4,0.27472112
+3,2,2,0.3
+2
+3,0.96152395
+6,0.27472112
+4,2,2,0.3
+2
+4,0.88583153
+5,0.4640069
+5,2,2,0.3
+2
+5,0.88583153
+4,0.4640069
+6,2,2,0.3
+2
+6,0.88583153
+7,0.4640069
+7,2,2,0.3
+2
+7,0.88583153
+6,0.4640069
+0,2,2,0.5
+1
+0,1.0
+1,2,2,0.5
+1
+1,1.0
+2,2,2,0.5
+1
+2,1.0
+3,2,2,0.5
+1
+3,1.0
+4,2,2,0.5
+2
+4,0.9486833
+5,0.3162277
+5,2,2,0.5
+2
+5,0.9486833
+4,0.3162277
+6,2,2,0.5
+2
+6,0.9486833
+7,0.3162277
+7,2,2,0.5
+2
+7,0.9486833
+6,0.3162277
+0,2,2,0.7
+1
+0,1.0
+1,2,2,0.7
+1
+1,1.0
+2,2,2,0.7
+1
+2,1.0
+3,2,2,0.7
+1
+3,1.0
+4,2,2,0.7
+1
+4,1.0
+5,2,2,0.7
+1
+5,1.0
+6,2,2,0.7
+1
+6,1.0
+7,2,2,0.7
+1
+7,1.0
+0,2,2,0.9
+1
+0,1.0
+1,2,2,0.9
+1
+1,1.0
+2,2,2,0.9
+1
+2,1.0
+3,2,2,0.9
+1
+3,1.0
+4,2,2,0.9
+1
+4,1.0
+5,2,2,0.9
+1
+5,1.0
+6,2,2,0.9
+1
+6,1.0
+7,2,2,0.9
+1
+7,1.0
+0,2,3,0.1
+1
+0,1.0
+1,2,3,0.1
+1
+1,1.0
+2,2,3,0.1
+3
+2,0.84664875
+4,0.37628835
+5,0.37628835
+3,2,3,0.1
+3
+3,0.84664875
+6,0.37628835
+7,0.37628835
+4,2,3,0.1
+3
+4,0.7920648
+5,0.49870744
+2,0.35202882
+5,2,3,0.1
+3
+5,0.7920648
+4,0.49870744
+2,0.35202882
+6,2,3,0.1
+3
+6,0.7920648
+7,0.49870744
+3,0.35202882
+7,2,3,0.1
+3
+7,0.7920648
+6,0.49870744
+3,0.35202882
+0,2,3,0.3
+1
+0,1.0
+1,2,3,0.3
+1
+1,1.0
+2,2,3,0.3
+3
+2,0.92717266
+4,0.26490647
+5,0.26490647
+3,2,3,0.3
+3
+3,0.92717266
+6,0.26490647
+7,0.26490647
+4,2,3,0.3
+3
+4,0.85875386
+5,0.44982338
+2,0.24535823
+5,2,3,0.3
+3
+5,0.85875386
+4,0.44982338
+2,0.24535823
+6,2,3,0.3
+3
+6,0.85875386
+7,0.44982338
+3,0.24535823
+7,2,3,0.3
+3
+7,0.85875386
+6,0.44982338
+3,0.24535823
+0,2,3,0.5
+1
+0,1.0
+1,2,3,0.5
+1
+1,1.0
+2,2,3,0.5
+1
+2,1.0
+3,2,3,0.5
+1
+3,1.0
+4,2,3,0.5
+2
+4,0.9486833
+5,0.3162277
+5,2,3,0.5
+2
+5,0.9486833
+4,0.3162277
+6,2,3,0.5
+2
+6,0.9486833
+7,0.3162277
+7,2,3,0.5
+2
+7,0.9486833
+6,0.3162277
+0,2,3,0.7
+1
+0,1.0
+1,2,3,0.7
+1
+1,1.0
+2,2,3,0.7
+1
+2,1.0
+3,2,3,0.7
+1
+3,1.0
+4,2,3,0.7
+1
+4,1.0
+5,2,3,0.7
+1
+5,1.0
+6,2,3,0.7
+1
+6,1.0
+7,2,3,0.7
+1
+7,1.0
+0,2,3,0.9
+1
+0,1.0
+1,2,3,0.9
+1
+1,1.0
+2,2,3,0.9
+1
+2,1.0
+3,2,3,0.9
+1
+3,1.0
+4,2,3,0.9
+1
+4,1.0
+5,2,3,0.9
+1
+5,1.0
+6,2,3,0.9
+1
+6,1.0
+7,2,3,0.9
+1
+7,1.0
+0,2,4,0.1
+1
+0,1.0
+1,2,4,0.1
+1
+1,1.0
+2,2,4,0.1
+3
+2,0.84664875
+4,0.37628835
+5,0.37628835
+3,2,4,0.1
+3
+3,0.84664875
+6,0.37628835
+7,0.37628835
+4,2,4,0.1
+3
+4,0.7920648
+5,0.49870744
+2,0.35202882
+5,2,4,0.1
+3
+5,0.7920648
+4,0.49870744
+2,0.35202882
+6,2,4,0.1
+3
+6,0.7920648
+7,0.49870744
+3,0.35202882
+7,2,4,0.1
+3
+7,0.7920648
+6,0.49870744
+3,0.35202882
+0,2,4,0.3
+1
+0,1.0
+1,2,4,0.3
+1
+1,1.0
+2,2,4,0.3
+3
+2,0.92717266
+4,0.26490647
+5,0.26490647
+3,2,4,0.3
+3
+3,0.92717266
+6,0.26490647
+7,0.26490647
+4,2,4,0.3
+3
+4,0.85875386
+5,0.44982338
+2,0.24535823
+5,2,4,0.3
+3
+5,0.85875386
+4,0.44982338
+2,0.24535823
+6,2,4,0.3
+3
+6,0.85875386
+7,0.44982338
+3,0.24535823
+7,2,4,0.3
+3
+7,0.85875386
+6,0.44982338
+3,0.24535823
+0,2,4,0.5
+1
+0,1.0
+1,2,4,0.5
+1
+1,1.0
+2,2,4,0.5
+1
+2,1.0
+3,2,4,0.5
+1
+3,1.0
+4,2,4,0.5
+2
+4,0.9486833
+5,0.3162277
+5,2,4,0.5
+2
+5,0.9486833
+4,0.3162277
+6,2,4,0.5
+2
+6,0.9486833
+7,0.3162277
+7,2,4,0.5
+2
+7,0.9486833
+6,0.3162277
+0,2,4,0.7
+1
+0,1.0
+1,2,4,0.7
+1
+1,1.0
+2,2,4,0.7
+1
+2,1.0
+3,2,4,0.7
+1
+3,1.0
+4,2,4,0.7
+1
+4,1.0
+5,2,4,0.7
+1
+5,1.0
+6,2,4,0.7
+1
+6,1.0
+7,2,4,0.7
+1
+7,1.0
+0,2,4,0.9
+1
+0,1.0
+1,2,4,0.9
+1
+1,1.0
+2,2,4,0.9
+1
+2,1.0
+3,2,4,0.9
+1
+3,1.0
+4,2,4,0.9
+1
+4,1.0
+5,2,4,0.9
+1
+5,1.0
+6,2,4,0.9
+1
+6,1.0
+7,2,4,0.9
+1
+7,1.0
+0,2,5,0.1
+1
+0,1.0
+1,2,5,0.1
+1
+1,1.0
+2,2,5,0.1
+3
+2,0.84664875
+4,0.37628835
+5,0.37628835
+3,2,5,0.1
+3
+3,0.84664875
+6,0.37628835
+7,0.37628835
+4,2,5,0.1
+3
+4,0.7920648
+5,0.49870744
+2,0.35202882
+5,2,5,0.1
+3
+5,0.7920648
+4,0.49870744
+2,0.35202882
+6,2,5,0.1
+3
+6,0.7920648
+7,0.49870744
+3,0.35202882
+7,2,5,0.1
+3
+7,0.7920648
+6,0.49870744
+3,0.35202882
+0,2,5,0.3
+1
+0,1.0
+1,2,5,0.3
+1
+1,1.0
+2,2,5,0.3
+3
+2,0.92717266
+4,0.26490647
+5,0.26490647
+3,2,5,0.3
+3
+3,0.92717266
+6,0.26490647
+7,0.26490647
+4,2,5,0.3
+3
+4,0.85875386
+5,0.44982338
+2,0.24535823
+5,2,5,0.3
+3
+5,0.85875386
+4,0.44982338
+2,0.24535823
+6,2,5,0.3
+3
+6,0.85875386
+7,0.44982338
+3,0.24535823
+7,2,5,0.3
+3
+7,0.85875386
+6,0.44982338
+3,0.24535823
+0,2,5,0.5
+1
+0,1.0
+1,2,5,0.5
+1
+1,1.0
+2,2,5,0.5
+1
+2,1.0
+3,2,5,0.5
+1
+3,1.0
+4,2,5,0.5
+2
+4,0.9486833
+5,0.3162277
+5,2,5,0.5
+2
+5,0.9486833
+4,0.3162277
+6,2,5,0.5
+2
+6,0.9486833
+7,0.3162277
+7,2,5,0.5
+2
+7,0.9486833
+6,0.3162277
+0,2,5,0.7
+1
+0,1.0
+1,2,5,0.7
+1
+1,1.0
+2,2,5,0.7
+1
+2,1.0
+3,2,5,0.7
+1
+3,1.0
+4,2,5,0.7
+1
+4,1.0
+5,2,5,0.7
+1
+5,1.0
+6,2,5,0.7
+1
+6,1.0
+7,2,5,0.7
+1
+7,1.0
+0,2,5,0.9
+1
+0,1.0
+1,2,5,0.9
+1
+1,1.0
+2,2,5,0.9
+1
+2,1.0
+3,2,5,0.9
+1
+3,1.0
+4,2,5,0.9
+1
+4,1.0
+5,2,5,0.9
+1
+5,1.0
+6,2,5,0.9
+1
+6,1.0
+7,2,5,0.9
+1
+7,1.0
+0,2,6,0.1
+1
+0,1.0
+1,2,6,0.1
+1
+1,1.0
+2,2,6,0.1
+3
+2,0.84664875
+4,0.37628835
+5,0.37628835
+3,2,6,0.1
+3
+3,0.84664875
+6,0.37628835
+7,0.37628835
+4,2,6,0.1
+3
+4,0.7920648
+5,0.49870744
+2,0.35202882
+5,2,6,0.1
+3
+5,0.7920648
+4,0.49870744
+2,0.35202882
+6,2,6,0.1
+3
+6,0.7920648
+7,0.49870744
+3,0.35202882
+7,2,6,0.1
+3
+7,0.7920648
+6,0.49870744
+3,0.35202882
+0,2,6,0.3
+1
+0,1.0
+1,2,6,0.3
+1
+1,1.0
+2,2,6,0.3
+3
+2,0.92717266
+4,0.26490647
+5,0.26490647
+3,2,6,0.3
+3
+3,0.92717266
+6,0.26490647
+7,0.26490647
+4,2,6,0.3
+3
+4,0.85875386
+5,0.44982338
+2,0.24535823
+5,2,6,0.3
+3
+5,0.85875386
+4,0.44982338
+2,0.24535823
+6,2,6,0.3
+3
+6,0.85875386
+7,0.44982338
+3,0.24535823
+7,2,6,0.3
+3
+7,0.85875386
+6,0.44982338
+3,0.24535823
+0,2,6,0.5
+1
+0,1.0
+1,2,6,0.5
+1
+1,1.0
+2,2,6,0.5
+1
+2,1.0
+3,2,6,0.5
+1
+3,1.0
+4,2,6,0.5
+2
+4,0.9486833
+5,0.3162277
+5,2,6,0.5
+2
+5,0.9486833
+4,0.3162277
+6,2,6,0.5
+2
+6,0.9486833
+7,0.3162277
+7,2,6,0.5
+2
+7,0.9486833
+6,0.3162277
+0,2,6,0.7
+1
+0,1.0
+1,2,6,0.7
+1
+1,1.0
+2,2,6,0.7
+1
+2,1.0
+3,2,6,0.7
+1
+3,1.0
+4,2,6,0.7
+1
+4,1.0
+5,2,6,0.7
+1
+5,1.0
+6,2,6,0.7
+1
+6,1.0
+7,2,6,0.7
+1
+7,1.0
+0,2,6,0.9
+1
+0,1.0
+1,2,6,0.9
+1
+1,1.0
+2,2,6,0.9
+1
+2,1.0
+3,2,6,0.9
+1
+3,1.0
+4,2,6,0.9
+1
+4,1.0
+5,2,6,0.9
+1
+5,1.0
+6,2,6,0.9
+1
+6,1.0
+7,2,6,0.9
+1
+7,1.0
+0,2,7,0.1
+1
+0,1.0
+1,2,7,0.1
+1
+1,1.0
+2,2,7,0.1
+3
+2,0.84664875
+4,0.37628835
+5,0.37628835
+3,2,7,0.1
+3
+3,0.84664875
+6,0.37628835
+7,0.37628835
+4,2,7,0.1
+3
+4,0.7920648
+5,0.49870744
+2,0.35202882
+5,2,7,0.1
+3
+5,0.7920648
+4,0.49870744
+2,0.35202882
+6,2,7,0.1
+3
+6,0.7920648
+7,0.49870744
+3,0.35202882
+7,2,7,0.1
+3
+7,0.7920648
+6,0.49870744
+3,0.35202882
+0,2,7,0.3
+1
+0,1.0
+1,2,7,0.3
+1
+1,1.0
+2,2,7,0.3
+3
+2,0.92717266
+4,0.26490647
+5,0.26490647
+3,2,7,0.3
+3
+3,0.92717266
+6,0.26490647
+7,0.26490647
+4,2,7,0.3
+3
+4,0.85875386
+5,0.44982338
+2,0.24535823
+5,2,7,0.3
+3
+5,0.85875386
+4,0.44982338
+2,0.24535823
+6,2,7,0.3
+3
+6,0.85875386
+7,0.44982338
+3,0.24535823
+7,2,7,0.3
+3
+7,0.85875386
+6,0.44982338
+3,0.24535823
+0,2,7,0.5
+1
+0,1.0
+1,2,7,0.5
+1
+1,1.0
+2,2,7,0.5
+1
+2,1.0
+3,2,7,0.5
+1
+3,1.0
+4,2,7,0.5
+2
+4,0.9486833
+5,0.3162277
+5,2,7,0.5
+2
+5,0.9486833
+4,0.3162277
+6,2,7,0.5
+2
+6,0.9486833
+7,0.3162277
+7,2,7,0.5
+2
+7,0.9486833
+6,0.3162277
+0,2,7,0.7
+1
+0,1.0
+1,2,7,0.7
+1
+1,1.0
+2,2,7,0.7
+1
+2,1.0
+3,2,7,0.7
+1
+3,1.0
+4,2,7,0.7
+1
+4,1.0
+5,2,7,0.7
+1
+5,1.0
+6,2,7,0.7
+1
+6,1.0
+7,2,7,0.7
+1
+7,1.0
+0,2,7,0.9
+1
+0,1.0
+1,2,7,0.9
+1
+1,1.0
+2,2,7,0.9
+1
+2,1.0
+3,2,7,0.9
+1
+3,1.0
+4,2,7,0.9
+1
+4,1.0
+5,2,7,0.9
+1
+5,1.0
+6,2,7,0.9
+1
+6,1.0
+7,2,7,0.9
+1
+7,1.0
+0,2,8,0.1
+1
+0,1.0
+1,2,8,0.1
+1
+1,1.0
+2,2,8,0.1
+3
+2,0.84664875
+4,0.37628835
+5,0.37628835
+3,2,8,0.1
+3
+3,0.84664875
+6,0.37628835
+7,0.37628835
+4,2,8,0.1
+3
+4,0.7920648
+5,0.49870744
+2,0.35202882
+5,2,8,0.1
+3
+5,0.7920648
+4,0.49870744
+2,0.35202882
+6,2,8,0.1
+3
+6,0.7920648
+7,0.49870744
+3,0.35202882
+7,2,8,0.1
+3
+7,0.7920648
+6,0.49870744
+3,0.35202882
+0,2,8,0.3
+1
+0,1.0
+1,2,8,0.3
+1
+1,1.0
+2,2,8,0.3
+3
+2,0.92717266
+4,0.26490647
+5,0.26490647
+3,2,8,0.3
+3
+3,0.92717266
+6,0.26490647
+7,0.26490647
+4,2,8,0.3
+3
+4,0.85875386
+5,0.44982338
+2,0.24535823
+5,2,8,0.3
+3
+5,0.85875386
+4,0.44982338
+2,0.24535823
+6,2,8,0.3
+3
+6,0.85875386
+7,0.44982338
+3,0.24535823
+7,2,8,0.3
+3
+7,0.85875386
+6,0.44982338
+3,0.24535823
+0,2,8,0.5
+1
+0,1.0
+1,2,8,0.5
+1
+1,1.0
+2,2,8,0.5
+1
+2,1.0
+3,2,8,0.5
+1
+3,1.0
+4,2,8,0.5
+2
+4,0.9486833
+5,0.3162277
+5,2,8,0.5
+2
+5,0.9486833
+4,0.3162277
+6,2,8,0.5
+2
+6,0.9486833
+7,0.3162277
+7,2,8,0.5
+2
+7,0.9486833
+6,0.3162277
+0,2,8,0.7
+1
+0,1.0
+1,2,8,0.7
+1
+1,1.0
+2,2,8,0.7
+1
+2,1.0
+3,2,8,0.7
+1
+3,1.0
+4,2,8,0.7
+1
+4,1.0
+5,2,8,0.7
+1
+5,1.0
+6,2,8,0.7
+1
+6,1.0
+7,2,8,0.7
+1
+7,1.0
+0,2,8,0.9
+1
+0,1.0
+1,2,8,0.9
+1
+1,1.0
+2,2,8,0.9
+1
+2,1.0
+3,2,8,0.9
+1
+3,1.0
+4,2,8,0.9
+1
+4,1.0
+5,2,8,0.9
+1
+5,1.0
+6,2,8,0.9
+1
+6,1.0
+7,2,8,0.9
+1
+7,1.0

Property changes on: lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/fuzzyTestData.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
Index: lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java
===================================================================
--- lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java	(revision 0)
+++ lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java	(working copy)
@@ -0,0 +1,468 @@
+package org.apache.lucene.sandbox.queries;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.List;
+import java.util.Arrays;
+import java.io.IOException;
+
+import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.TextField;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.MultiReader;
+import org.apache.lucene.index.RandomIndexWriter;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.MultiTermQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.ScoreDoc;
+import org.apache.lucene.search.TopDocs;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.util.LuceneTestCase;
+
+/**
+ * Tests {@link SlowFuzzyQuery}.
+ *
+ */
+public class TestSlowFuzzyQuery extends LuceneTestCase {
+
+  public void testFuzziness() throws Exception {
+    Directory directory = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random(), directory);
+    addDoc("aaaaa", writer);
+    addDoc("aaaab", writer);
+    addDoc("aaabb", writer);
+    addDoc("aabbb", writer);
+    addDoc("abbbb", writer);
+    addDoc("bbbbb", writer);
+    addDoc("ddddd", writer);
+
+    IndexReader reader = writer.getReader();
+    IndexSearcher searcher = newSearcher(reader);
+    writer.close();
+
+    SlowFuzzyQuery query = new SlowFuzzyQuery(new Term("field", "aaaaa"), SlowFuzzyQuery.defaultMinSimilarity, 0);   
+    ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(3, hits.length);
+    
+    // same with prefix
+    query = new SlowFuzzyQuery(new Term("field", "aaaaa"), SlowFuzzyQuery.defaultMinSimilarity, 1);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(3, hits.length);
+    query = new SlowFuzzyQuery(new Term("field", "aaaaa"), SlowFuzzyQuery.defaultMinSimilarity, 2);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(3, hits.length);
+    query = new SlowFuzzyQuery(new Term("field", "aaaaa"), SlowFuzzyQuery.defaultMinSimilarity, 3);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(3, hits.length);
+    query = new SlowFuzzyQuery(new Term("field", "aaaaa"), SlowFuzzyQuery.defaultMinSimilarity, 4);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(2, hits.length);
+    query = new SlowFuzzyQuery(new Term("field", "aaaaa"), SlowFuzzyQuery.defaultMinSimilarity, 5);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+    query = new SlowFuzzyQuery(new Term("field", "aaaaa"), SlowFuzzyQuery.defaultMinSimilarity, 6);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+    
+    // test scoring
+    query = new SlowFuzzyQuery(new Term("field", "bbbbb"), SlowFuzzyQuery.defaultMinSimilarity, 0);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals("3 documents should match", 3, hits.length);
+    List<String> order = Arrays.asList("bbbbb","abbbb","aabbb");
+    for (int i = 0; i < hits.length; i++) {
+      final String term = searcher.doc(hits[i].doc).get("field");
+      //System.out.println(hits[i].score);
+      assertEquals(order.get(i), term);
+    }
+
+    // test pq size by supplying maxExpansions=2
+    // This query would normally return 3 documents, because 3 terms match (see above):
+    query = new SlowFuzzyQuery(new Term("field", "bbbbb"), SlowFuzzyQuery.defaultMinSimilarity, 0, 2); 
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals("only 2 documents should match", 2, hits.length);
+    order = Arrays.asList("bbbbb","abbbb");
+    for (int i = 0; i < hits.length; i++) {
+      final String term = searcher.doc(hits[i].doc).get("field");
+      //System.out.println(hits[i].score);
+      assertEquals(order.get(i), term);
+    }
+
+    // not similar enough:
+    query = new SlowFuzzyQuery(new Term("field", "xxxxx"), SlowFuzzyQuery.defaultMinSimilarity, 0);  	
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+    query = new SlowFuzzyQuery(new Term("field", "aaccc"), SlowFuzzyQuery.defaultMinSimilarity, 0);   // edit distance to "aaaaa" = 3
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+
+    // query identical to a word in the index:
+    query = new SlowFuzzyQuery(new Term("field", "aaaaa"), SlowFuzzyQuery.defaultMinSimilarity, 0);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(3, hits.length);
+    assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaa"));
+    // default allows for up to two edits:
+    assertEquals(searcher.doc(hits[1].doc).get("field"), ("aaaab"));
+    assertEquals(searcher.doc(hits[2].doc).get("field"), ("aaabb"));
+
+    // query similar to a word in the index:
+    query = new SlowFuzzyQuery(new Term("field", "aaaac"), SlowFuzzyQuery.defaultMinSimilarity, 0);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(3, hits.length);
+    assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaa"));
+    assertEquals(searcher.doc(hits[1].doc).get("field"), ("aaaab"));
+    assertEquals(searcher.doc(hits[2].doc).get("field"), ("aaabb"));
+    
+    // now with prefix
+    query = new SlowFuzzyQuery(new Term("field", "aaaac"), SlowFuzzyQuery.defaultMinSimilarity, 1);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(3, hits.length);
+    assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaa"));
+    assertEquals(searcher.doc(hits[1].doc).get("field"), ("aaaab"));
+    assertEquals(searcher.doc(hits[2].doc).get("field"), ("aaabb"));
+    query = new SlowFuzzyQuery(new Term("field", "aaaac"), SlowFuzzyQuery.defaultMinSimilarity, 2);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(3, hits.length);
+    assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaa"));
+    assertEquals(searcher.doc(hits[1].doc).get("field"), ("aaaab"));
+    assertEquals(searcher.doc(hits[2].doc).get("field"), ("aaabb"));
+    query = new SlowFuzzyQuery(new Term("field", "aaaac"), SlowFuzzyQuery.defaultMinSimilarity, 3);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(3, hits.length);
+    assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaa"));
+    assertEquals(searcher.doc(hits[1].doc).get("field"), ("aaaab"));
+    assertEquals(searcher.doc(hits[2].doc).get("field"), ("aaabb"));
+    query = new SlowFuzzyQuery(new Term("field", "aaaac"), SlowFuzzyQuery.defaultMinSimilarity, 4);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(2, hits.length);
+    assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaa"));
+    assertEquals(searcher.doc(hits[1].doc).get("field"), ("aaaab"));
+    query = new SlowFuzzyQuery(new Term("field", "aaaac"), SlowFuzzyQuery.defaultMinSimilarity, 5);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+    
+
+    query = new SlowFuzzyQuery(new Term("field", "ddddX"), SlowFuzzyQuery.defaultMinSimilarity, 0);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+    assertEquals(searcher.doc(hits[0].doc).get("field"), ("ddddd"));
+    
+    // now with prefix
+    query = new SlowFuzzyQuery(new Term("field", "ddddX"), SlowFuzzyQuery.defaultMinSimilarity, 1);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+    assertEquals(searcher.doc(hits[0].doc).get("field"), ("ddddd"));
+    query = new SlowFuzzyQuery(new Term("field", "ddddX"), SlowFuzzyQuery.defaultMinSimilarity, 2);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+    assertEquals(searcher.doc(hits[0].doc).get("field"), ("ddddd"));
+    query = new SlowFuzzyQuery(new Term("field", "ddddX"), SlowFuzzyQuery.defaultMinSimilarity, 3);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+    assertEquals(searcher.doc(hits[0].doc).get("field"), ("ddddd"));
+    query = new SlowFuzzyQuery(new Term("field", "ddddX"), SlowFuzzyQuery.defaultMinSimilarity, 4);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+    assertEquals(searcher.doc(hits[0].doc).get("field"), ("ddddd"));
+    query = new SlowFuzzyQuery(new Term("field", "ddddX"), SlowFuzzyQuery.defaultMinSimilarity, 5);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+    
+
+    // different field = no match:
+    query = new SlowFuzzyQuery(new Term("anotherfield", "ddddX"), SlowFuzzyQuery.defaultMinSimilarity, 0);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+
+    reader.close();
+    directory.close();
+  }
+
+  public void testFuzzinessLong() throws Exception {
+    Directory directory = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random(), directory);
+    addDoc("aaaaaaa", writer);
+    addDoc("segment", writer);
+
+    IndexReader reader = writer.getReader();
+    IndexSearcher searcher = newSearcher(reader);
+    writer.close();
+
+    SlowFuzzyQuery query;
+    // not similar enough:
+    query = new SlowFuzzyQuery(new Term("field", "xxxxx"), 0.5f, 0);   
+    ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+    // edit distance to "aaaaaaa" = 3, this matches because the string is longer than
+    // in testDefaultFuzziness so a bigger difference is allowed:
+    query = new SlowFuzzyQuery(new Term("field", "aaaaccc"), 0.5f, 0);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+    assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaaaa"));
+    
+    // now with prefix
+    query = new SlowFuzzyQuery(new Term("field", "aaaaccc"), 0.5f, 1);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+    assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaaaa"));
+    query = new SlowFuzzyQuery(new Term("field", "aaaaccc"), 0.5f, 4);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+    assertEquals(searcher.doc(hits[0].doc).get("field"), ("aaaaaaa"));
+    query = new SlowFuzzyQuery(new Term("field", "aaaaccc"), 0.5f, 5);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+
+    // no match, more than half of the characters is wrong:
+    query = new SlowFuzzyQuery(new Term("field", "aaacccc"), 0.5f, 0);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+    
+    // now with prefix
+    query = new SlowFuzzyQuery(new Term("field", "aaacccc"), 0.5f, 2);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+
+    // "student" and "stellent" are indeed similar to "segment" by default:
+    query = new SlowFuzzyQuery(new Term("field", "student"), 0.5f, 0);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+    query = new SlowFuzzyQuery(new Term("field", "stellent"), 0.5f, 0);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+    
+    // now with prefix
+    query = new SlowFuzzyQuery(new Term("field", "student"), 0.5f, 1);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+    query = new SlowFuzzyQuery(new Term("field", "stellent"), 0.5f, 1);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+    query = new SlowFuzzyQuery(new Term("field", "student"), 0.5f, 2);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+    query = new SlowFuzzyQuery(new Term("field", "stellent"), 0.5f, 2);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+    
+    // "student" doesn't match anymore thanks to increased minimum similarity:
+    query = new SlowFuzzyQuery(new Term("field", "student"), 0.6f, 0);   
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+
+    try {
+      query = new SlowFuzzyQuery(new Term("field", "student"), 1.1f);
+      fail("Expected IllegalArgumentException");
+    } catch (IllegalArgumentException e) {
+      // expecting exception
+    }
+    try {
+      query = new SlowFuzzyQuery(new Term("field", "student"), -0.1f);
+      fail("Expected IllegalArgumentException");
+    } catch (IllegalArgumentException e) {
+      // expecting exception
+    }
+
+    reader.close();
+    directory.close();
+  }
+  
+  /** 
+   * MultiTermQuery provides (via attribute) information about which values
+   * must be competitive to enter the priority queue. 
+   * 
+   * SlowFuzzyQuery optimizes itself around this information, if the attribute
+   * is not implemented correctly, there will be problems!
+   */
+  public void testTieBreaker() throws Exception {
+    Directory directory = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random(), directory);
+    addDoc("a123456", writer);
+    addDoc("c123456", writer);
+    addDoc("d123456", writer);
+    addDoc("e123456", writer);
+    
+    Directory directory2 = newDirectory();
+    RandomIndexWriter writer2 = new RandomIndexWriter(random(), directory2);
+    addDoc("a123456", writer2);
+    addDoc("b123456", writer2);
+    addDoc("b123456", writer2);
+    addDoc("b123456", writer2);
+    addDoc("c123456", writer2);
+    addDoc("f123456", writer2);
+    
+    IndexReader ir1 = writer.getReader();
+    IndexReader ir2 = writer2.getReader();
+    
+    MultiReader mr = new MultiReader(ir1, ir2);
+    IndexSearcher searcher = newSearcher(mr);
+    SlowFuzzyQuery fq = new SlowFuzzyQuery(new Term("field", "z123456"), 1f, 0, 2);
+    TopDocs docs = searcher.search(fq, 2);
+    assertEquals(5, docs.totalHits); // 5 docs, from the a and b's
+    mr.close();
+    ir1.close();
+    ir2.close();
+    writer.close();
+    writer2.close();
+    directory.close();
+    directory2.close(); 
+  }
+  
+  public void testTokenLengthOpt() throws IOException {
+    Directory directory = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random(), directory);
+    addDoc("12345678911", writer);
+    addDoc("segment", writer);
+
+    IndexReader reader = writer.getReader();
+    IndexSearcher searcher = newSearcher(reader);
+    writer.close();
+
+    Query query;
+    // term not over 10 chars, so optimization shortcuts
+    query = new SlowFuzzyQuery(new Term("field", "1234569"), 0.9f);
+    ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+
+    // 10 chars, so no optimization
+    query = new SlowFuzzyQuery(new Term("field", "1234567891"), 0.9f);
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+    
+    // over 10 chars, so no optimization
+    query = new SlowFuzzyQuery(new Term("field", "12345678911"), 0.9f);
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(1, hits.length);
+
+    // over 10 chars, no match
+    query = new SlowFuzzyQuery(new Term("field", "sdfsdfsdfsdf"), 0.9f);
+    hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(0, hits.length);
+    
+    reader.close();
+    directory.close();
+  }
+  
+  /** Test the TopTermsBoostOnlyBooleanQueryRewrite rewrite method. */
+  public void testBoostOnlyRewrite() throws Exception {
+    Directory directory = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random(), directory);
+    addDoc("Lucene", writer);
+    addDoc("Lucene", writer);
+    addDoc("Lucenne", writer);
+
+    IndexReader reader = writer.getReader();
+    IndexSearcher searcher = newSearcher(reader);
+    writer.close();
+    
+    SlowFuzzyQuery query = new SlowFuzzyQuery(new Term("field", "lucene"));
+    query.setRewriteMethod(new MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite(50));
+    ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
+    assertEquals(3, hits.length);
+    // normally, 'Lucenne' would be the first result as IDF will skew the score.
+    assertEquals("Lucene", reader.document(hits[0].doc).get("field"));
+    assertEquals("Lucene", reader.document(hits[1].doc).get("field"));
+    assertEquals("Lucenne", reader.document(hits[2].doc).get("field"));
+    reader.close();
+    directory.close();
+  }
+  
+  public void testGiga() throws Exception {
+
+    MockAnalyzer analyzer = new MockAnalyzer(random());
+    Directory index = newDirectory();
+    RandomIndexWriter w = new RandomIndexWriter(random(), index);
+
+    addDoc("Lucene in Action", w);
+    addDoc("Lucene for Dummies", w);
+
+    //addDoc("Giga", w);
+    addDoc("Giga byte", w);
+
+    addDoc("ManagingGigabytesManagingGigabyte", w);
+    addDoc("ManagingGigabytesManagingGigabytes", w);
+
+    addDoc("The Art of Computer Science", w);
+    addDoc("J. K. Rowling", w);
+    addDoc("JK Rowling", w);
+    addDoc("Joanne K Roling", w);
+    addDoc("Bruce Willis", w);
+    addDoc("Willis bruce", w);
+    addDoc("Brute willis", w);
+    addDoc("B. willis", w);
+    IndexReader r = w.getReader();
+    w.close();
+
+    Query q = new SlowFuzzyQuery(new Term("field", "giga"), 0.9f);
+
+    // 3. search
+    IndexSearcher searcher = newSearcher(r);
+    ScoreDoc[] hits = searcher.search(q, 10).scoreDocs;
+    assertEquals(1, hits.length);
+    assertEquals("Giga byte", searcher.doc(hits[0].doc).get("field"));
+    r.close();
+    index.close();
+  }
+  
+  public void testDistanceAsEditsSearching() throws Exception {
+    Directory index = newDirectory();
+    RandomIndexWriter w = new RandomIndexWriter(random(), index);
+    addDoc("foobar", w);
+    addDoc("test", w);
+    addDoc("working", w);
+    IndexReader reader = w.getReader();
+    IndexSearcher searcher = newSearcher(reader);
+    w.close();
+    
+    SlowFuzzyQuery q = new SlowFuzzyQuery(new Term("field", "fouba"), 2);
+    ScoreDoc[] hits = searcher.search(q, 10).scoreDocs;
+    assertEquals(1, hits.length);
+    assertEquals("foobar", searcher.doc(hits[0].doc).get("field"));
+    
+    q = new SlowFuzzyQuery(new Term("field", "foubara"), 2);
+    hits = searcher.search(q, 10).scoreDocs;
+    assertEquals(1, hits.length);
+    assertEquals("foobar", searcher.doc(hits[0].doc).get("field"));
+    
+    q = new SlowFuzzyQuery(new Term("field", "t"), 3);
+    hits = searcher.search(q, 10).scoreDocs;
+    assertEquals(1, hits.length);
+    assertEquals("test", searcher.doc(hits[0].doc).get("field"));
+    
+    q = new SlowFuzzyQuery(new Term("field", "a"), 4f, 0, 50);
+    hits = searcher.search(q, 10).scoreDocs;
+    assertEquals(1, hits.length);
+    assertEquals("test", searcher.doc(hits[0].doc).get("field"));
+    
+    q = new SlowFuzzyQuery(new Term("field", "a"), 6f, 0, 50);
+    hits = searcher.search(q, 10).scoreDocs;
+    assertEquals(2, hits.length);
+    assertEquals("test", searcher.doc(hits[0].doc).get("field"));
+    assertEquals("foobar", searcher.doc(hits[1].doc).get("field"));
+    
+    reader.close();
+    index.close();
+  }
+
+  private void addDoc(String text, RandomIndexWriter writer) throws IOException {
+    Document doc = new Document();
+    doc.add(newField("field", text, TextField.TYPE_STORED));
+    writer.addDocument(doc);
+  }
+}

Property changes on: lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
Index: lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/FuzzyLikeThisQuery.java
===================================================================
--- lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/FuzzyLikeThisQuery.java	(revision 1332803)
+++ lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/FuzzyLikeThisQuery.java	(working copy)
@@ -211,7 +211,7 @@
                   AttributeSource atts = new AttributeSource();
                   MaxNonCompetitiveBoostAttribute maxBoostAtt =
                     atts.addAttribute(MaxNonCompetitiveBoostAttribute.class);
-                  FuzzyTermsEnum fe = new FuzzyTermsEnum(MultiFields.getTerms(reader, startTerm.field()), atts, startTerm, f.minSimilarity, f.prefixLength, false);
+                  SlowFuzzyTermsEnum fe = new SlowFuzzyTermsEnum(MultiFields.getTerms(reader, startTerm.field()), atts, startTerm, f.minSimilarity, f.prefixLength);
                   //store the df so all variants use same idf
                   int df = reader.docFreq(startTerm);
                   int numVariants=0;
Index: lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowFuzzyQuery.java
===================================================================
--- lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowFuzzyQuery.java	(revision 0)
+++ lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowFuzzyQuery.java	(working copy)
@@ -0,0 +1,207 @@
+package org.apache.lucene.sandbox.queries;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.IOException;
+
+import org.apache.lucene.index.SingleTermsEnum;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.index.Terms;
+import org.apache.lucene.index.TermsEnum;
+import org.apache.lucene.search.FuzzyTermsEnum;
+import org.apache.lucene.search.MultiTermQuery;
+import org.apache.lucene.util.AttributeSource;
+import org.apache.lucene.util.ToStringUtils;
+import org.apache.lucene.util.automaton.LevenshteinAutomata;
+
+/** Implements the fuzzy search query. The similarity measurement
+ * is based on the Levenshtein (edit distance) algorithm.
+ * 
+ * <p>This query uses {@link MultiTermQuery.TopTermsScoringBooleanQueryRewrite}
+ * as default. So terms will be collected and scored according to their
+ * edit distance. Only the top terms are used for building the {@link BooleanQuery}.
+ * It is not recommended to change the rewrite mode for fuzzy queries.
+ * 
+ * <p>WARNING:</p>If the <code>minimumSimilarity</code> is too low,
+ * this query will be extremely slow!
+ * 
+ * @deprecated Use {@link org.apache.lucene.search.FuzzyQuery} instead.
+ */
+@Deprecated
+public class SlowFuzzyQuery extends MultiTermQuery {
+  
+  public final static float defaultMinSimilarity = LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE;
+  public final static int defaultPrefixLength = 0;
+  public final static int defaultMaxExpansions = 50;
+  
+  private float minimumSimilarity;
+  private int prefixLength;
+  private boolean termLongEnough = false;
+  
+  protected Term term;
+  
+  /**
+   * Create a new SlowFuzzyQuery that will match terms with a similarity 
+   * of at least <code>minimumSimilarity</code> to <code>term</code>.
+   * If a <code>prefixLength</code> &gt; 0 is specified, a common prefix
+   * of that length is also required.
+   * 
+   * @param term the term to search for
+   * @param minimumSimilarity a value between 0 and 1 to set the required similarity
+   *  between the query term and the matching terms. For example, for a
+   *  <code>minimumSimilarity</code> of <code>0.5</code> a term of the same length
+   *  as the query term is considered similar to the query term if the edit distance
+   *  between both terms is less than <code>length(term)*0.5</code>
+   *  <p>
+   *  Alternatively, if <code>minimumSimilarity</code> is >= 1f, it is interpreted 
+   *  as a pure Levenshtein edit distance. For example, a value of <code>2f</code>
+   *  will match all terms within an edit distance of <code>2</code> from the 
+   *  query term. Edit distances specified in this way may not be fractional.
+   *  
+   * @param prefixLength length of common (non-fuzzy) prefix
+   * @param maxExpansions the maximum number of terms to match. If this number is
+   *  greater than {@link BooleanQuery#getMaxClauseCount} when the query is rewritten, 
+   *  then the maxClauseCount will be used instead.
+   * @throws IllegalArgumentException if minimumSimilarity is &gt;= 1 or &lt; 0
+   * or if prefixLength &lt; 0
+   */
+  public SlowFuzzyQuery(Term term, float minimumSimilarity, int prefixLength,
+      int maxExpansions) {
+    super(term.field());
+    this.term = term;
+    
+    if (minimumSimilarity >= 1.0f && minimumSimilarity != (int)minimumSimilarity)
+      throw new IllegalArgumentException("fractional edit distances are not allowed");
+    if (minimumSimilarity < 0.0f)
+      throw new IllegalArgumentException("minimumSimilarity < 0");
+    if (prefixLength < 0)
+      throw new IllegalArgumentException("prefixLength < 0");
+    if (maxExpansions < 0)
+      throw new IllegalArgumentException("maxExpansions < 0");
+    
+    setRewriteMethod(new MultiTermQuery.TopTermsScoringBooleanQueryRewrite(maxExpansions));
+    
+    String text = term.text();
+    int len = text.codePointCount(0, text.length());
+    if (len > 0 && (minimumSimilarity >= 1f || len > 1.0f / (1.0f - minimumSimilarity))) {
+      this.termLongEnough = true;
+    }
+    
+    this.minimumSimilarity = minimumSimilarity;
+    this.prefixLength = prefixLength;
+  }
+  
+  /**
+   * Calls {@link #SlowFuzzyQuery(Term, float) SlowFuzzyQuery(term, minimumSimilarity, prefixLength, defaultMaxExpansions)}.
+   */
+  public SlowFuzzyQuery(Term term, float minimumSimilarity, int prefixLength) {
+    this(term, minimumSimilarity, prefixLength, defaultMaxExpansions);
+  }
+  
+  /**
+   * Calls {@link #SlowFuzzyQuery(Term, float) SlowFuzzyQuery(term, minimumSimilarity, 0, defaultMaxExpansions)}.
+   */
+  public SlowFuzzyQuery(Term term, float minimumSimilarity) {
+    this(term, minimumSimilarity, defaultPrefixLength, defaultMaxExpansions);
+  }
+
+  /**
+   * Calls {@link #SlowFuzzyQuery(Term, float) SlowFuzzyQuery(term, defaultMinSimilarity, 0, defaultMaxExpansions)}.
+   */
+  public SlowFuzzyQuery(Term term) {
+    this(term, defaultMinSimilarity, defaultPrefixLength, defaultMaxExpansions);
+  }
+  
+  /**
+   * Returns the minimum similarity that is required for this query to match.
+   * @return float value between 0.0 and 1.0
+   */
+  public float getMinSimilarity() {
+    return minimumSimilarity;
+  }
+    
+  /**
+   * Returns the non-fuzzy prefix length. This is the number of characters at the start
+   * of a term that must be identical (not fuzzy) to the query term if the query
+   * is to match that term. 
+   */
+  public int getPrefixLength() {
+    return prefixLength;
+  }
+
+  @Override
+  protected TermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws IOException {
+    if (!termLongEnough) {  // can only match if it's exact
+      return new SingleTermsEnum(terms.iterator(null), term.bytes());
+    }
+    return new SlowFuzzyTermsEnum(terms, atts, getTerm(), minimumSimilarity, prefixLength);
+  }
+  
+  /**
+   * Returns the pattern term.
+   */
+  public Term getTerm() {
+    return term;
+  }
+    
+  @Override
+  public String toString(String field) {
+    final StringBuilder buffer = new StringBuilder();
+    if (!term.field().equals(field)) {
+        buffer.append(term.field());
+        buffer.append(":");
+    }
+    buffer.append(term.text());
+    buffer.append('~');
+    buffer.append(Float.toString(minimumSimilarity));
+    buffer.append(ToStringUtils.boost(getBoost()));
+    return buffer.toString();
+  }
+  
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + Float.floatToIntBits(minimumSimilarity);
+    result = prime * result + prefixLength;
+    result = prime * result + ((term == null) ? 0 : term.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj)
+      return true;
+    if (!super.equals(obj))
+      return false;
+    if (getClass() != obj.getClass())
+      return false;
+    SlowFuzzyQuery other = (SlowFuzzyQuery) obj;
+    if (Float.floatToIntBits(minimumSimilarity) != Float
+        .floatToIntBits(other.minimumSimilarity))
+      return false;
+    if (prefixLength != other.prefixLength)
+      return false;
+    if (term == null) {
+      if (other.term != null)
+        return false;
+    } else if (!term.equals(other.term))
+      return false;
+    return true;
+  }
+}

Property changes on: lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowFuzzyQuery.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
Index: lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowFuzzyTermsEnum.java
===================================================================
--- lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowFuzzyTermsEnum.java	(revision 0)
+++ lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowFuzzyTermsEnum.java	(working copy)
@@ -0,0 +1,246 @@
+package org.apache.lucene.sandbox.queries;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.IOException;
+
+import org.apache.lucene.index.Term;
+import org.apache.lucene.index.Terms;
+import org.apache.lucene.index.TermsEnum;
+import org.apache.lucene.index.FilteredTermsEnum;
+import org.apache.lucene.search.BoostAttribute;
+import org.apache.lucene.search.FuzzyTermsEnum;
+import org.apache.lucene.util.AttributeSource;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.IntsRef;
+import org.apache.lucene.util.StringHelper;
+import org.apache.lucene.util.UnicodeUtil;
+
+/** Subclass of TermsEnum for enumerating all terms that are similar
+ * to the specified filter term.
+ *
+ * <p>Term enumerations are always ordered by
+ * {@link #getComparator}.  Each term in the enumeration is
+ * greater than all that precede it.</p>
+ */
+public final class SlowFuzzyTermsEnum extends FuzzyTermsEnum {
+ 
+  public SlowFuzzyTermsEnum(Terms terms, AttributeSource atts, Term term,
+      float minSimilarity, int prefixLength) throws IOException {
+    super(terms, atts, term, minSimilarity, prefixLength, false);
+  }
+  
+  @Override
+  protected void maxEditDistanceChanged(BytesRef lastTerm, int maxEdits, boolean init)
+      throws IOException {
+    TermsEnum newEnum = getAutomatonEnum(maxEdits, lastTerm);
+    if (newEnum != null) {
+      setEnum(newEnum);
+    } else if (init) {
+      setEnum(new LinearFuzzyTermsEnum());      
+    }
+  }
+
+  /**
+   * Implement fuzzy enumeration with linear brute force.
+   */
+  private class LinearFuzzyTermsEnum extends FilteredTermsEnum {
+    /* Allows us save time required to create a new array
+     * every time similarity is called.
+     */
+    private int[] d;
+    private int[] p;
+    
+    // this is the text, minus the prefix
+    private final int[] text;
+    
+    private final BoostAttribute boostAtt =
+      attributes().addAttribute(BoostAttribute.class);
+    
+    /**
+     * Constructor for enumeration of all terms from specified <code>reader</code> which share a prefix of
+     * length <code>prefixLength</code> with <code>term</code> and which have a fuzzy similarity &gt;
+     * <code>minSimilarity</code>.
+     * <p>
+     * After calling the constructor the enumeration is already pointing to the first 
+     * valid term if such a term exists.
+     *
+     * @throws IOException
+     */
+    public LinearFuzzyTermsEnum() throws IOException {
+      super(terms.iterator(null));
+
+      this.text = new int[termLength - realPrefixLength];
+      System.arraycopy(termText, realPrefixLength, text, 0, text.length);
+      final String prefix = UnicodeUtil.newString(termText, 0, realPrefixLength);
+      prefixBytesRef = new BytesRef(prefix);
+      this.d = new int[this.text.length + 1];
+      this.p = new int[this.text.length + 1];
+      
+      setInitialSeekTerm(prefixBytesRef);
+    }
+    
+    private final BytesRef prefixBytesRef;
+    // used for unicode conversion from BytesRef byte[] to int[]
+    private final IntsRef utf32 = new IntsRef(20);
+    
+    /**
+     * The termCompare method in FuzzyTermEnum uses Levenshtein distance to 
+     * calculate the distance between the given term and the comparing term. 
+     */
+    @Override
+    protected final AcceptStatus accept(BytesRef term) {
+      if (StringHelper.startsWith(term, prefixBytesRef)) {
+        UnicodeUtil.UTF8toUTF32(term, utf32);
+        final float similarity = similarity(utf32.ints, realPrefixLength, utf32.length - realPrefixLength);
+        if (similarity > minSimilarity) {
+          boostAtt.setBoost((similarity - minSimilarity) * scale_factor);
+          return AcceptStatus.YES;
+        } else return AcceptStatus.NO;
+      } else {
+        return AcceptStatus.END;
+      }
+    }
+    
+    /******************************
+     * Compute Levenshtein distance
+     ******************************/
+    
+    /**
+     * <p>Similarity returns a number that is 1.0f or less (including negative numbers)
+     * based on how similar the Term is compared to a target term.  It returns
+     * exactly 0.0f when
+     * <pre>
+     *    editDistance &gt; maximumEditDistance</pre>
+     * Otherwise it returns:
+     * <pre>
+     *    1 - (editDistance / length)</pre>
+     * where length is the length of the shortest term (text or target) including a
+     * prefix that are identical and editDistance is the Levenshtein distance for
+     * the two words.</p>
+     *
+     * <p>Embedded within this algorithm is a fail-fast Levenshtein distance
+     * algorithm.  The fail-fast algorithm differs from the standard Levenshtein
+     * distance algorithm in that it is aborted if it is discovered that the
+     * minimum distance between the words is greater than some threshold.
+     *
+     * <p>To calculate the maximum distance threshold we use the following formula:
+     * <pre>
+     *     (1 - minimumSimilarity) * length</pre>
+     * where length is the shortest term including any prefix that is not part of the
+     * similarity comparison.  This formula was derived by solving for what maximum value
+     * of distance returns false for the following statements:
+     * <pre>
+     *   similarity = 1 - ((float)distance / (float) (prefixLength + Math.min(textlen, targetlen)));
+     *   return (similarity > minimumSimilarity);</pre>
+     * where distance is the Levenshtein distance for the two words.
+     * </p>
+     * <p>Levenshtein distance (also known as edit distance) is a measure of similarity
+     * between two strings where the distance is measured as the number of character
+     * deletions, insertions or substitutions required to transform one string to
+     * the other string.
+     * @param target the target word or phrase
+     * @return the similarity,  0.0 or less indicates that it matches less than the required
+     * threshold and 1.0 indicates that the text and target are identical
+     */
+    private final float similarity(final int[] target, int offset, int length) {
+      final int m = length;
+      final int n = text.length;
+      if (n == 0)  {
+        //we don't have anything to compare.  That means if we just add
+        //the letters for m we get the new word
+        return realPrefixLength == 0 ? 0.0f : 1.0f - ((float) m / realPrefixLength);
+      }
+      if (m == 0) {
+        return realPrefixLength == 0 ? 0.0f : 1.0f - ((float) n / realPrefixLength);
+      }
+      
+      final int maxDistance = calculateMaxDistance(m);
+      
+      if (maxDistance < Math.abs(m-n)) {
+        //just adding the characters of m to n or vice-versa results in
+        //too many edits
+        //for example "pre" length is 3 and "prefixes" length is 8.  We can see that
+        //given this optimal circumstance, the edit distance cannot be less than 5.
+        //which is 8-3 or more precisely Math.abs(3-8).
+        //if our maximum edit distance is 4, then we can discard this word
+        //without looking at it.
+        return Float.NEGATIVE_INFINITY;
+      }
+      
+      // init matrix d
+      for (int i = 0; i <=n; ++i) {
+        p[i] = i;
+      }
+      
+      // start computing edit distance
+      for (int j = 1; j<=m; ++j) { // iterates through target
+        int bestPossibleEditDistance = m;
+        final int t_j = target[offset+j-1]; // jth character of t
+        d[0] = j;
+
+        for (int i=1; i<=n; ++i) { // iterates through text
+          // minimum of cell to the left+1, to the top+1, diagonally left and up +(0|1)
+          if (t_j != text[i-1]) {
+            d[i] = Math.min(Math.min(d[i-1], p[i]),  p[i-1]) + 1;
+          } else {
+            d[i] = Math.min(Math.min(d[i-1]+1, p[i]+1),  p[i-1]);
+          }
+          bestPossibleEditDistance = Math.min(bestPossibleEditDistance, d[i]);
+        }
+
+        //After calculating row i, the best possible edit distance
+        //can be found by found by finding the smallest value in a given column.
+        //If the bestPossibleEditDistance is greater than the max distance, abort.
+
+        if (j > maxDistance && bestPossibleEditDistance > maxDistance) {  //equal is okay, but not greater
+          //the closest the target can be to the text is just too far away.
+          //this target is leaving the party early.
+          return Float.NEGATIVE_INFINITY;
+        }
+
+        // copy current distance counts to 'previous row' distance counts: swap p and d
+        int _d[] = p;
+        p = d;
+        d = _d;
+      }
+      
+      // our last action in the above loop was to switch d and p, so p now
+      // actually has the most recent cost counts
+
+      // this will return less than 0.0 when the edit distance is
+      // greater than the number of characters in the shorter word.
+      // but this was the formula that was previously used in FuzzyTermEnum,
+      // so it has not been changed (even though minimumSimilarity must be
+      // greater than 0.0)
+      return 1.0f - ((float)p[n] / (float) (realPrefixLength + Math.min(n, m)));
+    }
+    
+    /**
+     * The max Distance is the maximum Levenshtein distance for the text
+     * compared to some other value that results in score that is
+     * better than the minimum similarity.
+     * @param m the length of the "other value"
+     * @return the maximum levenshtein distance that we care about
+     */
+    private int calculateMaxDistance(int m) {
+      return raw ? maxEdits : Math.min(maxEdits, 
+          (int)((1-minSimilarity) * (Math.min(text.length, m) + realPrefixLength)));
+    }
+  }
+}

Property changes on: lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowFuzzyTermsEnum.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
