-
Notifications
You must be signed in to change notification settings - Fork 0
Date handling
[Tasks](Date Handling#tasks)
[Libraries for date parsing in English](Date Handling#review-of-libraries-for-date-parsing-in-english)
There are two tasks: Date recognition and Date parsing. For now we support date recognition for Italian and English.
This task is performed by the static method Result DateIdentifier.isADate(String toCheck) . The static method tries to parse the string toCheck in three ways:
- Using the internal parser for the Italian language (eu.trentorise.nlprise.identifiers.parser. ItalianDateParser). This parser was constructed specifically for the Italian language using the Parboiled tool for formal grammar building
- Using JCronic, a library for date parsing in English
- Using PoJava Datetime, another library for English date parsing
An object “Response” is returned by the isADate method, which contains:
- Boolean getResult() : which returns true iff at least one parser consider the given string as a date;
- HashMap<DateParser,Boolean> getSingleParserReturn() : gives access to specific results of each parser used in order to perform the analysis
The Enumerate DateParser contains the three parser used:
- INTERNAL : parser developed into NLPrise to parse Italian date
- JCRONIC : The JCronic Parser
- POJAVA : The PoJava datetime parser.
The internal parser works with date in many different format. Some example of supported date formats could be found into the test cases. In addition this parser works with date AND time definition, for example: lunedì 15 maggio 14:33 or 15/05/2013 14:33 or 15-mag-13 14:33 etc.
JChronic 0.2.7-SNAPSHOT | NATTY 0.8-SNAPSHOT | PoJAVA DateTime 1.0.2 | |
---|---|---|---|
Parse incomplete date | yes | yes | no |
Parse incomplete time | no | yes | no |
False-positives rate | low | high | low |
False Negative rate | high | low | high |
Doesn’t invent non-existent values | no | yes | yes |
Mistake rate while splitting between date and time | high | low | low |