Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NLP fix #2: arithmetics support, complete CFG features (suppressed now) #78

Merged
merged 45 commits into from Mar 13, 2016

Conversation

kengz
Copy link
Contributor

@kengz kengz commented Mar 6, 2016

This fixes issues #70 , #62 , #21

I've removed all lodash dependencies, and wrote my own under subdash.

Also I've finished the CFG implementation, which I call the Human Language for Time. I plan to attach the mathematical proof on the arithmetics and theories behind it soon.

This PR doesn't fix as many problems since there's still several small but pesky issues to resolve, which basically are the inconsistencies between my CFG and the original datejs.

For example, 'tomorrow' will be treated as the next day, defaulted to 9am. Also, I have to implement leap year, and proper carries for days across different months, as they have different number of days.

That's it for now!

@kengz kengz mentioned this pull request Mar 6, 2016
@kengz
Copy link
Contributor Author

kengz commented Mar 6, 2016

@matthewmueller Owh forgot to mentioned one thing, it can also take any extra string in a natural sentence, and extract the time. For example if the input string is remind me to do laundry 2 hours later, it will automatically extract the substring with time.

For this, the CFG is suppressed as I mentioned, so what it does it do some preprocessing on the string (extract 2 hours later), and pass it to the original datejs parser.

Moreover, it can parse normal forms of date string, and e.g. '13 May 2011 01:30 UTC'.

The time extraction from arbitrary sentence is a pretty handle feature I think.

@matthewmueller
Copy link
Owner

ahh sorry to leave you hanging on this @kengz! this looks great. thanks for your hard work. i'm going to merge this. let me know if you want me to release or if there's more to come before i should release.

regarding:

basically are the inconsistencies between my CFG and the original datejs.

i'm not sure if this is helpful or not, but i think it's usually pretty obvious what the date should be when you think about it, like "tomorrow morning" => some where around 9 or 10 the next day. so i wouldn't worry so much about breaking tests or existing implementation if you think the result will be more expected for folks.

matthewmueller added a commit that referenced this pull request Mar 13, 2016
NLP fix #2: arithmetics support, complete CFG features (suppressed now)
@matthewmueller matthewmueller merged commit a495343 into matthewmueller:master Mar 13, 2016
@kengz
Copy link
Contributor Author

kengz commented Mar 13, 2016

I'll work on it a lil today, but my guess is the next update won't come through until at least next week. I'll let u know tonight if I can finish it? Otherwise assume I can't.

@matthewmueller
Copy link
Owner

sure, no rush. loving these fixes :-)

@matthewmueller
Copy link
Owner

hey @kengz, what's the state of this?

@kengz
Copy link
Contributor Author

kengz commented Oct 14, 2016

oh shoot, my github graph wasn't green for a long time, until recently. Nice timing.

Let's see what's left from last time:

  • lodash dependencies were already completely removed, you can close started removing lodash to bring down the build size #76 ?
  • activate full CFG
  • update the tests and it's ok use new default times if it's reasonable (e.g. 7pm for evening)
  • the issues stated in History.md
  • attach doc and description for algo so people can understand it

@kengz kengz mentioned this pull request Oct 14, 2016
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants