]> gitweb.factorcode.org Git - factor.git/commitdiff
regexp.disambiguate: use sets:refine.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 7 Dec 2020 20:12:56 +0000 (12:12 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 7 Dec 2020 20:12:56 +0000 (12:12 -0800)
basis/regexp/disambiguate/disambiguate.factor

index 4b952a7d1c47d1323633a0a2da13ca40aeb50c3d..1bcefbdb9df1be80885ea85034894ba92f12a94a 100644 (file)
@@ -26,12 +26,9 @@ TUPLE: parts in out ;
 : add-out ( seq partition -- partition' )
     [ nip in>> ] [ out>> append ] 2bi parts boa ;
 
-: intersection ( seq -- elts/f )
-    [ f ] [ [ ] [ intersect ] map-reduce ] if-empty ;
-
 : meaningful-integers ( partition table -- integers )
     [ [ in>> ] [ out>> ] bi ] dip
-    '[ [ _ at ] map intersection ] bi@ diff ;
+    '[ [ _ at ] map refine ] bi@ diff ;
 
 : class-integers ( classes integers -- table )
     '[ _ over '[ _ class-member? ] filter ] H{ } map>assoc ;