wanasit / chrono

A natural language date parser in Javascript
MIT License
4.61k stars 339 forks source link

IT fix+add tests #473

Closed ghost closed 12 months ago

ghost commented 2 years ago

adding tests adding some time adverbs *fixing some errors in other PR

ghost commented 2 years ago

I'm still getting some issues from tests, I guess I'll take some hints if possible 🙃

ghost commented 2 years ago

Well, I fixed some translations and tried to run the tests of which, unfortunately, some I could not get to work properly.

There are still some rather serious critical issues arose in dealing with the ambiguity of some sentences.

Eg.: There's an ambiguity in ITTimeExpressionParser.ts generated by "alle" in the followingPhase, its presence is however mandatory in both primaryPrefix and followingPhase ("dalle hh:mm alle hh:mm" means "from hh:mm to hh:mm" but using just "alle hh:mm" would mean "at hh:mm").

Moreover, as before, "all'" can be used both for literal time units and literal days of the month.

Unfortunately, ambiguities are a constant in more or less all languages and because of my knowledge of JS, I wouldn't know how to come up with it. 😕

Another problem that kept me busy was handling the digits at the beginning of the sentence as in it_time_units_ago.test.ts. I've really no clues on what's not working here.

Still needing an helping hand if possible. 🙂

Thanks, Federico

wanasit commented 2 years ago

Hello @federicodilo. Yes. The problem sounds difficult. I'm really sorry that I cannot really do much to help.

I think the problem is we try to support too many patterns/cases from the beginning. We should not try to make it as good as English for the first IT support. We should start recognizing a few Italian issues and add more patterns (+ tests). Then, we add more patterns and debug over time. That is how I was able to handle the complexity in other languages.

I know both you and @ntotao work very hard on translating everything, but I think it would be better for us if you could revert/re-create a smaller/minimal and easier-to-test MR.

Here are what I think we leave out for future changes:

FYI. If you are participating Hacktoberfest, breaking things into multiple MRs is also better for you. If you send smaller MRs, I'll try to review and merge them as quickly as possible.