py/gadict_c5.py
changeset 1347 272ec25b6f12
parent 1315 6532512bbac4
--- a/py/gadict_c5.py	Fri Jul 21 23:19:15 2023 +0300
+++ b/py/gadict_c5.py	Fri Jul 21 23:23:31 2023 +0300
@@ -19,6 +19,8 @@
 ARG_LANG_RE = re.compile("-lang:(.+)")
 # -freq:var:TAG=FILE or -freq:freq:TAG=FILE
 ARG_FREQ_RE = re.compile("-freq:(freq|var):([^=]+)=(.+)")
+# -grp:GLOB
+ARG_GRP_RE = re.compile("-grp:(.+)")
 
 look_for_files = False
 for idx in range(1, len(sys.argv)):
@@ -49,6 +51,13 @@
                 wlist = parser.parse()
             FREQ_SOURCES.append((tag, set(wlist)))
             continue
+        m = ARG_GRP_RE.match(arg)
+        if m:
+            patt = m.group(1)
+            parser = gadict_freq.WordformGroupParser(patt)
+            for (tag, wset) in parser.parse().items():
+                FREQ_SOURCES.append((tag, wset))
+            continue
         if arg.startswith("-"):
             raise Exception("Unsupported option format: '{:s}'".format(arg))
     if not FINAME: