@Test public void testExtract() { logger.info("extract"); String text = "this is a text sequence that is amazing text sequence"; WordSequenceExtractor instance = new WordSequenceExtractor(new WordSequenceExtractor.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, "is"); expResult.put(7, "amazing"); expResult.put(8, "text"); expResult.put(9, "sequence"); Map<Integer, String> result = instance.extract(text); assertEquals(expResult, result); }
@Override public Map<Integer, String> extract(final String text) { List<String> tmpKwd = generateTokenizer().tokenize(text); Map<Integer, String> keywordSequence = new LinkedHashMap<>(); int position = 0; for(String keyword : tmpKwd) { keywordSequence.put(position, keyword); ++position; } return keywordSequence; }
WordSequenceExtractor extends AbstractTextExtractor<WordSequenceExtractor.Parameters, Integer, String> { @Override public Map<Integer, String> extract(final String text) { List<String> tmpKwd = generateTokenizer().tokenize(text); Map<Integer, String> keywordSequence = new LinkedHashMap<>(); int position = 0; for(String keyword : tmpKwd) { keywordSequence.put(position, keyword); ++position; } return keywordSequence; } }
WordSequenceExtractor extends AbstractTextExtractor<WordSequenceExtractor.Parameters, Integer, String> { @Override public Map<Integer, String> extract(final String text) { List<String> tmpKwd = generateTokenizer().tokenize(text); Map<Integer, String> keywordSequence = new LinkedHashMap<>(); int position = 0; for(String keyword : tmpKwd) { keywordSequence.put(position, keyword); ++position; } return keywordSequence; } WordSequenceExtractor(Parameters parameters); }
WordSequenceExtractor extends AbstractTextExtractor<WordSequenceExtractor.Parameters, Integer, String> { @Override public Map<Integer, String> extract(final String text) { List<String> tmpKwd = generateTokenizer().tokenize(text); Map<Integer, String> keywordSequence = new LinkedHashMap<>(); int position = 0; for(String keyword : tmpKwd) { keywordSequence.put(position, keyword); ++position; } return keywordSequence; } WordSequenceExtractor(Parameters parameters); @Override Map<Integer, String> extract(final String text); }
WordSequenceExtractor extends AbstractTextExtractor<WordSequenceExtractor.Parameters, Integer, String> { @Override public Map<Integer, String> extract(final String text) { List<String> tmpKwd = generateTokenizer().tokenize(text); Map<Integer, String> keywordSequence = new LinkedHashMap<>(); int position = 0; for(String keyword : tmpKwd) { keywordSequence.put(position, keyword); ++position; } return keywordSequence; } WordSequenceExtractor(Parameters parameters); @Override Map<Integer, String> extract(final String text);  }