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

jswordcvs at crosswire.org jswordcvs at crosswire.org
Tue Mar 8 19:26:05 MST 2005


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

Modified Files:
	CustomTokenizer.java 
Log Message:
Bug fixes.

Index: CustomTokenizer.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/parse/CustomTokenizer.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** CustomTokenizer.java	6 Mar 2005 20:21:47 -0000	1.10
--- CustomTokenizer.java	9 Mar 2005 02:26:03 -0000	1.11
***************
*** 54,67 ****
          List output = new ArrayList();
          String commandChars = getSingleCharWords(commands);
!         int currentType = charType(sought.charAt(0), commandChars);
          int startIndex = 0;
  
!         // If the first character is a [ then we have a problem because
          // the loop starts with the second character because it needs
!         // something to compare with - so if we do start with a [ then
          // we make sure that we prepend with a " "
!         if (sought.length() > 0 && sought.charAt(0) == '[')
          {
!             sought = " " + sought; //$NON-NLS-1$
          }
  
--- 54,68 ----
          List output = new ArrayList();
          String commandChars = getSingleCharWords(commands);
!         char firstChar = sought.charAt(0);
!         int currentType = charType(firstChar, commandChars);
          int startIndex = 0;
  
!         // If the first character is a [  or : then we have a problem because
          // the loop starts with the second character because it needs
!         // something to compare with - so if we do start with a [ or : then
          // we make sure that we prepend with a " "
!         if (sought.length() > 0 && (firstChar == '[' || firstChar == ':'))
          {
!             sought = ' ' + sought;
          }
  
***************
*** 89,98 ****
              // 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();
                  }
--- 90,99 ----
              // 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) == i) //$NON-NLS-1$
              {
                  int end = sought.indexOf("::", i + 2); //$NON-NLS-1$
                  if (end == -1)
                  {
!                     addWord(output, commands, sought.substring(i + 2));
                      i = sought.length();
                  }



More information about the jsword-svn mailing list