simple-flat-file: add back string interning.
parent
1613bdfed2
commit
1829c73bb1
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2009 Daniel Ehrenberg
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: arrays ascii assocs biassocs interval-maps
|
||||
io.encodings.utf8 io.files kernel math.parser sequences
|
||||
io.encodings.utf8 io.files kernel math.parser sequences sets
|
||||
splitting ;
|
||||
IN: simple-flat-file
|
||||
|
||||
|
@ -38,5 +38,11 @@ IN: simple-flat-file
|
|||
: expand-ranges ( ranges -- table )
|
||||
[ [ expand-range ] dip ] assoc-map <interval-map> ;
|
||||
|
||||
: intern ( value values -- value' )
|
||||
[ = ] with find nip ;
|
||||
|
||||
: intern-values ( assoc -- assoc' )
|
||||
dup values members [ intern ] curry assoc-map ;
|
||||
|
||||
: load-interval-file ( filename -- table )
|
||||
data expand-ranges ;
|
||||
data intern-values expand-ranges ;
|
||||
|
|
Loading…
Reference in New Issue