Question: auThursday eptember 28 12:00 PM parsed as Sat Oct 07 2023 12:00:00
I've started using chrono node to help with post processing ocr. When running the following code on October 7:
parsedDateTime = chrono.parseDate(
`auThursday eptember 28 12:00 PM`
);
console.log(`Parsed Date: ${parsedDateTime}`);
Outputs: Parsed Date: Sat Oct 07 2023 12:00:00 GMT-0500 (Central Daylight Time)
It appears reasonable for chrono node to parse auThursday eptember 28 12:00 PM as indeed September 28 12:00.
October 7is a saturday, not a thursdayeptember 28is a closer match toSeptember 28thanOctober 7
Are my expectations reasonable for chrono-node? Are there further configurations that would help improve the parsing results?
Asking these questions to gauge if i need to use spellcheckers ahead of chrono-node or if it reasonable for chrono-node to handle fuzzy matching similar to this example
Thanks!
Another result for reference and if this is inline with expectations (executed on October 7):
parsedDateTime = chrono.parseDate(
'Thursday eptember 28 12:00 PM'
);
console.log(`Parsed Date: ${parsedDateTime}`);
Parsed Date: Thu Oct 05 2023 12:00:00 GMT-0500 (Central Daylight Time)
Hello. Thanks for letting me know about your use case.
It is an interesting problem, but I am afraid it would be difficult to make Chrono handle spellchecking.
--
One idea you could try is populating Chrono dictionary (e.g. locales/en/constants.ts) with the common misspelled words (e.g. "September" => "eptember", "Sptember", "Setember", "Sepember", ...).
Because Chrono doesn't make those expose its dictionary to API, you probably need to fork and modify the library.
--
Sorry that I cannot really help you much on this. Please let me know how it goes.