add Welsh dictionary
authorLaurent Mazet <mazet@softndesign.org>
Mon, 15 Jun 2020 10:00:49 +0000 (12:00 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Mon, 15 Jun 2020 10:00:49 +0000 (12:00 +0200)
dict-dists-extractor/Makefile

index daed46633547d3c2b1060fc1ee12af52a5b4d389..7ac4a2879f1ef2d9120667db32cae0e8126b7b09 100644 (file)
@@ -2,7 +2,7 @@
 
 ROOT_DICT = ../public/dict
 
-LANGS = bg br ca da de en eo es fr it nl no pl pt sv uk
+LANGS = bg br ca cy da de en eo es fr it nl no pl pt sv uk
 # to add: ar cs cy el et eu fi? ga he hr hu hy is lv ro ru sk sl
 #LANGS = af ar bg br ca cs cy da de el en eo es et eu fi fr ga he hr hu hy is it la lv ms nl no pl pt ro ru sk sl sv tr uk xk
 
@@ -121,6 +121,23 @@ $(ROOT_DICT)/cs.dict: cs.low $(DEPEND)
 
 #perl -p -e 'tr/aábcčdďeéěfghiíjklmnňoópqrřsštťuúůvwxyýzž/AÁBCČDĎEÉĚFGHIÍJKLMNŇOÓPQRŘSŠTŤUÚŮVWXYÝZŽ/' | \
 
+$(ROOT_DICT)/cy.dict: cy.low $(DEPEND)
+       echo Building $@ from $<
+       cat $< | \
+        grep -v '^.$$' | \
+        grep -v "['-]" | \
+        grep -vi "ph" | \
+        sed -e 's/[âä]/a/g' \
+            -e 's/[êë]/e/g' \
+            -e 's/[îï]/i/g' \
+            -e 's/[ôöò]/o/g' \
+            -e 's/[ûüù]/u/g' \
+            -e 's/[ŵ]/w/g' \
+            -e 's/[ŷ]/y/g' | \
+               tr '[a-z]' '[A-Z]' | \
+               sort | \
+               uniq > $@
+
 $(ROOT_DICT)/da.dict: da.low $(DEPEND)
        echo Building $@ from $<
        cat $< | \