@Test @Ignore public void testParseAmbiguousTimes() { List<DateGroup> parse = new PrettyTimeParser().parseSyntax("let's get lunch at two"); Assert.assertFalse(parse.isEmpty()); Calendar calendar = Calendar.getInstance(); calendar.setTime(parse.get(0).getDates().get(0)); int hourOfDay = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); if (hourOfDay >= 2 && hourOfDay < 14) Assert.assertEquals(14, calendar.get(Calendar.HOUR_OF_DAY)); else Assert.assertEquals(2, calendar.get(Calendar.HOUR_OF_DAY)); }
public List<DateGroup> parseSyntax(String language) { language = words2numbers(language); List<DateGroup> result = new ArrayList<DateGroup>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); Date now = new Date(); for (com.joestelmach.natty.DateGroup group : groups) { result.add(new DateGroupImpl(now, group)); } return result; }
PrettyTimeParser { public List<DateGroup> parseSyntax(String language) { language = words2numbers(language); List<DateGroup> result = new ArrayList<DateGroup>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); Date now = new Date(); for (com.joestelmach.natty.DateGroup group : groups) { result.add(new DateGroupImpl(now, group)); } return result; } }
PrettyTimeParser { public List<DateGroup> parseSyntax(String language) { language = words2numbers(language); List<DateGroup> result = new ArrayList<DateGroup>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); Date now = new Date(); for (com.joestelmach.natty.DateGroup group : groups) { result.add(new DateGroupImpl(now, group)); } return result; } PrettyTimeParser(TimeZone timezone);  PrettyTimeParser(); }
PrettyTimeParser { public List<DateGroup> parseSyntax(String language) { language = words2numbers(language); List<DateGroup> result = new ArrayList<DateGroup>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); Date now = new Date(); for (com.joestelmach.natty.DateGroup group : groups) { result.add(new DateGroupImpl(now, group)); } return result; } PrettyTimeParser(TimeZone timezone);  PrettyTimeParser(); List<Date> parse(String language); List<DateGroup> parseSyntax(String language); }
PrettyTimeParser { public List<DateGroup> parseSyntax(String language) { language = words2numbers(language); List<DateGroup> result = new ArrayList<DateGroup>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); Date now = new Date(); for (com.joestelmach.natty.DateGroup group : groups) { result.add(new DateGroupImpl(now, group)); } return result; } PrettyTimeParser(TimeZone timezone);  PrettyTimeParser(); List<Date> parse(String language); List<DateGroup> parseSyntax(String language);  }