     dupd fuzzy score max ;
 
 : completion ( short candidate -- result )
-    [ second swap complete ] keep 2array ;
+    [ second swap complete ] keep 2array ; inline
 
 : completion, ( short candidate -- )
-    completion dup first 0 > [ , ] [ drop ] if ;
+    completion dup first-unsafe 0 > [ , ] [ drop ] if ;
 
 : completions ( short candidates -- seq )
     [ ] [

    {
        { [ over zero? ] [ 2drop 10 ] }
        { [ 2dup length 1 - number= ] [ 2drop 4 ] }
        { [ 2dup [ 1 - ] dip nth Letter? not ] [ 2drop 10 ] }
        { [ 2dup [ 1 + ] dip nth Letter? not ] [ 2drop 4 ] }
        [ 2drop 1 ]
    } cond ;

PRIVATE>


! Copyright (C) 2005, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs colors.constants combinators
combinators.short-circuit fry io.directories io.files
io.files.info io.pathnames kernel locals make math math.order
sequences sequences.private sorting splitting typed
unicode.categories unicode.data vectors vocabs vocabs.hierarchy
;

IN: tools.completion

