@Test public void testParsePrettyTimeTime() { List<Date> parse = new PrettyTimeParser().parse("I did it three days ago"); Assert.assertFalse(parse.isEmpty()); String formatted = new PrettyTime(Locale.ENGLISH).format(parse.get(0)); Assert.assertEquals("3 days ago", formatted); }
public List<Date> parse(String language) { language = words2numbers(language); List<Date> result = new ArrayList<Date>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); for (com.joestelmach.natty.DateGroup group : groups) { result.addAll(group.getDates()); } return result; }
PrettyTimeParser { public List<Date> parse(String language) { language = words2numbers(language); List<Date> result = new ArrayList<Date>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); for (com.joestelmach.natty.DateGroup group : groups) { result.addAll(group.getDates()); } return result; } }
PrettyTimeParser { public List<Date> parse(String language) { language = words2numbers(language); List<Date> result = new ArrayList<Date>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); for (com.joestelmach.natty.DateGroup group : groups) { result.addAll(group.getDates()); } return result; } PrettyTimeParser(TimeZone timezone);  PrettyTimeParser(); }
PrettyTimeParser { public List<Date> parse(String language) { language = words2numbers(language); List<Date> result = new ArrayList<Date>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); for (com.joestelmach.natty.DateGroup group : groups) { result.addAll(group.getDates()); } return result; } PrettyTimeParser(TimeZone timezone);  PrettyTimeParser(); List<Date> parse(String language); List<DateGroup> parseSyntax(String language); }
PrettyTimeParser { public List<Date> parse(String language) { language = words2numbers(language); List<Date> result = new ArrayList<Date>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); for (com.joestelmach.natty.DateGroup group : groups) { result.addAll(group.getDates()); } return result; } PrettyTimeParser(TimeZone timezone);  PrettyTimeParser(); List<Date> parse(String language); List<DateGroup> parseSyntax(String language);  }