[jsword-svn] jsword/java/jsword/org/crosswire/jsword/book/search 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
In directory www.crosswire.org:/tmp/cvs-serv5088/java/jsword/org/crosswire/jsword/book/search
Modified Files:
Index.java Searcher.java
Added Files:
SearchModifier.java SearchRequest.java
Log Message:
Improved ranking, bible display and fixed a few bugs.
Index: Searcher.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/Searcher.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Searcher.java 9 Oct 2004 21:45:04 -0000 1.6
--- Searcher.java 1 Apr 2005 17:09:46 -0000 1.7
***************
*** 37,44 ****
/**
! * Take a search string and decipher it into a Passage.
! * @param search The string to be searched for
* @return The matching verses
*/
! public Key search(String search) throws BookException;
}
--- 37,51 ----
/**
! * Take a search request and decipher it into a Passage.
! * @param request The request
* @return The matching verses
*/
! public Key search(SearchRequest request) throws BookException;
!
! /**
! * Take a search request and decipher it into a Passage.
! * @param request The request
! * @return The matching verses
! */
! public Key search(String request) throws BookException;
}
--- NEW FILE: SearchRequest.java ---
package org.crosswire.jsword.book.search;
/**
* A SearchRequest consists of a string and modifiers for the search.
*
* <p><table border='1' cellPadding='3' cellSpacing='0'>
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
*
* Distribution Licence:<br />
* JSword is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License,
* version 2 as published by the Free Software Foundation.<br />
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.<br />
* The License is available on the internet
* <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, or by writing to:
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA<br />
* The copyright to this program is held by it's authors.
* </font></td></tr></table>
* @see gnu.gpl.Licence
* @author DM Smith [dmsmith555 at gmail dot com]
* @version $Id: SearchRequest.java,v 1.1 2005/04/01 17:09:46 dmsmith Exp $
*/
public interface SearchRequest
{
/**
* @return the modifications to this SearchRequest
*/
public SearchModifier getSearchModifier();
/**
* @return the request that is being operated upon
*/
public String getRequest();
}
Index: Index.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/Index.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Index.java 9 Oct 2004 21:45:04 -0000 1.9
--- Index.java 1 Apr 2005 17:09:46 -0000 1.10
***************
*** 7,11 ****
/**
* An index into a body of text that knows what words exist and where they are.
! *
* <p><table border='1' cellPadding='3' cellSpacing='0'>
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
--- 7,11 ----
/**
* An index into a body of text that knows what words exist and where they are.
! *
* <p><table border='1' cellPadding='3' cellSpacing='0'>
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
***************
*** 51,53 ****
--- 51,67 ----
*/
public Key getKey(String name) throws NoSuchKeyException;
+
+ /**
+ * Set any modifier for the current and subsequent search.
+ * Using null will clear the search modifier.
+ *
+ * @param modifier how to modify the search and its results.
+ */
+ public void setSearchModifier(SearchModifier modifier);
+
+ /**
+ * Get the current SearchModifier. If there is none then return null.
+ * @return the current search modifier, or null if there is not one.
+ */
+ public SearchModifier getSearchModifier();
}
--- NEW FILE: SearchModifier.java ---
package org.crosswire.jsword.book.search;
/**
* A SearchModifier consists of the kinds of changes that
* can be done to a search.
*
* <p><table border='1' cellPadding='3' cellSpacing='0'>
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
*
* Distribution Licence:<br />
* JSword is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License,
* version 2 as published by the Free Software Foundation.<br />
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.<br />
* The License is available on the internet
* <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, or by writing to:
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA<br />
* The copyright to this program is held by it's authors.
* </font></td></tr></table>
* @see gnu.gpl.Licence
* @author DM Smith [dmsmith555 at gmail dot com]
* @version $Id: SearchModifier.java,v 1.1 2005/04/01 17:09:46 dmsmith Exp $
*/
public interface SearchModifier
{
/**
* @return true if the results of the search request should be ranked
*/
public boolean isRanked();
}
More information about the jsword-svn
mailing list