simple-flat-file: rename ``data`` to ``load-data-file``.
parent
88f661936e
commit
b93bc1ac5e
|
@ -29,7 +29,7 @@ IN: simple-flat-file
|
||||||
: split-; ( line -- array )
|
: split-; ( line -- array )
|
||||||
";" split [ [ blank? ] trim ] map! ;
|
";" split [ [ blank? ] trim ] map! ;
|
||||||
|
|
||||||
: data ( filename -- data )
|
: load-data-file ( filename -- data )
|
||||||
utf8 file-lines drop-comments [ split-; ] map! ;
|
utf8 file-lines drop-comments [ split-; ] map! ;
|
||||||
|
|
||||||
: expand-range ( range -- range' )
|
: expand-range ( range -- range' )
|
||||||
|
@ -45,4 +45,4 @@ IN: simple-flat-file
|
||||||
dup values members [ intern ] curry assoc-map ;
|
dup values members [ intern ] curry assoc-map ;
|
||||||
|
|
||||||
: load-interval-file ( filename -- table )
|
: load-interval-file ( filename -- table )
|
||||||
data intern-values expand-ranges ;
|
load-data-file intern-values expand-ranges ;
|
||||||
|
|
|
@ -23,7 +23,8 @@ TUPLE: weight primary secondary tertiary ignorable? ;
|
||||||
" " split [ hex> ] "" map-as ;
|
" " split [ hex> ] "" map-as ;
|
||||||
|
|
||||||
: parse-ducet ( file -- ducet )
|
: 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
|
"vocab:unicode/collation/allkeys.txt" parse-ducet ducet set-global
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ PRIVATE>
|
||||||
! Loading data from UnicodeData.txt
|
! Loading data from UnicodeData.txt
|
||||||
|
|
||||||
: load-data ( -- data )
|
: load-data ( -- data )
|
||||||
"vocab:unicode/data/UnicodeData.txt" data ;
|
"vocab:unicode/data/UnicodeData.txt" load-data-file ;
|
||||||
|
|
||||||
: (process-data) ( index data -- newdata )
|
: (process-data) ( index data -- newdata )
|
||||||
[ [ nth ] keep first swap ] with { } map>assoc
|
[ [ nth ] keep first swap ] with { } map>assoc
|
||||||
|
@ -170,7 +170,7 @@ C: <code-point> code-point
|
||||||
|
|
||||||
! Extra properties {{[a,b],prop}}
|
! Extra properties {{[a,b],prop}}
|
||||||
: parse-properties ( -- assoc )
|
: parse-properties ( -- assoc )
|
||||||
"vocab:unicode/data/PropList.txt" data [
|
"vocab:unicode/data/PropList.txt" load-data-file [
|
||||||
[
|
[
|
||||||
".." split1 [ dup ] unless*
|
".." split1 [ dup ] unless*
|
||||||
[ hex> ] bi@ 2array
|
[ hex> ] bi@ 2array
|
||||||
|
@ -187,7 +187,7 @@ C: <code-point> code-point
|
||||||
|
|
||||||
! Special casing data
|
! Special casing data
|
||||||
: load-special-casing ( -- special-casing )
|
: load-special-casing ( -- special-casing )
|
||||||
"vocab:unicode/data/SpecialCasing.txt" data
|
"vocab:unicode/data/SpecialCasing.txt" load-data-file
|
||||||
[ length 5 = ] filter
|
[ length 5 = ] filter
|
||||||
[ [ set-code-point ] each ] H{ } make ;
|
[ [ set-code-point ] each ] H{ } make ;
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ IN: unicode.normalize.tests
|
||||||
] assoc-all? ;
|
] assoc-all? ;
|
||||||
|
|
||||||
{ 17768 { } } [
|
{ 17768 { } } [
|
||||||
"vocab:unicode/normalize/NormalizationTest.txt" data
|
"vocab:unicode/normalize/NormalizationTest.txt" load-data-file
|
||||||
[ 5 head [ " " split [ hex> ] "" map-as ] map ] map
|
[ 5 head [ " " split [ hex> ] "" map-as ] map ] map
|
||||||
[ length ] keep [
|
[ length ] keep [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue