[jsword-svn] jsword/java/jsword/org/crosswire/jsword/book/search/parse s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Fri Apr 1 10:09:48 MST 2005


Update of /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/parse
In directory www.crosswire.org:/tmp/cvs-serv5088/java/jsword/org/crosswire/jsword/book/search/parse

Modified Files:
	StartsParamWord.java PhraseParamWord.java IndexSearcher.java 
Log Message:
Improved ranking, bible display and fixed a few bugs.

Index: PhraseParamWord.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/parse/PhraseParamWord.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PhraseParamWord.java	9 Oct 2004 21:45:05 -0000	1.2
--- PhraseParamWord.java	1 Apr 2005 17:09:46 -0000	1.3
***************
*** 11,15 ****
  import org.crosswire.jsword.passage.Key;
  import org.crosswire.jsword.passage.PassageTally;
- import org.crosswire.jsword.passage.RestrictionType;
  
  /**
--- 11,14 ----
***************
*** 99,103 ****
  
          PassageTally tally = new PassageTally();
-         tally.blur(BLUR_BY, RestrictionType.NONE);
  
          for (int i = 0; i < words.length; i++)
--- 98,101 ----
***************
*** 106,110 ****
          }
  
!         // This uses updatePassageTallyFlat() so that words like God
          // that have many startsWith() matches, and hence many verse
          // matches, do not end up with wrongly high scores.
--- 104,108 ----
          }
  
!         // This uses flatten() so that words like God
          // that have many startsWith() matches, and hence many verse
          // matches, do not end up with wrongly high scores.
***************
*** 134,141 ****
       */
      private Thesaurus thesaurus;
- 
-     /**
-      * How many verses do we blur by?
-      */
-     private static final int BLUR_BY = 2;
  }
--- 132,134 ----

Index: IndexSearcher.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/parse/IndexSearcher.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** IndexSearcher.java	25 Mar 2005 04:02:52 -0000	1.6
--- IndexSearcher.java	1 Apr 2005 17:09:46 -0000	1.7
***************
*** 12,16 ****
--- 12,18 ----
  import org.crosswire.jsword.book.BookException;
  import org.crosswire.jsword.book.search.Index;
+ import org.crosswire.jsword.book.search.SearchRequest;
  import org.crosswire.jsword.book.search.Searcher;
+ import org.crosswire.jsword.book.search.basic.DefaultSearchRequest;
  import org.crosswire.jsword.passage.Key;
  
***************
*** 62,71 ****
  
      /* (non-Javadoc)
!      * @see org.crosswire.jsword.book.search.Searcher#search(java.lang.String, org.crosswire.jsword.passage.Key)
       */
!     public Key search(String search) throws BookException
      {
!         List output = CustomTokenizer.tokenize(search, commands);
!         return search(output);
      }
  
--- 64,84 ----
  
      /* (non-Javadoc)
!      * @see org.crosswire.jsword.book.search.Searcher#search(java.lang.String)
       */
!     public Key search(String request) throws BookException
      {
!         return search(new DefaultSearchRequest(request));
!     }
! 
!     /* (non-Javadoc)
!      * @see org.crosswire.jsword.book.search.Searcher#search(org.crosswire.jsword.book.search.SearchRequest)
!      */
!     public Key search(SearchRequest request) throws BookException
!     {
!         index.setSearchModifier(request.getSearchModifier());
!         List output = CustomTokenizer.tokenize(request.getRequest(), commands);
!         Key results = search(output);
!         index.setSearchModifier(null);
!         return results;
      }
  

Index: StartsParamWord.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/parse/StartsParamWord.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** StartsParamWord.java	6 Mar 2005 20:21:47 -0000	1.11
--- StartsParamWord.java	1 Apr 2005 17:09:46 -0000	1.12
***************
*** 50,57 ****
      }
  
!     /**
!      * WARNING the return from this method is a PassageTally which is not a
!      * 100% match for the Passage interface. Maybe this needs to be fixed
!      * somehow.
       * @see org.crosswire.jsword.book.search.parse.ParamWord#getKeyList(org.crosswire.jsword.book.search.parse.IndexSearcher)
       */
--- 50,54 ----
      }
  
!     /* (non-Javadoc)
       * @see org.crosswire.jsword.book.search.parse.ParamWord#getKeyList(org.crosswire.jsword.book.search.parse.IndexSearcher)
       */



More information about the jsword-svn mailing list