Used this for a quick proof of concept I was putting together where I needed to parse the output of an OCRed date and number (price) string (with known country). Seems to work very nicely on the sample size of 3 I tried with - so I can't speak to how well it works on a more diverse sample set - but it's great to have something like this available for free.
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!
From what I understood, is a library that you can sends strings with "twenty thousand ninety eight" on it, and it tells you there is the number 20098 there.
I'm one of the maintainers of this project. Comments, suggestions, or contributions are very welcome! Specially regarding expansion to support new languages/cultures.
We're looking at multiple ways to improve the project.
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;
You already can do that. Albeit it doesn’t detect it as a zip code specifically, but you can format the cells so that values that look like numbers aren’t automatically converted into numbers.
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.
Definitely. I wish there was a global/permanent setting to not strip leading zeros. I imagine the design decision might have been made decades ago for Lotus 1-2-3 compatibility or something, but it's almost certainly cost much more time and mistakes than it has saved.
https://github.com/microsoft/Recognizers-Text