From 61105115ce24706a0e0c16c0f29b0f49e07ee2f7 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Tue, 1 Jun 2021 16:16:59 +0200 Subject: add UnmatchedResolveJournalNames --- python/refcat/tasks.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'python') diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index 17caf96..4193867 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -864,6 +864,28 @@ class UnmatchedMapped(Refcat): return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) +class UnmatchedResolveJournalNames(Refcat): + """ + Try to resolve journal names so we can match against both abbreviations and + full names. + """ + def requires(self): + return UnmatchedMapped() + + def run(self): + output = shellout(""" + zstdcat -T0 {input} | + skate-resolve-journal-name -f 2 -B -A {abbrev} + zstd -T0 -c > {output} + """, + abbrev=settings.JOURNAL_ABBREVIATIONS, + input=self.input().path) + luigi.LocalTarget(output).move(self.output().path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) + + class UnmatchedOpenLibraryMatchTable(Refcat): """ Run matching and write tabular results to file. About 50M rows. -- cgit v1.2.3