Microsoft.Recognizers.Text: numbers, units, and date/time in multiple languages
github.com
github.com
In my second job we maintained our own, also Regex based, logic for this and it was a nightmare so having a library to do it is quite the timesaver!
I think these examples explain the functionality very well.
For example you send the user localized text, "Did you receive your package?" then parse the yes/no and continue your decision tree with something like https://www.nuget.org/packages/Microsoft.Recognizers.Text.Ch...
An interesting comparison is that Microsoft.Recognizers.Text is a cross-platform cousin to JS library compromise/one: https://compromise.cool/
> The Patterns folder contains all the regular expressions that fulfill the recognizers logic. It's divided by supported language.
We're looking at multiple ways to improve the project.
One piece of feedback is: the documentation https://github.com/Microsoft/Recognizers-Text/tree/master/Ja... doesn't seem to cover the the various terms used in the results. Eg from my code:
const recognizedDateTimes = recognizeDateTime(filterValue, "English");
// TODO: clarify what is distinct between each 'recognizedDateTime'
// Seems like these are the 'recognisable items' that were found but I can't find docs.
const firstDateFound = recognizedDateTimes[0];
// TODO: clarify what is a 'resolution'
// Seems like this is each possible value for each recognisable item but I can't find docs.
// eg if the user enters 'october'
// values[0] is in the past
// values[1] is in the future
// we always want the past, hence picking 0.
const firstResolution = firstDateFound?.resolution?.values[0] || null;
A simple explainer in the README would be great.Excel does have its quirks (CSV handling is one of my pet peeves) but it does also have a surprising amount of sophisticated adjustable logic that is often hidden in plain sight.