# HG changeset patch # User Oleksandr Gavenko # Date 1689974027 -10800 # Node ID ae963ee79b49d1d46ac6335af8b7f9800b902a32 # Parent b9e4703092df84226503b70ef87615eafee4d402 Added support for 25k freq wordlist for dictionary as an HTML page. diff -r b9e4703092df -r ae963ee79b49 py/gadict_c5.py diff -r b9e4703092df -r ae963ee79b49 py/gadict_html.py --- a/py/gadict_html.py Fri Jul 21 23:35:18 2023 +0300 +++ b/py/gadict_html.py Sat Jul 22 00:13:47 2023 +0300 @@ -20,6 +20,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)): @@ -50,6 +52,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: