@Test public void testEmpty() throws Exception { DictionaryServiceImpl service = new DictionaryServiceImpl(); Assert.assertEquals(null, service.cleanUpText("")); }
@Override public Textual cleanUpText(String text) { logger.debug("Text input: “{}”", text); LinkedList<String> words = new LinkedList<String>(); Matcher matcher = compilesPattern.matcher(text); while (matcher.find()) { words.add(matcher.group()); } String result = org.apache.commons.lang3.StringUtils.join(words, " "); logger.debug("Resulting text: “{}”", result); if ("".equals(result)) { return null; } return new TextualImpl(result); }
DictionaryServiceImpl implements DictionaryService, ManagedService { @Override public Textual cleanUpText(String text) { logger.debug("Text input: “{}”", text); LinkedList<String> words = new LinkedList<String>(); Matcher matcher = compilesPattern.matcher(text); while (matcher.find()) { words.add(matcher.group()); } String result = org.apache.commons.lang3.StringUtils.join(words, " "); logger.debug("Resulting text: “{}”", result); if ("".equals(result)) { return null; } return new TextualImpl(result); } }
DictionaryServiceImpl implements DictionaryService, ManagedService { @Override public Textual cleanUpText(String text) { logger.debug("Text input: “{}”", text); LinkedList<String> words = new LinkedList<String>(); Matcher matcher = compilesPattern.matcher(text); while (matcher.find()) { words.add(matcher.group()); } String result = org.apache.commons.lang3.StringUtils.join(words, " "); logger.debug("Resulting text: “{}”", result); if ("".equals(result)) { return null; } return new TextualImpl(result); }  }
DictionaryServiceImpl implements DictionaryService, ManagedService { @Override public Textual cleanUpText(String text) { logger.debug("Text input: “{}”", text); LinkedList<String> words = new LinkedList<String>(); Matcher matcher = compilesPattern.matcher(text); while (matcher.find()) { words.add(matcher.group()); } String result = org.apache.commons.lang3.StringUtils.join(words, " "); logger.debug("Resulting text: “{}”", result); if ("".equals(result)) { return null; } return new TextualImpl(result); }  void setPattern(String p); String getPattern(); @Override synchronized void updated(Dictionary<String, ?> properties); @Override Textual cleanUpText(String text); }
DictionaryServiceImpl implements DictionaryService, ManagedService { @Override public Textual cleanUpText(String text) { logger.debug("Text input: “{}”", text); LinkedList<String> words = new LinkedList<String>(); Matcher matcher = compilesPattern.matcher(text); while (matcher.find()) { words.add(matcher.group()); } String result = org.apache.commons.lang3.StringUtils.join(words, " "); logger.debug("Resulting text: “{}”", result); if ("".equals(result)) { return null; } return new TextualImpl(result); }  void setPattern(String p); String getPattern(); @Override synchronized void updated(Dictionary<String, ?> properties); @Override Textual cleanUpText(String text); static final String PATTERN_CONFIG_KEY; }