ekmett / parsers

Generic parser combinators
Other
88 stars 38 forks source link

Approximate matching combinators (missing?) #58

Open alexanderkjeldaas opened 8 years ago

alexanderkjeldaas commented 8 years ago

I was looking for combinators for the case where I want to do an approximate matching.

So for example I'm matching ************\d\d\d\d, but I'll accept (for OCR) a few non-* characters in the first part of the string.

An useful combinator would be to be able to have alternatives with associated weights, and have some sort of levenshtein distance as combinator.

ekmett commented 7 years ago

These sound pretty messy, non-canonical, and terribly implementation specific. My concern is that we'd supply them and they'd fit almost nobody's exact use-case without requiring the end user to basically reimplement them.