Example #1
0
def run_compare_sgb_and_siy_to_base(fs):
    """[str] -> {utf-8-char:set<lev.Rule>}
    ((sgb <=> base) & (sgb <=> base)) - (map (<=> base) rest)"""
    sgb = fs[2]
    siy = fs[8]
    base = fs[0]
    del fs[8]
    del fs[2]
    del fs[0]  # dangerous but who cares
    outsiders = dct.zipwith(and_, classify(compare(base, sgb)), classify(compare(base, siy)), default=set())
    others = map(compose(classify, cur(compare, base)), fs)
    kws = {"default": set()}
    return dct.zipwith((lambda v, *rest: reduce(sub, rest, v)), outsiders, *others, **kws)
Example #2
0
def run_compare_shared_sgbsiy(fs):
    """this really needs a lenient definition of eq?
    (sgb <=> base) & (siy <=> base)"""
    sgb = fs[2]
    siy = fs[8]
    base = fs[0]
    del fs[8]
    del fs[2]
    del fs[0]  # dangerous but who cares
    return dct.zipwith(and_, classify(compare(base, sgb)), classify(compare(base, siy)), default=set())
Example #3
0
def run_compare_all_to_sgbsiy(fs):
    """[str] -> {utf-8-char:set<lev.Rule>}
    (siy<=>sgb) - (map (base<=>) rest)"""
    sgb = fs[2]
    siy = fs[8]
    base = fs[0]
    del fs[8]
    del fs[2]
    del fs[0]  # dangerous but who cares
    diff = classify(compare(sgb, siy))
    others = map(compose(classify, cur(compare, base)), fs)
    # return dct_mapall(lambda v,*rest: reduce(sub, rest, v), diff, *others)
    kws = {"default": set()}
    return dct.zipwith((lambda v, *rest: reduce(sub, rest, v)), diff, *others, **kws)