I'm currently in the process of writing a human date parser. By human date, I mean it should be able to interpret strings as tomorrow at 2 and return a valid date depending on the current time.The issue I'm facing is the automatic detection of missing AM/PM token. For example, if I receive an email that says Lets meet tomorrow at 2, I know that 2 is likely to be, in fact, 2 PM. On the other hand, if the email said Lets meet tomorrow at 11, 11 is more likely to be 11AM.I guess most of the time, a simple comparison should do the trick. If the number is bigger than a certain limit n, we can suppose that the time is AM. If the number is smaller, then it is probably PM. In the sample above, 2 was more likely to be PM, and 11 was AM.I know that a common work day is about 9AM-6PM, so numbers lower than 6 or bigger or greater than 9 are fine. We can easily guess for those. But what do I do with 7 and 8?So the exact question I have is, where do I put this exact limit? When numbers approach 7~8, the limit becomes more ambiguous. I tried to search for previous documentation on this problem but couldn't find any. Is there any kind of convention about this? Also, in my opinion, the locale and/or timezone could influence this limit.By the way, I'm not interested by non-definitive answers such as In my opinion, 7 is afternoon or For me, 8 is morning. I'm really interested in documentation that could help me draw a definitive line.Hope the description of the problem is understandable enough.
Guess if a time is AM or PM
language agnostic;natural language processing