You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to pass reference date to the builtin entity parser, just like in duckling or rustling. At the moment next friday matches the closest friday after parsing time. I would like to be able to get the closest friday to any arbitrary date when parsing next friday.
This is supported in rustling via the ResolverContext and could be also supported in the snips-ontology.
Then parse the string with chrono and set it up with:
let context = ResolverContext::new(Interval::starting_at(Moment(Local.ymd(year, month, day).and_hms(hour, minute, second)),Grain::Second));
Is this somewhere on your todo list? Are you working on this? Would you consider implementing this or helping me get to a point where I can submit an acceptable PR?
The text was updated successfully, but these errors were encountered:
Hey @niedakh,
I apologize for the late answer, I've been very busy during the past few days and your issue got somehow lost in my todo 😞
What you suggest is definitely worth having, and the steps you described are exactly what needs to be done. This is not in our todo at the moment so that would be awesome if you could find some time to contribute on this ! If you decide to move forward on this, I'll follow up closely and help you get your PR ready for merge.
I would like to be able to pass reference date to the builtin entity parser, just like in duckling or rustling. At the moment
next friday
matches the closest friday after parsing time. I would like to be able to get the closest friday to any arbitrary date when parsingnext friday
.This is supported in rustling via the ResolverContext and could be also supported in the snips-ontology.
Two things are needed for this to work:
Replace:
snips-nlu-ontology/snips-nlu-ontology-parsers/src/builtin_entity_parser.rs
Line 110 in 50120f9
with a
self.context
property constructed based on provided datetime passed down to the rustling parser:snips-nlu-ontology/snips-nlu-ontology-parsers/src/builtin_entity_parser.rs
Line 121 in 50120f9
Add an ISO reference datetime in constructor:
snips-nlu-ontology/platforms/snips-nlu-ontology-python/snips_nlu_ontology/builtin_entities.py
Line 115 in a5f0730
convert it to ISO date string property or anything else that can be parsed by chrono in rust and push it down the binding slide via:
snips-nlu-ontology/snips-nlu-ontology-parsers-ffi-macros/src/builtin_entity_parser.rs
Lines 25 to 34 in 50120f9
to:
snips-nlu-ontology/snips-nlu-ontology-parsers/src/builtin_entity_parser.rs
Line 27 in 50120f9
Then parse the string with chrono and set it up with:
Is this somewhere on your todo list? Are you working on this? Would you consider implementing this or helping me get to a point where I can submit an acceptable PR?
The text was updated successfully, but these errors were encountered: