Handbook
Glossary
score ( full fuzzy -- n )
Fuzzy completion
Prev:
runs ( seq -- newseq )
Next:
complete ( full short -- score )
Vocabulary
tools
.
completion
Inputs
full
a
string
fuzzy
a sequence of sequences of integers
Outputs
n
an
integer
Word description
Ranks
fuzzy
by how closely it approximates the sequence
{ { 0 ... n-1 } }
where
n
is the length of
full
.
Definition
USING:
kernel
math
math.order
sequences
tools.completion.private
;
IN:
tools.completion
:
score
( full fuzzy -- n )
[
[
2length
-
15
swap
[-]
3
/f
]
2keep
runs
[
[
0
[
pick
score-1
max
]
reduce
nip
]
keep
length
*
+
]
with
each
]
[
drop
0
]
if*
;