@Test public void testFactoryBuildFromLines() { BagOfWordsFactory factory = new BagOfWordsFactory(ImmutableSet.of()); BagOfWords bag = factory.bagLines(ImmutableList.of("test test", "other other", "test. other", "other/test")); assertFalse(bag.isEmpty()); assertTrue(bag.contains("test")); assertTrue(bag.contains("other")); assertFalse(bag.contains("TEST")); assertEquals(4, bag.count("test")); assertEquals(4, bag.count("other")); assertEquals(0, bag.count("TEST")); assertFalse(bag.contains("missing")); }
public BagOfWords bagLines(Collection<String> lines) { return bagLines(lines.stream()); }
BagOfWordsFactory { public BagOfWords bagLines(Collection<String> lines) { return bagLines(lines.stream()); } }
BagOfWordsFactory { public BagOfWords bagLines(Collection<String> lines) { return bagLines(lines.stream()); } BagOfWordsFactory(Collection<String> stopwords); }
BagOfWordsFactory { public BagOfWords bagLines(Collection<String> lines) { return bagLines(lines.stream()); } BagOfWordsFactory(Collection<String> stopwords); BagOfWords bag(Collection<String> words); BagOfWords bagSentences(Collection<Sentence> sentences); BagOfWords bagLines(Collection<String> lines); }
BagOfWordsFactory { public BagOfWords bagLines(Collection<String> lines) { return bagLines(lines.stream()); } BagOfWordsFactory(Collection<String> stopwords); BagOfWords bag(Collection<String> words); BagOfWords bagSentences(Collection<Sentence> sentences); BagOfWords bagLines(Collection<String> lines);  }