From dc8efcf7c9a54733cd3573c92e4c071ae1211b42 Mon Sep 17 00:00:00 2001 From: Tomas Machalek Date: Wed, 19 Oct 2022 21:53:09 +0200 Subject: [PATCH] col_lemma - additional argument 'p' for more precise specification --- lib/plugins/ucnk_backlinks/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/plugins/ucnk_backlinks/__init__.py b/lib/plugins/ucnk_backlinks/__init__.py index aba62f2e7a..43ec7f3854 100644 --- a/lib/plugins/ucnk_backlinks/__init__.py +++ b/lib/plugins/ucnk_backlinks/__init__.py @@ -41,10 +41,11 @@ def col_lemma(self, req): raise UserActionException('Missing parameter "cl"') if self.args.corpname not in ('syn_v11', ): raise UserActionException('Function not supported in {}'.format(self.args.corpname)) - self.args.q = [ - 'q[col_lemma="{cl}"][]*[col_lemma="{cl}"] within '.format(cl=cl), - 'D', - 'f'] + self.args.q = ['q[col_lemma="{cl}"][]*[col_lemma="{cl}"] within '.format(cl=cl)] + pf = req.args.get('p') + if pf: + self.args.q.append(f'p0 0 1 [lemma="{pf}"]') + self.args.q.extend(['D', 'f']) self.args.refs = '=doc.title,=doc.pubyear' self.args.pagesize = 50 self.args.attrs = 'word'