[jsword-svn] jsword/java/jswordtest/org/crosswire/jsword/book s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Sun May 8 18:29:11 MST 2005


Update of /cvs/jsword/jsword/java/jswordtest/org/crosswire/jsword/book
In directory www.crosswire.org:/tmp/cvs-serv6194/java/jswordtest/org/crosswire/jsword/book

Modified Files:
	SentanceUtilTest.java 
Log Message:
Moved unused code to limbo.
Upgraded support-tools: checkstyle, pmd and findbugs to most recent.
Addressed over 100 issues reported by findbugs and checkstyle.
Resulted in major refactoring of GBFFilter.
Net result is that code size is significantly smaller.

Index: SentanceUtilTest.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jswordtest/org/crosswire/jsword/book/SentanceUtilTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** SentanceUtilTest.java	21 Sep 2004 17:46:24 -0000	1.7
--- SentanceUtilTest.java	9 May 2005 01:29:07 -0000	1.8
***************
*** 48,52 ****
          String[] sa;
  
!         sa = SentanceUtil.tokenize("one two three"); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "one "); //$NON-NLS-1$
--- 48,52 ----
          String[] sa;
  
!         sa = SentenceUtil.tokenize("one two three"); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "one "); //$NON-NLS-1$
***************
*** 54,58 ****
          assertEquals(sa[2], "three"); //$NON-NLS-1$
  
!         sa = SentanceUtil.tokenize("!one  two three "); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "!one "); //$NON-NLS-1$
--- 54,58 ----
          assertEquals(sa[2], "three"); //$NON-NLS-1$
  
!         sa = SentenceUtil.tokenize("!one  two three "); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "!one "); //$NON-NLS-1$
***************
*** 60,64 ****
          assertEquals(sa[2], "three "); //$NON-NLS-1$
  
!         sa = SentanceUtil.tokenize("\"one-- two three "); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "\"one-- "); //$NON-NLS-1$
--- 60,64 ----
          assertEquals(sa[2], "three "); //$NON-NLS-1$
  
!         sa = SentenceUtil.tokenize("\"one-- two three "); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "\"one-- "); //$NON-NLS-1$
***************
*** 66,70 ****
          assertEquals(sa[2], "three "); //$NON-NLS-1$
  
!         sa = SentanceUtil.tokenize("-one--two three "); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "-one--"); //$NON-NLS-1$
--- 66,70 ----
          assertEquals(sa[2], "three "); //$NON-NLS-1$
  
!         sa = SentenceUtil.tokenize("-one--two three "); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "-one--"); //$NON-NLS-1$
***************
*** 72,81 ****
          assertEquals(sa[2], "three "); //$NON-NLS-1$
  
!         sa = SentanceUtil.tokenize("one-two--three "); //$NON-NLS-1$
          assertEquals(sa.length, 2);
          assertEquals(sa[0], "one-two--"); //$NON-NLS-1$
          assertEquals(sa[1], "three "); //$NON-NLS-1$
  
!         sa = SentanceUtil.tokenize("one! \"*(two-three"); //$NON-NLS-1$
          assertEquals(sa.length, 2);
          assertEquals(sa[0], "one! "); //$NON-NLS-1$
--- 72,81 ----
          assertEquals(sa[2], "three "); //$NON-NLS-1$
  
!         sa = SentenceUtil.tokenize("one-two--three "); //$NON-NLS-1$
          assertEquals(sa.length, 2);
          assertEquals(sa[0], "one-two--"); //$NON-NLS-1$
          assertEquals(sa[1], "three "); //$NON-NLS-1$
  
!         sa = SentenceUtil.tokenize("one! \"*(two-three"); //$NON-NLS-1$
          assertEquals(sa.length, 2);
          assertEquals(sa[0], "one! "); //$NON-NLS-1$
***************
*** 83,87 ****
  
          // moved from TestRawBible
!         sa = SentanceUtil.tokenize("one two three"); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "one "); //$NON-NLS-1$
--- 83,87 ----
  
          // moved from TestRawBible
!         sa = SentenceUtil.tokenize("one two three"); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "one "); //$NON-NLS-1$
***************
*** 89,97 ****
          assertEquals(sa[2], "three"); //$NON-NLS-1$
  
!         sa = SentanceUtil.tokenize("one"); //$NON-NLS-1$
          assertEquals(sa.length, 1);
          assertEquals(sa[0], "one"); //$NON-NLS-1$
  
!         sa = SentanceUtil.tokenize("One, !Two-er THREE-er?"); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "One, "); //$NON-NLS-1$
--- 89,97 ----
          assertEquals(sa[2], "three"); //$NON-NLS-1$
  
!         sa = SentenceUtil.tokenize("one"); //$NON-NLS-1$
          assertEquals(sa.length, 1);
          assertEquals(sa[0], "one"); //$NON-NLS-1$
  
!         sa = SentenceUtil.tokenize("One, !Two-er THREE-er?"); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "One, "); //$NON-NLS-1$
***************
*** 99,103 ****
          assertEquals(sa[2], "THREE-er?"); //$NON-NLS-1$
  
!         sa = SentanceUtil.tokenize("One, !Two-er THREE--four?"); //$NON-NLS-1$
          assertEquals(sa.length, 4);
          assertEquals(sa[0], "One, "); //$NON-NLS-1$
--- 99,103 ----
          assertEquals(sa[2], "THREE-er?"); //$NON-NLS-1$
  
!         sa = SentenceUtil.tokenize("One, !Two-er THREE--four?"); //$NON-NLS-1$
          assertEquals(sa.length, 4);
          assertEquals(sa[0], "One, "); //$NON-NLS-1$
***************
*** 182,208 ****
          String[] sa;
  
!         sa = SentanceUtil.stripPunctuation(new String[] { "aaaa" }); //$NON-NLS-1$
          assertEquals(sa.length, 1);
          assertEquals(sa[0], "aaaa"); //$NON-NLS-1$
!         sa = SentanceUtil.stripPunctuation(new String[] { "aaaa", "bbbb" }); //$NON-NLS-1$ //$NON-NLS-2$
          assertEquals(sa.length, 2);
          assertEquals(sa[0], "aaaa"); //$NON-NLS-1$
          assertEquals(sa[1], "bbbb"); //$NON-NLS-1$
!         sa = SentanceUtil.stripPunctuation(new String[] { "One", "Two", "Three" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "One"); //$NON-NLS-1$
          assertEquals(sa[1], "Two"); //$NON-NLS-1$
          assertEquals(sa[2], "Three"); //$NON-NLS-1$
!         sa = SentanceUtil.stripPunctuation(new String[] { " One ", " Two ", " Three " }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "One"); //$NON-NLS-1$
          assertEquals(sa[1], "Two"); //$NON-NLS-1$
          assertEquals(sa[2], "Three"); //$NON-NLS-1$
!         sa = SentanceUtil.stripPunctuation(new String[] { " 'One's' " , "Two?",  "!Three-Four\" " }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "One's"); //$NON-NLS-1$
          assertEquals(sa[1], "Two"); //$NON-NLS-1$
          assertEquals(sa[2], "Three-Four"); //$NON-NLS-1$
!         sa = SentanceUtil.stripPunctuation(new String[] { " 'One's' ", " ,Two? ", " !Three-- ", " Four\" " }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
          assertEquals(sa.length, 4);
          assertEquals(sa[0], "One's"); //$NON-NLS-1$
--- 182,208 ----
          String[] sa;
  
!         sa = SentenceUtil.stripPunctuation(new String[] { "aaaa" }); //$NON-NLS-1$
          assertEquals(sa.length, 1);
          assertEquals(sa[0], "aaaa"); //$NON-NLS-1$
!         sa = SentenceUtil.stripPunctuation(new String[] { "aaaa", "bbbb" }); //$NON-NLS-1$ //$NON-NLS-2$
          assertEquals(sa.length, 2);
          assertEquals(sa[0], "aaaa"); //$NON-NLS-1$
          assertEquals(sa[1], "bbbb"); //$NON-NLS-1$
!         sa = SentenceUtil.stripPunctuation(new String[] { "One", "Two", "Three" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "One"); //$NON-NLS-1$
          assertEquals(sa[1], "Two"); //$NON-NLS-1$
          assertEquals(sa[2], "Three"); //$NON-NLS-1$
!         sa = SentenceUtil.stripPunctuation(new String[] { " One ", " Two ", " Three " }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "One"); //$NON-NLS-1$
          assertEquals(sa[1], "Two"); //$NON-NLS-1$
          assertEquals(sa[2], "Three"); //$NON-NLS-1$
!         sa = SentenceUtil.stripPunctuation(new String[] { " 'One's' " , "Two?",  "!Three-Four\" " }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "One's"); //$NON-NLS-1$
          assertEquals(sa[1], "Two"); //$NON-NLS-1$
          assertEquals(sa[2], "Three-Four"); //$NON-NLS-1$
!         sa = SentenceUtil.stripPunctuation(new String[] { " 'One's' ", " ,Two? ", " !Three-- ", " Four\" " }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
          assertEquals(sa.length, 4);
          assertEquals(sa[0], "One's"); //$NON-NLS-1$
***************
*** 216,220 ****
          String[] sa;
  
!         sa = SentanceUtil.stripWords(StringUtil.split(" 'One's' ,Two? !Three-Four\" ")); //$NON-NLS-1$
          assertEquals(sa.length, 4);
          assertEquals(sa[0], "'"); //$NON-NLS-1$
--- 216,220 ----
          String[] sa;
  
!         sa = SentenceUtil.stripWords(StringUtil.split(" 'One's' ,Two? !Three-Four\" ")); //$NON-NLS-1$
          assertEquals(sa.length, 4);
          assertEquals(sa[0], "'"); //$NON-NLS-1$
***************
*** 223,227 ****
          assertEquals(sa[3], "\""); //$NON-NLS-1$
  
!         sa = SentanceUtil.stripWords(StringUtil.split(" 'One's' ,Two? !Three-- Four\" ")); //$NON-NLS-1$
          assertEquals(sa.length, 5);
          assertEquals(sa[0], "'"); //$NON-NLS-1$
--- 223,227 ----
          assertEquals(sa[3], "\""); //$NON-NLS-1$
  
!         sa = SentenceUtil.stripWords(StringUtil.split(" 'One's' ,Two? !Three-- Four\" ")); //$NON-NLS-1$
          assertEquals(sa.length, 5);
          assertEquals(sa[0], "'"); //$NON-NLS-1$
***************
*** 231,235 ****
          assertEquals(sa[4], "\""); //$NON-NLS-1$
  
!         sa = SentanceUtil.stripWords(new String[] { "'One's'", " ,Two? ", "!Three--", "Four\"" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
          assertEquals(sa.length, 5);
          assertEquals(sa[0], "'"); //$NON-NLS-1$
--- 231,235 ----
          assertEquals(sa[4], "\""); //$NON-NLS-1$
  
!         sa = SentenceUtil.stripWords(new String[] { "'One's'", " ,Two? ", "!Three--", "Four\"" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
          assertEquals(sa.length, 5);
          assertEquals(sa[0], "'"); //$NON-NLS-1$
***************
*** 242,261 ****
      public void testUpdatePassageTally()
      {
!         // SentanceUtil.updatePassageTally(version, tally, words);
      }
  
      public void testUpdatePassageTallyFlat() throws Exception
      {
!         // SentanceUtil.updatePassageTallyFlat(version, tally, words);
      }
  
      public void testGetPassage() throws Exception
      {
!         // Passage ref = SentanceUtil.getPassage(version, words);
      }
  
      public void testIsNewPara() throws Exception
      {
!         // boolean b = SentanceUtil.isNewPara(doc);
      }
  
--- 242,261 ----
      public void testUpdatePassageTally()
      {
!         // SentenceUtil.updatePassageTally(version, tally, words);
      }
  
      public void testUpdatePassageTallyFlat() throws Exception
      {
!         // SentenceUtil.updatePassageTallyFlat(version, tally, words);
      }
  
      public void testGetPassage() throws Exception
      {
!         // Passage ref = SentenceUtil.getPassage(version, words);
      }
  
      public void testIsNewPara() throws Exception
      {
!         // boolean b = SentenceUtil.isNewPara(doc);
      }
  
***************
*** 264,268 ****
          String[] sa;
  
!         sa = SentanceUtil.getWords("One Two three"); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "one"); //$NON-NLS-1$
--- 264,268 ----
          String[] sa;
  
!         sa = SentenceUtil.getWords("One Two three"); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "one"); //$NON-NLS-1$
***************
*** 270,274 ****
          assertEquals(sa[2], "three"); //$NON-NLS-1$
  
!         sa = SentanceUtil.getWords("!one  two three "); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "one"); //$NON-NLS-1$
--- 270,274 ----
          assertEquals(sa[2], "three"); //$NON-NLS-1$
  
!         sa = SentenceUtil.getWords("!one  two three "); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "one"); //$NON-NLS-1$
***************
*** 276,280 ****
          assertEquals(sa[2], "three"); //$NON-NLS-1$
  
!         sa = SentanceUtil.getWords("\"one-- two three "); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "one"); //$NON-NLS-1$
--- 276,280 ----
          assertEquals(sa[2], "three"); //$NON-NLS-1$
  
!         sa = SentenceUtil.getWords("\"one-- two three "); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "one"); //$NON-NLS-1$
***************
*** 282,286 ****
          assertEquals(sa[2], "three"); //$NON-NLS-1$
  
!         sa = SentanceUtil.getWords("-one--two three "); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "one"); //$NON-NLS-1$
--- 282,286 ----
          assertEquals(sa[2], "three"); //$NON-NLS-1$
  
!         sa = SentenceUtil.getWords("-one--two three "); //$NON-NLS-1$
          assertEquals(sa.length, 3);
          assertEquals(sa[0], "one"); //$NON-NLS-1$
***************
*** 288,297 ****
          assertEquals(sa[2], "three"); //$NON-NLS-1$
  
!         sa = SentanceUtil.getWords("one-two--three "); //$NON-NLS-1$
          assertEquals(sa.length, 2);
          assertEquals(sa[0], "one-two"); //$NON-NLS-1$
          assertEquals(sa[1], "three"); //$NON-NLS-1$
  
!         sa = SentanceUtil.getWords("one! \"(two-three"); //$NON-NLS-1$
          assertEquals(sa.length, 2);
          assertEquals(sa[0], "one"); //$NON-NLS-1$
--- 288,297 ----
          assertEquals(sa[2], "three"); //$NON-NLS-1$
  
!         sa = SentenceUtil.getWords("one-two--three "); //$NON-NLS-1$
          assertEquals(sa.length, 2);
          assertEquals(sa[0], "one-two"); //$NON-NLS-1$
          assertEquals(sa[1], "three"); //$NON-NLS-1$
  
!         sa = SentenceUtil.getWords("one! \"(two-three"); //$NON-NLS-1$
          assertEquals(sa.length, 2);
          assertEquals(sa[0], "one"); //$NON-NLS-1$
***************
*** 301,419 ****
      public void testStripPunctuationWord() throws Exception
      {
!         assertEquals(SentanceUtil.stripPunctuationWord("abcde"), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("a---e"), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("a'''e"), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("a'e-e"), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("12345"), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'abcde"), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'a---e"), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'a'''e"), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'a'e-e"), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'12345"), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'abcde'"), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'a---e'"), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'a'''e'"), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'a'e-e'"), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'12345'"), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'-abcde--"), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'-a---e--"), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'-a'''e--"), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'-a'e-e--"), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'-12345--"), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("$'-abcde-'*"), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("$'-a---e-'*"), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("$'-a'''e-'*"), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("$'-a'e-e-'*"), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("$'-12345-'*"), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("`'-abcde-'["), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("`'-a---e-'["), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("`'-a'''e-'["), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("`'-a'e-e-'["), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("`'-12345-'["), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("#'-abcde-'}"), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("#'-a---e-'}"), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("#'-a'''e-'}"), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("#'-a'e-e-'}"), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("#'-12345-'}"), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("%'-abcde-'/"), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("%'-a---e-'/"), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("%'-a'''e-'/"), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("%'-a'e-e-'/"), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("%'-12345-'/"), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
  
!         assertEquals(SentanceUtil.stripPunctuationWord("test"), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord(" test"), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("test-- "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("test! "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("test\" "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("test... "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("test's"), "test's"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("test's "), "test's"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("test's!"), "test's"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("test's?"), "test's"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("test!?;;'#\""), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("!\"%$test"), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("   test "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("--test "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("'test "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord("/?test "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentanceUtil.stripPunctuationWord(" $%^\" test %^&"), "test"); //$NON-NLS-1$ //$NON-NLS-2$
      }
  
      public void testStripWordsStringString() throws Exception
      {
!         // String s = SentanceUtil.stripWords(first, last);
      }
  
      public void testFirstLetter() throws Exception
      {
!         assertEquals(SentanceUtil.firstLetter("abcde"), 0); //$NON-NLS-1$
!         assertEquals(SentanceUtil.firstLetter(" abcde"), 1); //$NON-NLS-1$
!         assertEquals(SentanceUtil.firstLetter(" \"%abcde"), 3); //$NON-NLS-1$
!         assertEquals(SentanceUtil.firstLetter(" \"%abcde--!   "), 3); //$NON-NLS-1$
      }
  
      public void testLastLetter() throws Exception
      {
!         assertEquals(SentanceUtil.lastLetter("abcde"), 4); //$NON-NLS-1$
!         assertEquals(SentanceUtil.lastLetter("abcde "), 4); //$NON-NLS-1$
!         assertEquals(SentanceUtil.lastLetter("abcde\" "), 4); //$NON-NLS-1$
!         assertEquals(SentanceUtil.lastLetter("abcde\"%$ "), 4); //$NON-NLS-1$
!         assertEquals(SentanceUtil.lastLetter(" abcde"), 5); //$NON-NLS-1$
!         assertEquals(SentanceUtil.lastLetter(" abcde "), 5); //$NON-NLS-1$
!         assertEquals(SentanceUtil.lastLetter(" abcde\" "), 5); //$NON-NLS-1$
!         assertEquals(SentanceUtil.lastLetter(" abcde\"%$ "), 5); //$NON-NLS-1$
!         assertEquals(SentanceUtil.lastLetter(" abcde--\"%$ "), 5); //$NON-NLS-1$
!         assertEquals(SentanceUtil.lastLetter(" abcde\"%$-- "), 5); //$NON-NLS-1$
      }
  
      public void testStripWords()
      {
!         assertEquals(SentanceUtil.stripWords("one", "two"), ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one,", "two"), ","); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one'", "two"), "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one-", "two"), "-"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one#", "two"), "#"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one", ",two"), ","); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one", "'two"), "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one", "-two"), "-"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one", "#two"), "#"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one-", "-two"), "--"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("-one-", "-two-"), "--"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one-world", "two"), ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one-world'", "two"), "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one ", "two"), " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one, ", "two"), ", "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one' ", "two"), "' "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one- ", "two"), "- "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one# ", "two"), "# "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one", " ,two"), " ,"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one", " 'two"), " '"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one", " -two"), " -"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one" , "#two"), "#"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one- ", "-two"), "- -"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("-one- ", "-two-"), "- -"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one-world ", "two"), " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentanceUtil.stripWords("one-world'", " two"), "' "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
      }
  }
--- 301,419 ----
      public void testStripPunctuationWord() throws Exception
      {
!         assertEquals(SentenceUtil.stripPunctuationWord("abcde"), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("a---e"), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("a'''e"), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("a'e-e"), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("12345"), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'abcde"), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'a---e"), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'a'''e"), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'a'e-e"), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'12345"), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'abcde'"), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'a---e'"), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'a'''e'"), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'a'e-e'"), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'12345'"), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'-abcde--"), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'-a---e--"), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'-a'''e--"), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'-a'e-e--"), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'-12345--"), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("$'-abcde-'*"), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("$'-a---e-'*"), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("$'-a'''e-'*"), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("$'-a'e-e-'*"), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("$'-12345-'*"), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("`'-abcde-'["), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("`'-a---e-'["), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("`'-a'''e-'["), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("`'-a'e-e-'["), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("`'-12345-'["), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("#'-abcde-'}"), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("#'-a---e-'}"), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("#'-a'''e-'}"), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("#'-a'e-e-'}"), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("#'-12345-'}"), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("%'-abcde-'/"), "abcde"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("%'-a---e-'/"), "a---e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("%'-a'''e-'/"), "a'''e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("%'-a'e-e-'/"), "a'e-e"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("%'-12345-'/"), "12345"); //$NON-NLS-1$ //$NON-NLS-2$
  
!         assertEquals(SentenceUtil.stripPunctuationWord("test"), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord(" test"), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("test-- "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("test! "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("test\" "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("test... "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("test's"), "test's"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("test's "), "test's"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("test's!"), "test's"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("test's?"), "test's"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("test!?;;'#\""), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("!\"%$test"), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("   test "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("--test "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("'test "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord("/?test "), "test"); //$NON-NLS-1$ //$NON-NLS-2$
!         assertEquals(SentenceUtil.stripPunctuationWord(" $%^\" test %^&"), "test"); //$NON-NLS-1$ //$NON-NLS-2$
      }
  
      public void testStripWordsStringString() throws Exception
      {
!         // String s = SentenceUtil.stripWords(first, last);
      }
  
      public void testFirstLetter() throws Exception
      {
!         assertEquals(SentenceUtil.firstLetter("abcde"), 0); //$NON-NLS-1$
!         assertEquals(SentenceUtil.firstLetter(" abcde"), 1); //$NON-NLS-1$
!         assertEquals(SentenceUtil.firstLetter(" \"%abcde"), 3); //$NON-NLS-1$
!         assertEquals(SentenceUtil.firstLetter(" \"%abcde--!   "), 3); //$NON-NLS-1$
      }
  
      public void testLastLetter() throws Exception
      {
!         assertEquals(SentenceUtil.lastLetter("abcde"), 4); //$NON-NLS-1$
!         assertEquals(SentenceUtil.lastLetter("abcde "), 4); //$NON-NLS-1$
!         assertEquals(SentenceUtil.lastLetter("abcde\" "), 4); //$NON-NLS-1$
!         assertEquals(SentenceUtil.lastLetter("abcde\"%$ "), 4); //$NON-NLS-1$
!         assertEquals(SentenceUtil.lastLetter(" abcde"), 5); //$NON-NLS-1$
!         assertEquals(SentenceUtil.lastLetter(" abcde "), 5); //$NON-NLS-1$
!         assertEquals(SentenceUtil.lastLetter(" abcde\" "), 5); //$NON-NLS-1$
!         assertEquals(SentenceUtil.lastLetter(" abcde\"%$ "), 5); //$NON-NLS-1$
!         assertEquals(SentenceUtil.lastLetter(" abcde--\"%$ "), 5); //$NON-NLS-1$
!         assertEquals(SentenceUtil.lastLetter(" abcde\"%$-- "), 5); //$NON-NLS-1$
      }
  
      public void testStripWords()
      {
!         assertEquals(SentenceUtil.stripWords("one", "two"), ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one,", "two"), ","); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one'", "two"), "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one-", "two"), "-"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one#", "two"), "#"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one", ",two"), ","); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one", "'two"), "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one", "-two"), "-"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one", "#two"), "#"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one-", "-two"), "--"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("-one-", "-two-"), "--"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one-world", "two"), ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one-world'", "two"), "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one ", "two"), " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one, ", "two"), ", "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one' ", "two"), "' "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one- ", "two"), "- "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one# ", "two"), "# "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one", " ,two"), " ,"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one", " 'two"), " '"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one", " -two"), " -"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one" , "#two"), "#"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one- ", "-two"), "- -"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("-one- ", "-two-"), "- -"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one-world ", "two"), " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!         assertEquals(SentenceUtil.stripWords("one-world'", " two"), "' "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
      }
  }



More information about the jsword-svn mailing list