From b496e5666637fe94972e352d36d8075a613d05b4 Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Sun, 7 Jun 2020 22:33:46 +0200 Subject: [PATCH] add English dictionnary --- dict-dists-extractor/Makefile | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/dict-dists-extractor/Makefile b/dict-dists-extractor/Makefile index c51ca26..9cdb61b 100644 --- a/dict-dists-extractor/Makefile +++ b/dict-dists-extractor/Makefile @@ -7,7 +7,25 @@ all: $(ROOT_DICT): mkdir $(ROOT_DICT) -$(ROOT_DICT)/fr.json: /usr/share/dict/french +$(ROOT_DICT)/en.json: /usr/share/dict/american-english Makefile + cat $< | \ + grep -v '^.$$' | \ + grep -v "[.'-]" | \ + sed -e 's/[áâàäå]/a/g' \ + -e 's/[ç]/c/g' \ + -e 's/[éêè]/e/g' \ + -e 's/[íî]/i/g' \ + -e 's/[ñ]/n/g' \ + -e 's/[óôö]/o/g' \ + -e 's/[ûü]/u/g' | \ + tr '[a-z]' '[A-Z]' | \ + sort | \ + uniq | \ + awk 'BEGIN { print "[" } \ + { print " \"" $$0 "\"," } \ + END { print " \"\"\n]" }' > $@ + +$(ROOT_DICT)/fr.json: /usr/share/dict/french Makefile cat $< | \ grep -v '^.$$' | \ grep -v "[.'-]" | \ -- 2.30.2