From 6ea3badd277d7b7485692c000efac19951275fbe Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Wed, 19 May 2021 23:01:55 +0200 Subject: add BrefZipFuzzy --- python/refcat/tasks.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index 6d7bf56..c082e0a 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -659,3 +659,28 @@ class BrefZipArxiv(Refcat): def output(self): return luigi.LocalTarget(path=self.path(ext="json.zst"), format=Zstd) + + +class BrefZipFuzzy(Refcat): + """ + Run skate-reduce from two files, fuzzy mode. + """ + mapper = luigi.Parameter(default="ts", description="mapper short name") + + def requires(self): + return { + "refs": RefsMapped(mapper=self.mapper), + "fatcat": FatcatMapped(mapper=self.mapper), + } + + def run(self): + output = shellout(r""" + skate-reduce -m fuzzy -F <(zstdcat -T0 {refs}) -L <(zstdcat -T0 {fatcat}) | + zstd -c -T0 > {output} + """, + refs=self.input().get("refs").path, + fatcat=self.input().get("fatcat").path) + luigi.LocalTarget(output).move(self.output().path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="json.zst"), format=Zstd) -- cgit v1.2.3