4 ms·
10 years ago I created an algorithm to generalize CSS selectors based on applying the "sequence alignment" algorithm (from bioinformatics / string matching) to
by keepamovin 3y ago
10 years ago I created an algorithm to generalize CSS selectors based on applying the "sequence alignment" algorithm (from bioinformatics / string matching) to objects (bags of attribute / key values, ie, HTML elements). This let you select two or more examples and produce a selector that captures what you meant.
More here: https://github.com/00000o1/selector-generalization https://github.com/00000o1/selector-generalization
There've been multiple attempts at such a thing over the years, but I like this approach for its essentially simple foundation in solid algorithms.
Be warned tho this code is old! I haven't yet got around to updating it to make it more "modern" etc!!
- lazylion2 3y agoUpdated link for the live example: https://dosyago.github.io/selector-generalization/ https://dosyago.github.io/selector-generalization/
- keepamovin 3y agoTHank you lazylion2! That's very kind of you!