[jsword-svn]
jsword/java/jswordtest/org/crosswire/jsword/book/search/parse s
jswordcvs at crosswire.org
jswordcvs at crosswire.org
Sat Oct 9 14:45:07 MST 2004
Update of /cvs/jsword/jsword/java/jswordtest/org/crosswire/jsword/book/search/parse
In directory www.crosswire.org:/tmp/cvs-serv30045/java/jswordtest/org/crosswire/jsword/book/search/parse
Modified Files:
WordsTest.java ParserTest.java
Log Message:
indexing updates
Index: WordsTest.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jswordtest/org/crosswire/jsword/book/search/parse/WordsTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** WordsTest.java 29 Sep 2004 22:21:23 -0000 1.3
--- WordsTest.java 9 Oct 2004 21:45:05 -0000 1.4
***************
*** 5,10 ****
import junit.framework.TestCase;
- import org.crosswire.jsword.book.Search;
-
/**
* JUnit Test.
--- 5,8 ----
***************
*** 62,115 ****
public void testAddCommandWord() throws Exception
{
! assertEquals(engine.search("t1", Search.UNRESTRICTED).getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t2", Search.UNRESTRICTED).getName(), "Deu 28:1-1Sa 1:1"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("/t1", Search.UNRESTRICTED).getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("/t2", Search.UNRESTRICTED).getName(), "Deu 28:1-1Sa 1:1"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("|t1", Search.UNRESTRICTED).getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("|t2", Search.UNRESTRICTED).getName(), "Deu 28:1-1Sa 1:1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testRetainCommandWord() throws Exception
{
! assertEquals(engine.search("t2&t1", Search.UNRESTRICTED).getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1&t2", Search.UNRESTRICTED).getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t2+t1", Search.UNRESTRICTED).getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1+t2", Search.UNRESTRICTED).getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t2,t1", Search.UNRESTRICTED).getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1,t2", Search.UNRESTRICTED).getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testRemoveCommandWord() throws Exception
{
! assertEquals(engine.search("t2-t1", Search.UNRESTRICTED).getName(), "Deu 28-Rut 1, Rut 3:1-1Sa 1:1"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1-t2", Search.UNRESTRICTED).getName(), ""); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testBlurCommandWord() throws Exception
{
! assertEquals(engine.search("t3 ~1", Search.UNRESTRICTED).getName(), "Mar 2:2-4"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t3 ~2", Search.UNRESTRICTED).getName(), "Mar 2:1-5"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t3 ~3", Search.UNRESTRICTED).getName(), "Mar 2:1-6"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t3 ~4", Search.UNRESTRICTED).getName(), "Mar 2:1-7"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t3 ~5", Search.UNRESTRICTED).getName(), "Mar 2:1-8"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testStartsParamWord() throws Exception
{
! //assertEquals(engine.search("startswith joshu", Search.UNRESTRICTED), engine.search("joshua", Search.UNRESTRICTED));
! //assertEquals(engine.search("sw joshu", Search.UNRESTRICTED), engine.search("joshua", Search.UNRESTRICTED));
}
public void testSubXParamWord() throws Exception
{
! assertEquals(engine.search("t3 / ( t2 )", Search.UNRESTRICTED).getName(), "Deu 28:1-1Sa 1:1, Mar 2:3"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t3/(t2)", Search.UNRESTRICTED).getName(), "Deu 28:1-1Sa 1:1, Mar 2:3"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1 & t2 | t3", Search.UNRESTRICTED).getName(), "Rut 2, Mar 2:3"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1 & t2 - t3", Search.UNRESTRICTED).getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("( t1 & t2 ) | t3", Search.UNRESTRICTED).getName(), "Rut 2, Mar 2:3"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1 & ( t2 | t3 )", Search.UNRESTRICTED).getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1 & ( t2 | t3 ) & ( t3 | t2 )", Search.UNRESTRICTED).getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1&(t2|t3)&(t3|t2)", Search.UNRESTRICTED).getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1&(t2|(t3))&(t3|t2)", Search.UNRESTRICTED).getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
}
--- 60,113 ----
public void testAddCommandWord() throws Exception
{
! assertEquals(engine.search("t1").getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t2").getName(), "Deu 28:1-1Sa 1:1"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("/t1").getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("/t2").getName(), "Deu 28:1-1Sa 1:1"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("|t1").getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("|t2").getName(), "Deu 28:1-1Sa 1:1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testRetainCommandWord() throws Exception
{
! assertEquals(engine.search("t2&t1").getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1&t2").getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t2+t1").getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1+t2").getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t2,t1").getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1,t2").getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testRemoveCommandWord() throws Exception
{
! assertEquals(engine.search("t2-t1").getName(), "Deu 28-Rut 1, Rut 3:1-1Sa 1:1"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1-t2").getName(), ""); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testBlurCommandWord() throws Exception
{
! assertEquals(engine.search("t3 ~1").getName(), "Mar 2:2-4"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t3 ~2").getName(), "Mar 2:1-5"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t3 ~3").getName(), "Mar 2:1-6"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t3 ~4").getName(), "Mar 2:1-7"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t3 ~5").getName(), "Mar 2:1-8"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testStartsParamWord() throws Exception
{
! //assertEquals(engine.search("startswith joshu"), engine.search("joshua"));
! //assertEquals(engine.search("sw joshu"), engine.search("joshua"));
}
public void testSubXParamWord() throws Exception
{
! assertEquals(engine.search("t3 / ( t2 )").getName(), "Deu 28:1-1Sa 1:1, Mar 2:3"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t3/(t2)").getName(), "Deu 28:1-1Sa 1:1, Mar 2:3"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1 & t2 | t3").getName(), "Rut 2, Mar 2:3"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1 & t2 - t3").getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("( t1 & t2 ) | t3").getName(), "Rut 2, Mar 2:3"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1 & ( t2 | t3 )").getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1 & ( t2 | t3 ) & ( t3 | t2 )").getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1&(t2|t3)&(t3|t2)").getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
! assertEquals(engine.search("t1&(t2|(t3))&(t3|t2)").getName(), "Rut 2"); //$NON-NLS-1$ //$NON-NLS-2$
}
***************
*** 131,136 ****
public void testUpdatePassage() throws Exception
{
! //assertEquals(engine.search("grammar joseph", Search.UNRESTRICTED), engine.search("joseph / joseph's", Search.UNRESTRICTED));
! //assertEquals(engine.search("gr joseph", Search.UNRESTRICTED), engine.search("joseph / joseph's", Search.UNRESTRICTED));
}
}
\ No newline at end of file
--- 129,134 ----
public void testUpdatePassage() throws Exception
{
! //assertEquals(engine.search("grammar joseph"), engine.search("joseph / joseph's"));
! //assertEquals(engine.search("gr joseph"), engine.search("joseph / joseph's"));
}
}
\ No newline at end of file
Index: ParserTest.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jswordtest/org/crosswire/jsword/book/search/parse/ParserTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ParserTest.java 29 Sep 2004 22:21:23 -0000 1.7
--- ParserTest.java 9 Oct 2004 21:45:05 -0000 1.8
***************
*** 4,8 ****
import org.crosswire.jsword.book.BookException;
- import org.crosswire.jsword.book.Search;
/**
--- 4,7 ----
***************
*** 54,74 ****
//try { engine.search(new Search("moses aaron", false)); fail(); } catch (BookException ex) { }
! try { engine.search("(", Search.UNRESTRICTED); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("~", Search.UNRESTRICTED); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search(")", Search.UNRESTRICTED); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("&", Search.UNRESTRICTED); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search(",", Search.UNRESTRICTED); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("+", Search.UNRESTRICTED); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("-", Search.UNRESTRICTED); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("/", Search.UNRESTRICTED); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("|", Search.UNRESTRICTED); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("sw", Search.UNRESTRICTED); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("startswith", Search.UNRESTRICTED); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("gr", Search.UNRESTRICTED); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("grammar", Search.UNRESTRICTED); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! //try { engine.search("moses ( aaron )", Search.UNRESTRICTED); fail(); } catch (BookException ex) { }
! //try { engine.search("moses & ( aaron", Search.UNRESTRICTED); fail(); } catch (BookException ex) { }
! //try { engine.search("moses & ( aaron", Search.UNRESTRICTED); fail(); } catch (BookException ex) { }
! //try { engine.search("( moses ( aaron ) )", Search.UNRESTRICTED); fail(); } catch (BookException ex) { }
}
--- 53,73 ----
//try { engine.search(new Search("moses aaron", false)); fail(); } catch (BookException ex) { }
! try { engine.search("("); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("~"); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search(")"); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("&"); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search(","); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("+"); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("-"); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("/"); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("|"); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("sw"); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("startswith"); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("gr"); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! try { engine.search("grammar"); fail(); } catch (BookException ex) { } //$NON-NLS-1$
! //try { engine.search("moses ( aaron )"); fail(); } catch (BookException ex) { }
! //try { engine.search("moses & ( aaron"); fail(); } catch (BookException ex) { }
! //try { engine.search("moses & ( aaron"); fail(); } catch (BookException ex) { }
! //try { engine.search("( moses ( aaron ) )"); fail(); } catch (BookException ex) { }
}
More information about the jsword-svn
mailing list