tools.completion no longer depends on number tower

release
Slava Pestov 2007-10-27 14:43:30 -04:00
parent 5cf331a345
commit 5a797c83ee
1 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ vectors words assocs combinators sorting ;
: score ( full fuzzy -- n )
dup [
[ [ length ] 2apply - 15 swap [-] 3 / ] 2keep
[ [ length ] 2apply - 15 swap [-] 3 /f ] 2keep
runs [
[ 0 [ pick score-1 max ] reduce nip ] keep
length * +
@ -50,7 +50,7 @@ vectors words assocs combinators sorting ;
: rank-completions ( results -- newresults )
sort-keys <reversed>
[ 0 [ first max ] reduce 3 / ] keep
[ 0 [ first max ] reduce 3 /f ] keep
[ first < ] curry* subset
[ second ] map ;