Miscellany
public text v1 · immutableUSING: io io.files splitting sequences kernel assocs vectors ;
IN: inverted-index
: file-words ( file -- seq )
<file-reader> contents " \n\r\t" split [ empty? not ] subset ;
: index-words ( seq file index -- )
[ >r swap r> [ ?push ] change-at ] 2curry each ;
: index-file ( file index -- )
>r dup file-words swap r> index-words ;