simple-flat-file: rename ``data`` to ``load-data-file``.

char-rename
John Benediktsson 2017-02-02 16:21:06 -08:00
parent 88f661936e
commit b93bc1ac5e
4 changed files with 8 additions and 7 deletions

View File

@ -29,7 +29,7 @@ IN: simple-flat-file
: split-; ( line -- array )
";" split [ [ blank? ] trim ] map! ;
: data ( filename -- data )
: load-data-file ( filename -- data )
utf8 file-lines drop-comments [ split-; ] map! ;
: expand-range ( range -- range' )
@ -45,4 +45,4 @@ IN: simple-flat-file
dup values members [ intern ] curry assoc-map ;
: load-interval-file ( filename -- table )
data intern-values expand-ranges ;
load-data-file intern-values expand-ranges ;

View File

@ -23,7 +23,8 @@ TUPLE: weight primary secondary tertiary ignorable? ;
" " split [ hex> ] "" map-as ;
: parse-ducet ( file -- ducet )
data [ [ parse-keys ] [ parse-weight ] bi* ] H{ } assoc-map-as ;
load-data-file
[ [ parse-keys ] [ parse-weight ] bi* ] H{ } assoc-map-as ;
"vocab:unicode/collation/allkeys.txt" parse-ducet ducet set-global

View File

@ -77,7 +77,7 @@ PRIVATE>
! 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
@ -170,7 +170,7 @@ C: <code-point> code-point
! 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
@ -187,7 +187,7 @@ C: <code-point> code-point
! 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 ;

View File

@ -28,7 +28,7 @@ IN: unicode.normalize.tests
] assoc-all? ;
{ 17768 { } } [
"vocab:unicode/normalize/NormalizationTest.txt" data
"vocab:unicode/normalize/NormalizationTest.txt" load-data-file
[ 5 head [ " " split [ hex> ] "" map-as ] map ] map
[ length ] keep [
{