AdguardTeam / AdguardTeam/AGLint

Implement fuzzy string searching

未關閉
#204 0 則留言 0 個 reaction 已指派 1 人 已被 @maximtop 認領 在 GitHub 檢視
enhancement Priority: P4
主要語言
TypeScript
星號
70
分支
4
PR 合併指標
30 天內沒有已合併 PR

描述

There are cases where something is just misspelled, like the modifier name: `scipt` instead of `script`. In this case, the provided modifier name is very similar to the name of the original modifier. If we find an invalid modifier name, it might be worth doing a [fuzzy string searching](https://en.wikipedia.org/wiki/Approximate_string_matching) to find the correct modifier name from the set of known modifier names (spell checkers also use similar algorithms). Later, we may recommend this as an _optional fix_ via the suggestion API.

Possible use cases:
- modifier names
- CSS pseudo class names
- scriptlet names
- redirect names
- pre-processor directive names
- hints, platforms
- expression variable names in `!#if` comments
- domain TLDs
- etc.

References, links to check:
- https://en.wikipedia.org/wiki/Approximate_string_matching
- https://en.wikipedia.org/wiki/Levenshtein_distance
- https://github.com/EthanRutherford/fast-fuzzy

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。