lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gol...@apache.org
Subject cvs commit: jakarta-lucene/src/test/org/apache/lucene/queryParser TestQueryParser.java
Date Tue, 14 Sep 2004 13:46:25 GMT
goller      2004/09/14 06:46:25

  Modified:    src/test/org/apache/lucene/queryParser TestQueryParser.java
  Log:
  QueryParser can now handle minimumSimilarity parameter
  of FuzzyQuery
  
  Revision  Changes    Path
  1.30      +10 -8     jakarta-lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java
  
  Index: TestQueryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- TestQueryParser.java	6 Sep 2004 22:09:13 -0000	1.29
  +++ TestQueryParser.java	14 Sep 2004 13:46:25 -0000	1.30
  @@ -89,7 +89,7 @@
         super(f, a);
       }
   
  -    protected Query getFuzzyQuery(String field, String termStr) throws ParseException {
  +    protected Query getFuzzyQuery(String field, String termStr, float minSimilarity) throws
ParseException {
         throw new ParseException("Fuzzy queries not allowed");
       }
   
  @@ -235,15 +235,17 @@
     public void testWildcard() throws Exception {
       assertQueryEquals("term*", null, "term*");
       assertQueryEquals("term*^2", null, "term*^2.0");
  -    assertQueryEquals("term~", null, "term~");
  -    assertQueryEquals("term~^2", null, "term^2.0~");
  -    assertQueryEquals("term^2~", null, "term^2.0~");
  +    assertQueryEquals("term~", null, "term~0.5");
  +    assertQueryEquals("term~0.7", null, "term~0.7");
  +    assertQueryEquals("term~^2", null, "term^2.0~0.5");
  +    assertQueryEquals("term^2~", null, "term^2.0~0.5");
       assertQueryEquals("term*germ", null, "term*germ");
       assertQueryEquals("term*germ^3", null, "term*germ^3.0");
   
       assertTrue(getQuery("term*", null) instanceof PrefixQuery);
       assertTrue(getQuery("term*^2", null) instanceof PrefixQuery);
       assertTrue(getQuery("term~", null) instanceof FuzzyQuery);
  +    assertTrue(getQuery("term~0.7", null) instanceof FuzzyQuery);
       assertTrue(getQuery("term*germ", null) instanceof WildcardQuery);
   
   /* Tests to see that wild card terms are (or are not) properly
  @@ -364,10 +366,10 @@
   
       assertQueryEquals("a:b\\\\?c", a, "a:b\\?c");
   
  -    assertQueryEquals("a:b\\-c~", a, "a:b-c~");
  -    assertQueryEquals("a:b\\+c~", a, "a:b+c~");
  -    assertQueryEquals("a:b\\:c~", a, "a:b:c~");
  -    assertQueryEquals("a:b\\\\c~", a, "a:b\\c~");
  +    assertQueryEquals("a:b\\-c~", a, "a:b-c~0.5");
  +    assertQueryEquals("a:b\\+c~", a, "a:b+c~0.5");
  +    assertQueryEquals("a:b\\:c~", a, "a:b:c~0.5");
  +    assertQueryEquals("a:b\\\\c~", a, "a:b\\c~0.5");
   
       assertQueryEquals("[ a\\- TO a\\+ ]", null, "[a- TO a+]");
       assertQueryEquals("[ a\\: TO a\\~ ]", null, "[a: TO a~]");
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message