]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/unicode/data/data.factor
use reject instead of [ ... not ] filter.
[factor.git] / basis / unicode / data / data.factor
index fe60acc840d7585689d88c414600b0845dc533bd..1f7336495cae1574b58ee6cfbb5a1264d9523fe4 100644 (file)
@@ -1,10 +1,11 @@
 ! Copyright (C) 2008, 2009 Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays ascii assocs byte-arrays combinators
-combinators.short-circuit grouping hashtables interval-maps
+combinators.short-circuit grouping hashtables interval-sets
 io.encodings.utf8 io.files kernel locals make math math.bitwise
 math.order math.parser math.ranges memoize namespaces sequences
 sets simple-flat-file sorting splitting strings.parser ;
+QUALIFIED: interval-sets
 IN: unicode.data
 
 <PRIVATE
@@ -35,7 +36,7 @@ CONSTANT: name-map H{ }
 : name>char ( name -- char ) name-map at ; inline
 : char>name ( char -- name ) name-map value-at ; inline
 : property ( property -- interval-map ) properties at ; foldable
-: property? ( char property -- ? ) property interval-key? ; inline
+: property? ( char property -- ? ) property interval-sets:in? ; inline
 : ch>lower ( ch -- lower ) simple-lower ?at drop ; inline
 : ch>upper ( ch -- upper ) simple-upper ?at drop ; inline
 : ch>title ( ch -- title ) simple-title ?at drop ; inline
@@ -113,7 +114,7 @@ PRIVATE>
 : exclusions ( -- set )
     exclusions-file utf8 file-lines
     [ "#" split1 drop [ blank? ] trim-tail hex> ] map
-    [ 0 = not ] filter ;
+    [ 0 = ] reject ;
 
 : remove-exclusions ( alist -- alist )
     exclusions unique assoc-diff ;
@@ -128,7 +129,7 @@ PRIVATE>
 : process-compatibility ( data -- hash )
     (process-decomposed)
     [ dup first* [ first2 rest 2array ] unless ] map
-    [ second empty? not ] filter
+    [ second empty? ] reject
     >hashtable chain-decomposed ;
 
 : process-combining ( data -- hash )
@@ -208,7 +209,7 @@ load-data {
 } cleave
 
 combine-map keys [ 2ch> nip ] map
-[ combining-class not ] filter
+[ combining-class ] reject
 [ 0 swap class-map set-at ] each
 
 load-special-casing special-casing swap assoc-union! drop