*** Test 1 *** countOccurences("wettergott", "gott", false)=1 countOccurences("wettergott", "tt", false)=2 countOccurences("wettergott", "t", false)=4 countOccurences("er ist kaiser", "er", false)=2 countOccurences("er ist kaiser", "er", true)=1 countOccurences("er ist kaiser", "kaiser", true)=1 countOccurences("annanna", "anna", false)=2 countOccurences("annanna", "anna", false)=2 countOccurences("aaa", "aa", false)=2 *** Test 2 *** Pattern # Brute # Boyer --------------------------------------------- a 634 127 634 154 affectionately 1 103 1 31 alarm 2 105 2 43 alarmed 1 104 1 41 alas 4 107 4 42 alice 417 109 417 48 alive 3 106 3 46 all 182 106 182 68 allow 3 108 3 52 almost 6 105 6 37 alone 4 108 4 42 along 6 105 6 35 aloud 5 105 5 37 already 2 105 2 28 also 2 104 2 42 altered 1 105 1 40 alternately 1 105 1 47 altogether 5 107 5 50 always 13 105 13 51 and 883 112 883 59 circumstances 1 83 1 26 competition 0 84 0 26 contemptuously 2 84 2 25 conversations 1 85 1 27 demonstrating 1 93 1 28 disappointment 1 92 1 29 extraordinary 2 119 2 25 freedom 0 82 0 28 i 545 107 545 119 inquisitively 1 135 1 25 intensified 0 108 0 27 it 595 107 595 79 multiplication 1 82 1 27 of 517 103 517 56 reconciliation 0 95 0 26 she 553 100 553 69 somersaulting 1 97 1 28 straightening 1 99 1 26 the 1648 128 1648 78 to 736 113 736 70 uncomfortable 4 87 4 28 uncomfortably 1 87 1 24 --------------------------------------------- 6786 4311 6786 1889 *** Test 3 *** isWholeWord("er ist kaiser", 0, 2)=true isWholeWord("er ist kaiser", 11, 13)=false isWholeWord("kaiser ist er", 11, 13)=true