From: Volodymyr Poltavets Date: Tue, 22 Jun 2021 18:53:37 +0000 (+0200) Subject: * Don't count dictionary captions toward result count X-Git-Tag: v0.1.0~72 X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=c7d08b7280ffa1bb3aa1fa4a3d453f19a2ac6d2e;p=jiten-pai.git * Don't count dictionary captions toward result count --- diff --git a/jiten-pai.py b/jiten-pai.py index 90a1bdd..d90652e 100755 --- a/jiten-pai.py +++ b/jiten-pai.py @@ -1310,16 +1310,18 @@ class jpMainWindow(QMainWindow): if cfg['deinflect'] and mode == ScanMode.JAP and _vc_loaded: inflist = _vc_deinflect(term) # perform lookup + rdiff = 0 for d in dics: ok = True if len(dics) > 1: result.append(['#', d[0]]) + rdiff -= 1 # search de-inflected verbs if len(inflist) > 0: r, ok = self._search_deinflected(inflist, d[1], mode, limit) self._search_show_progress() result.extend(r) - limit -= len(r) + limit -= (len(r) + rdiff) if limit <= 0: break if not ok: @@ -1332,7 +1334,7 @@ class jpMainWindow(QMainWindow): r, ok = dict_lookup(d[1], s_term, mode, limit) self._search_show_progress() result.extend(r) - limit -= len(r) + limit -= (len(r) + rdiff) if not ok: self._search_show_dict_error(d[0]) # relax search options @@ -1344,7 +1346,7 @@ class jpMainWindow(QMainWindow): break # report results rlen = len(result) - self.result_group.setTitle('Search results: %d%s' % (rlen, '+' if rlen>=slimit else '')) + self.result_group.setTitle('Search results: %d%s' % (rlen + rdiff, '+' if rlen>=slimit else '')) QApplication.processEvents() # format result if rlen > cfg['hardlimit'] / 2: