This is the fuzzy-match Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:09:29 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
fuzzy-match
From a string input and a list of candidates, return the most relevant candidates first.
vindarel <vindarel@mailz.org>
Nyxt project, Ambrevar, Vindarel
(GIT git@github.com:vindarel/fuzzy-match.git)
MIT
# Fuzzy-match
Fuzzy match candidates from an input string.
On Quicklisp (2020-12) and [Ultralisp](https://ultralisp.org/).
~~~lisp
CL-USER> (fuzzy-match "hl" ’("foo" "bar" "hello" "hey!"))
("hello" "hey!" "foo" "bar")
~~~
~~~lisp
CL-USER> (fuzzy-match "zp" ’("foo" "zepellin" "bar: zep"))
("zepellin" "bar: zep" "foo")
~~~
The parameters are hand-picked for the results to feel natural. A
candidate that starts with the input substring should appear
first. For example, we use the Damerau-Levenshtein distance thanks to
the ‘MK-STRING-METRICS‘ library under the hood, but we don’t obey to
its result.
To give any objects as candidates, and not only strings, make them
implement ‘object-display‘, that returns a string representation.
# Nyxt origin
This code was extracted from the Nyxt browser. Original authors: Ambrevar, Vindarel.
# Licence
MIT
0.1
str
(system).
mk-string-metrics
(system).
fuzzy-match.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
fuzzy-match/fuzzy-match.lisp
fuzzy-match
(system).
fuzzy-match
(function).
file-suggestion-function
(function).
find-exactly-matching-substrings
(function).
keep-exact-matches-in-suggestions
(function).
object-display
(method).
score-suggestion
(function).
score-threshold
(special variable).
sort-suggestions
(function).
substring-norm
(function).
to-unicode
(function).
Packages are listed by definition order.
fuzzy-match
common-lisp
.
fuzzy-match
(function).
file-suggestion-function
(function).
find-exactly-matching-substrings
(function).
keep-exact-matches-in-suggestions
(function).
object-display
(generic function).
score-suggestion
(function).
score-threshold
(special variable).
sort-suggestions
(function).
substring-norm
(function).
to-unicode
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
From the user input and a list of suggestions, return a filtered list of
suggestions that have all the input words in them, and sort this list to have the
’most relevant’ first.
The match is case-sensitive if INPUT contains at least one uppercase character.
SUGGESTIONS-DISPLAY can be used to pass the pre-computed display strings of the
suggestions; otherwise ‘object-display’ is used.
The threshold under which suggestions are eleminated.
Fuzzy-match this list of files.
Return the list of input substrings that match at least one suggestion. The substrings must be SUBSTRING-LENGTH characters long or more.
Destructively filter out non-exact matches from suggestions.
If any input substring matches exactly (but not necessarily a whole word),
then all suggestions that are not exactly matched by at least one substring are removed.
Return a SUGGESTION’s score for INPUT.
A higher score means the suggestion comes first.
Sort SUGGESTION-PAIRS, the pair closest to INPUT in the levenshtein distance comes first.
SUGGESTION-PAIRS is a list of (display-value real-value). See ‘fuzzy-match’ for
more details.
Return the norm of SUBSTRINGS with regard to STRING.
The norm is closer to 1 if
- substrings start near the beginning of STRING;
- substrings length are closer to the length of STRING.
Only substrings of SUBSTRING-LENGTH characters or more are considered.
Convert INPUT to (simple-array character) type.
Jump to: | F G K M O S T |
---|
Jump to: | F G K M O S T |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
S | |||
score-threshold : | Private special variables | ||
Special Variable, score-threshold : | Private special variables | ||
|
Jump to: | F P S |
---|
Jump to: | F P S |
---|