Fuzzy Parsing Example
See original GitHub issueSee:
This could probably be done using Token Categories to match against “all” kinds of tokens combined with an alternation which includes the one option we care about.
e.g:
$.RULE("fuzzyConstantFinder", () => {
$.OR([
// We may need a GATE here, e.g using backtracking to ensure we never incorrectly enter
// the constant alternative.
{ALT: () => $.SUBRULE($.constant)}, //
{ALT: () => $.CONSUME(AnyToken)}, // AnyToken should be defined using Token Categories.
]);
});
$.RULE("constant", () => {
$.CONSUME(Public);
$.CONSUME(Static);
$.CONSUME(Final);
$.CONSUME(Int);
$.CONSUME(Ident);
});
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
A Systematic Approach to Fuzzy Parsing - CiteSeerX
This paper presents a systematic approach to implementing fuzzy parsers. A fuzzy parser is a form of syntax analyzer that performs analysis on...
Read more >fuzzy-parse: Tools for processing unstructured text data
The lightweight and easy to use functions for text tokenizing and parsing. It aimed for parsing mostly unstructured data, but the structured ...
Read more >A Systematic Approach to Fuzzy Parsing - Wiley Online Library
SUMMARY. This paper presents a systematic approach to implementing fuzzy parsers. A fuzzy parser is a form of syntax analyzer that performs analysis...
Read more >Unfuzzying Fuzzy Parsing - DROPS
Keywords and phrases robust parsing, fuzzy parsing, automata ... example of natural parsing is our ability to listen to human's speech and collect...
Read more >Python Language Tutorial => Fuzzy datetime parsing ...
Example #. It is possible to extract a date out of a text using the dateutil parser in a "fuzzy" mode, where components...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve started playing around with a similar scenario which required consuming any kind of tokens between a “–” and a semiColon.
Basically the CSS 3 custom property syntax:
You can inspect the current state of the example here:
Consider expanding the fuzzy parsing example to a scenario in which the fuzzy matching acts as a default fall back.
e.g: 3 Alternatives, and the 3rd one being the fuzzy one which could conflict with the first 2.