From: Laurent Mazet Date: Wed, 3 Jun 2020 21:50:23 +0000 (+0200) Subject: add a rule to expand aspell dictionaries X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=42c7e60e2bf05442e8ed101ce57e39b9ee6bc785;p=trivabble.git add a rule to expand aspell dictionaries --- diff --git a/dict-dists-extractor/Makefile b/dict-dists-extractor/Makefile index 5025b2e..67f7385 100644 --- a/dict-dists-extractor/Makefile +++ b/dict-dists-extractor/Makefile @@ -5,6 +5,8 @@ ROOT_DICT = ../public/dict LANGS = bg ca da de en eo es fr it nl no po sv uk # pl not working +DICTS = $(addsuffix .dict,$(LANGS)) + MAKEFLAGS = -s all: @@ -16,6 +18,17 @@ $(ROOT_DICT): count: wc -l $(ROOT_DICT)/* +dicts: $(DICTS) + +$(DICTS):%: + lang=$(@:.dict=); \ + apt search aspell-$$lang && \ + ( dpkg -l aspell-$$lang | grep ^ii || \ + sudo apt install aspell-$$lang ) && \ + aspell -d $$lang dump master | aspell -l $$lang expand | \ + tr -s '[:space:]' '\n' | \ + LC_ALL=C sort -S28G -u > $$lang.dict + $(ROOT_DICT)/bg.json: /usr/share/dict/bulgarian Makefile echo Building $@ from $< iconv -f Windows-1251 -t utf-8 $< | \