! I get an out of memory error with the document below when I call it
with "she hit her hard" spell

USING: assocs hashtables kernel locals sequences splitting ;
IN: factor-4gl.spell


: dictionary-words ( -- seq ) "he hit her hard" " " split ;

:: (mk-lookup) ( hashtable seq --  ) seq [ 1 swap hashtable set-at  ] each ;

: mk-lookup ( -- hashtable ) 1 <hashtable> dup dictionary-words (mk-lookup) ;

:: in-assoc? ( key assoc -- ? ) key assoc at* swap drop ;

: (spell) ( document -- not-found ) [ mk-lookup in-assoc? not ] filter ;

: spell ( string -- seq ) " " split spell ;

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to