add English dictionnary
authorLaurent Mazet <mazet@softndesign.org>
Sun, 7 Jun 2020 20:33:46 +0000 (22:33 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Sun, 7 Jun 2020 20:33:46 +0000 (22:33 +0200)
dict-dists-extractor/Makefile

index c51ca26ec85271f3bc9a98f9e23e188acc9bd039..9cdb61b99be018f74369c126b9d3111fe5dc6959 100644 (file)
@@ -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 "[.'-]" | \