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

jswordcvs at crosswire.org jswordcvs at crosswire.org
Tue Feb 15 17:53:51 MST 2005


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

Modified Files:
	CustomTokenizer.java 
Log Message:
Added the ability to pass through a query to the underlying parser.
Everything between ::  and :: is taken as a single DefaultWord.
If there is no trailing :: everything following it to the end is taken.

Index: CustomTokenizer.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/parse/CustomTokenizer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** CustomTokenizer.java	16 Aug 2004 22:08:42 -0000	1.8
--- CustomTokenizer.java	16 Feb 2005 00:53:49 -0000	1.9
***************
*** 85,88 ****
--- 85,107 ----
                  i = end + 1;
              }
+             
+             // Pass through everything between pairs of :: e.g. ::bread::
+             // as a single word. If there is no trailing :: take it
+             // to the end of the line
+             if (i < sought.length() - 4 && sought.indexOf("::", i) != -1) //$NON-NLS-1$
+             {
+                 int end = sought.indexOf("::", i+2); //$NON-NLS-1$
+                 if (end == -1)
+                 {
+                     addWord(output, commands, sought.substring(i+1));
+                     i = sought.length();
+                 }
+                 else
+                 {
+                     addWord(output, commands, sought.substring(i+1, end));
+                     i = end + 2;
+                 }
+                 currentType = CHAR_SPACE;
+             }
  
              // If this is the last word then so long as this letter is not



More information about the jsword-svn mailing list