@Test public void emptyPhrase(){ KnownPhrasePreserver target = new KnownPhrasePreserver(tokens, "Software Test^ "); boolean [] actual = target.preserveKnownPhrases(parsing.getBoundaries()); boolean [] expected = new boolean[] {false, true, true, true}; for(int i = 0; i < actual.length; ++i) { Assert.assertTrue(actual[i] == expected[i]); } }
public boolean[] preserveKnownPhrases(boolean [] boundaries) { for(TokenizedString phrase : knownPhrases) { int start = 0; while (start < tokens.tokens.length) { start = preservePhraseOccurrance(boundaries, phrase, start); } } return boundaries; }
KnownPhrasePreserver { public boolean[] preserveKnownPhrases(boolean [] boundaries) { for(TokenizedString phrase : knownPhrases) { int start = 0; while (start < tokens.tokens.length) { start = preservePhraseOccurrance(boundaries, phrase, start); } } return boundaries; } }
KnownPhrasePreserver { public boolean[] preserveKnownPhrases(boolean [] boundaries) { for(TokenizedString phrase : knownPhrases) { int start = 0; while (start < tokens.tokens.length) { start = preservePhraseOccurrance(boundaries, phrase, start); } } return boundaries; } KnownPhrasePreserver(TokenizedString tokens, String knownPhrases); }
KnownPhrasePreserver { public boolean[] preserveKnownPhrases(boolean [] boundaries) { for(TokenizedString phrase : knownPhrases) { int start = 0; while (start < tokens.tokens.length) { start = preservePhraseOccurrance(boundaries, phrase, start); } } return boundaries; } KnownPhrasePreserver(TokenizedString tokens, String knownPhrases); boolean[] preserveKnownPhrases(boolean [] boundaries); }
KnownPhrasePreserver { public boolean[] preserveKnownPhrases(boolean [] boundaries) { for(TokenizedString phrase : knownPhrases) { int start = 0; while (start < tokens.tokens.length) { start = preservePhraseOccurrance(boundaries, phrase, start); } } return boundaries; } KnownPhrasePreserver(TokenizedString tokens, String knownPhrases); boolean[] preserveKnownPhrases(boolean [] boundaries);  }