@Test public void testParseTimes() { List<Date> parse = new PrettyTimeParser().parse("let's get lunch at two pm"); Assert.assertFalse(parse.isEmpty()); Calendar calendar = Calendar.getInstance(); calendar.setTime(parse.get(0)); Assert.assertEquals(14, calendar.get(Calendar.HOUR_OF_DAY)); }
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);  }