@Test(expected = NullPointerException.class) public void calcSimilarWordNumber_FindWords_NULL() { calculator.calcSimilarWordNumber(null, ImmutableList.of("A")); }
public int calcSimilarWordNumber(List<String> findWords, List<String> inWords) { Preconditions.checkNotNull(findWords); Preconditions.checkNotNull(inWords); int similarWordCount = 0; for (String word : findWords) { if (similarityChecker.containsSimilarString(inWords, word, minWordSimilarity)) { ++similarWordCount; } } return similarWordCount; }
CommonSimilarWordCalculator implements Serializable { public int calcSimilarWordNumber(List<String> findWords, List<String> inWords) { Preconditions.checkNotNull(findWords); Preconditions.checkNotNull(inWords); int similarWordCount = 0; for (String word : findWords) { if (similarityChecker.containsSimilarString(inWords, word, minWordSimilarity)) { ++similarWordCount; } } return similarWordCount; } }
CommonSimilarWordCalculator implements Serializable { public int calcSimilarWordNumber(List<String> findWords, List<String> inWords) { Preconditions.checkNotNull(findWords); Preconditions.checkNotNull(inWords); int similarWordCount = 0; for (String word : findWords) { if (similarityChecker.containsSimilarString(inWords, word, minWordSimilarity)) { ++similarWordCount; } } return similarWordCount; } CommonSimilarWordCalculator(double minWordSimilarity); }
CommonSimilarWordCalculator implements Serializable { public int calcSimilarWordNumber(List<String> findWords, List<String> inWords) { Preconditions.checkNotNull(findWords); Preconditions.checkNotNull(inWords); int similarWordCount = 0; for (String word : findWords) { if (similarityChecker.containsSimilarString(inWords, word, minWordSimilarity)) { ++similarWordCount; } } return similarWordCount; } CommonSimilarWordCalculator(double minWordSimilarity); int calcSimilarWordNumber(List<String> findWords, List<String> inWords); double calcSimilarWordRatio(List<String> findWords, List<String> inWords); void setMinWordSimilarity(float minWordSimilarity); void setSimilarityChecker(StringSimilarityChecker similarityChecker); @Override String toString(); }
CommonSimilarWordCalculator implements Serializable { public int calcSimilarWordNumber(List<String> findWords, List<String> inWords) { Preconditions.checkNotNull(findWords); Preconditions.checkNotNull(inWords); int similarWordCount = 0; for (String word : findWords) { if (similarityChecker.containsSimilarString(inWords, word, minWordSimilarity)) { ++similarWordCount; } } return similarWordCount; } CommonSimilarWordCalculator(double minWordSimilarity); int calcSimilarWordNumber(List<String> findWords, List<String> inWords); double calcSimilarWordRatio(List<String> findWords, List<String> inWords); void setMinWordSimilarity(float minWordSimilarity); void setSimilarityChecker(StringSimilarityChecker similarityChecker); @Override String toString();  }