tools.completion no longer depends on number tower
parent
5cf331a345
commit
5a797c83ee
|
@ -39,7 +39,7 @@ vectors words assocs combinators sorting ;
|
||||||
|
|
||||||
: score ( full fuzzy -- n )
|
: score ( full fuzzy -- n )
|
||||||
dup [
|
dup [
|
||||||
[ [ length ] 2apply - 15 swap [-] 3 / ] 2keep
|
[ [ length ] 2apply - 15 swap [-] 3 /f ] 2keep
|
||||||
runs [
|
runs [
|
||||||
[ 0 [ pick score-1 max ] reduce nip ] keep
|
[ 0 [ pick score-1 max ] reduce nip ] keep
|
||||||
length * +
|
length * +
|
||||||
|
@ -50,7 +50,7 @@ vectors words assocs combinators sorting ;
|
||||||
|
|
||||||
: rank-completions ( results -- newresults )
|
: rank-completions ( results -- newresults )
|
||||||
sort-keys <reversed>
|
sort-keys <reversed>
|
||||||
[ 0 [ first max ] reduce 3 / ] keep
|
[ 0 [ first max ] reduce 3 /f ] keep
|
||||||
[ first < ] curry* subset
|
[ first < ] curry* subset
|
||||||
[ second ] map ;
|
[ second ] map ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue