|
|
|
|
|
by specialist
2251 days ago
|
|
Nice. Facepalm slap. Just like other matching algorithms. How did I not notice that earlier? Order independent specificity is like longest match rules. Regex, lexing, URL routers, etc. Order dependent matching overrides (correct phrase?) is like Packrat & PEG. Which is better depends on ambiguity, meaning how well your "matcher" algorithm can process whatever input you have. I've done my fair share of scraping. (I usually default to my own globbing implementation. Generally more simple than xpath or css expressions.) Now I'm feeling pretty stupid that I'd always hard-coded precedence resolution. |
|