@Test public void testExtract() { logger.info("extract"); String text = "this is a text sequence that is amazing text sequence"; UniqueWordSequenceExtractor instance = new UniqueWordSequenceExtractor(new UniqueWordSequenceExtractor.Parameters()); Map<Integer, String> expResult = new LinkedHashMap<>(); expResult.put(0, "this"); expResult.put(1, "is"); expResult.put(2, "a"); expResult.put(3, "text"); expResult.put(4, "sequence"); expResult.put(5, "that"); expResult.put(6, "amazing"); Map<Integer, String> result = instance.extract(text); assertEquals(expResult, result); }
@Override public Map<Integer, String> extract(final String text) { Set<String> tmpKwd = new LinkedHashSet<>(generateTokenizer().tokenize(text)); Map<Integer, String> keywordSequence = new LinkedHashMap<>(); int position = 0; for(String keyword : tmpKwd) { keywordSequence.put(position, keyword); ++position; } return keywordSequence; }
UniqueWordSequenceExtractor extends AbstractTextExtractor<UniqueWordSequenceExtractor.Parameters, Integer, String> { @Override public Map<Integer, String> extract(final String text) { Set<String> tmpKwd = new LinkedHashSet<>(generateTokenizer().tokenize(text)); Map<Integer, String> keywordSequence = new LinkedHashMap<>(); int position = 0; for(String keyword : tmpKwd) { keywordSequence.put(position, keyword); ++position; } return keywordSequence; } }
UniqueWordSequenceExtractor extends AbstractTextExtractor<UniqueWordSequenceExtractor.Parameters, Integer, String> { @Override public Map<Integer, String> extract(final String text) { Set<String> tmpKwd = new LinkedHashSet<>(generateTokenizer().tokenize(text)); Map<Integer, String> keywordSequence = new LinkedHashMap<>(); int position = 0; for(String keyword : tmpKwd) { keywordSequence.put(position, keyword); ++position; } return keywordSequence; } UniqueWordSequenceExtractor(Parameters parameters); }
UniqueWordSequenceExtractor extends AbstractTextExtractor<UniqueWordSequenceExtractor.Parameters, Integer, String> { @Override public Map<Integer, String> extract(final String text) { Set<String> tmpKwd = new LinkedHashSet<>(generateTokenizer().tokenize(text)); Map<Integer, String> keywordSequence = new LinkedHashMap<>(); int position = 0; for(String keyword : tmpKwd) { keywordSequence.put(position, keyword); ++position; } return keywordSequence; } UniqueWordSequenceExtractor(Parameters parameters); @Override Map<Integer, String> extract(final String text); }
UniqueWordSequenceExtractor extends AbstractTextExtractor<UniqueWordSequenceExtractor.Parameters, Integer, String> { @Override public Map<Integer, String> extract(final String text) { Set<String> tmpKwd = new LinkedHashSet<>(generateTokenizer().tokenize(text)); Map<Integer, String> keywordSequence = new LinkedHashMap<>(); int position = 0; for(String keyword : tmpKwd) { keywordSequence.put(position, keyword); ++position; } return keywordSequence; } UniqueWordSequenceExtractor(Parameters parameters); @Override Map<Integer, String> extract(final String text);  }