 ! See http://factorcode.org/license.txt for BSD license.
 USING: combinators.short-circuit assocs math kernel sequences
 io.files hashtables quotations splitting grouping arrays io
-math.parser hash2 math.order byte-arrays namespaces
+math.parser math.order byte-arrays namespaces math.bitwise
 compiler.units parser io.encodings.ascii values interval-maps
 ascii sets combinators locals math.ranges sorting make
 strings.parser io.encodings.utf8 memoize simple-flat-file ;

} cleave

: postprocess-class ( -- )
    combine-map [ values ] map concat
    [ combining-class not ] filter
    [ 0 swap class-map set-at ] each ;


: remove-exclusions ( alist -- alist )
    exclusions [ dup ] H{ } map>assoc assoc-diff ;

: process-canonical ( data -- hash hash )
    (process-decomposed) [ first* ] filter
    [
        [ second length 2 = ] filter remove-exclusions
        [ first2 >2ch swap ] H{ } assoc-map-as
    ] [ >hashtable chain-decomposed ] bi ;

: process-compatibility ( data -- hash )
