From 42c7e60e2bf05442e8ed101ce57e39b9ee6bc785 Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Wed, 3 Jun 2020 23:50:23 +0200 Subject: [PATCH] add a rule to expand aspell dictionaries --- dict-dists-extractor/Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 $< | \ -- 2.30.2