-
Notifications
You must be signed in to change notification settings - Fork 71
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 for dates #12
Comments
See: sharkdp/numbat#327 |
Oh wow! The timing ahah. Can't wait to see that in loungy :) |
Yeah I hope Numbat will be enough to support this. To be honest the calculator in raycast is super dope and just feels very natural. Numbat is definitely much more strict with their inputs. |
Yeah. Better than nothing I suppose! |
There is also this https://erhanbaris.github.io/smartcalc-app/ which might be worth looking into. Although I am not sure if it is abandoned. It seems to be better for this usecase than numbat though and pretty close to raycast. |
|
Ooh this does look good! |
Having a strict syntax for Numbat is a design choice. We want users to be able to trust the result of their computations. If you have loose/ambiguous parsing rules, it's sometimes hard to tell if the calculator understands your input in the same way that you do.
As you found out, date-time support has just landed. It's not even released yet (as we might change e.g. function names), but you can play with it on https://numbat.dev/ and/or read the documentation here: https://numbat.dev/doc/date-and-time.html Please give us feedback and tell us if you think there is something we can improve (ideally, create a new ticket in our repository). There is already a collection of date-time-related enhancements in this ticket: sharkdp/numbat#323.
Interesting reference, I hadn't seen that before. What are some things that smartcalc-app can do that Numbat can't? Please note that https://github.com/erhanbaris/smartcalc is GPL-2.0 licensed, so integration into your MIT licensed tool is not possible without relicensing. |
@sharkdp thanks for the input! You are definitely right about the license.
i think it’s only the less strict matching that feels better for this usecase. I 100% agree that numbat is the better library overall. |
I totally understand, I wasn't trying to make a criticism of the library at all. Compared to Raycast though a more general syntax might be more favorable, though not necessarily!
I'll try it out and let you know how it is :) |
Sorry if I came off as bitter — I'm not! I am actually really excited that you, @MatthiasGrandl, decided to embed Numbat into your tool. I hope that it will be a fruitful collaboration and I'm looking forward to any kind of feedback we can get. |
Numbat v1.10 has been released now with initial support for dates & times. We made a couple of changes to the syntax since my last post. See https://numbat.dev/doc/date-and-time.html and https://numbat.dev/doc/conversion-functions.html for an overview of the new features. |
@sharkdp super cool, will update soon. I played around a bit on the numbat website and it seems very nice. |
@sharkdp do I need to load some extra module? I just updated, but it doesn't seem to recognize |
Do you happen to have an old version of the prelude/standard library installed on your system? (e.g. in |
I did still have 1.9.0 of the numbat CLI installed. Just removed it and confirmed no |
Hm. How did you install and how do you run Numbat? Does |
If you built it from source, make sure that the prelude is up to date at build time. |
I am just using the crate... https://github.com/MatthiasGrandl/loungy/blob/main/src/commands/root/numbat.rs |
it says datetime is private |
I meant.. as a Numbat command:
What is the error message? Do other new features like |
|
It looks like you're not sending the last character of input to Numbat? |
OMG no everything is working as expected on numbat. I am just an idiot and not handling those kinds of results at all... 🤦 sorry for not debugging properly and wasting your time! |
made it a bit prettier and pushed |
I don't think it makes sense for Numbat to make these changes but it might make sense for Loungy to do some processing on this queries before sending them to Numbat. For example, given |
yeah I think that could be easily achieved by matching the phrase |
So cool! I think that solves my original issue, feel free to close this :) |
yeah I am sure more such patterns will come up in the future, but for now that should be good enough :) |
Numbat supports mathematical calculations just fine but it doesn't have date calculations like Raycast. I looked around for some date NLP libraries in Rust but couldn't find many still maintained, maybe you or other people know of some though.
The text was updated successfully, but these errors were encountered: