! Loading data from UnicodeData.txt
: load-data ( -- data )
- "vocab:unicode/data/UnicodeData.txt" data ;
+ "vocab:unicode/data/UnicodeData.txt" load-data-file ;
: (process-data) ( index data -- newdata )
[ [ nth ] keep first swap ] with { } map>assoc
! Extra properties {{[a,b],prop}}
: parse-properties ( -- assoc )
- "vocab:unicode/data/PropList.txt" data [
+ "vocab:unicode/data/PropList.txt" load-data-file [
[
".." split1 [ dup ] unless*
[ hex> ] bi@ 2array
! Special casing data
: load-special-casing ( -- special-casing )
- "vocab:unicode/data/SpecialCasing.txt" data
+ "vocab:unicode/data/SpecialCasing.txt" load-data-file
[ length 5 = ] filter
[ [ set-code-point ] each ] H{ } make ;