* Improved de-inflected verb search.
authorUrban Wallasch <urban.wallasch@freenet.de>
Wed, 23 Jun 2021 21:28:34 +0000 (23:28 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Wed, 23 Jun 2021 21:28:34 +0000 (23:28 +0200)
jiten-pai.py

index 19995d1c21d4bcf878dd25a0f09d58b58fb9a3c9..1a338b26f73e5165c2499cc9c8db7bbe66ac034d 100755 (executable)
@@ -1270,7 +1270,7 @@ class jpMainWindow(QMainWindow):
         QApplication.processEvents()
 
     def _search_deinflected(self, inflist, dic, mode, limit):
-        re_isnoun = re.compile(r'\(n\)')
+        re_consider = re.compile(r'\((adj|adv|aux|n-adv|v(?!ulg|idg|ie))')
         result = []
         ok = True
         for inf in inflist:
@@ -1278,8 +1278,8 @@ class jpMainWindow(QMainWindow):
             # perform lookup
             res, ok = dict_lookup(dic, s_term, mode, limit)
             for r in list(res):
-                # drop nouns
-                if re_isnoun.search(r[2]):
+                # reject anything not a verb, or adjective, or ...
+                if not re_consider.search(r[2]):
                     continue
                 # keep the rest with appended inflection info
                 r.append(inf)