# -*- Makefile -*-
ROOT_DICT = ../public/dict
+#OBJ_DIR = .
+OBJ_DIR = /tmp/trivabble
# 0MB < dictionary size < 10MB
SMALL = br ca cy da de en es fr ga hr hu hy is lv nl no pt sv
DICTS = $(addsuffix .dict,$(LANGS))
DEPEND = Makefile
-#MAKEFLAGS = -s
+MAKEFLAGS = -s
all: required
make $(addprefix check-,$(LANGS))
$(ROOT_DICT):
mkdir $(ROOT_DICT)
+$(OBJ_DIR):
+ mkdir $(OBJ_DIR)
+
count:
wc -l $(ROOT_DICT)/*
low: $(LOWS)
-required: src.mk $(ROOT_DICT)
+required: $(OBJ_DIR) $(OBJ_DIR)/src.mk $(ROOT_DICT)
-src.mk:
+$(OBJ_DIR)/src.mk:
echo Creation language table
wget $(ASPDICT) -q -O - | \
awk 'BEGIN { base="'`dirname $(ASPDICT)`'" } \
/<tr><td><a/ { $$0 = gensub(/.*"(.+)".*"(.+)\/(.+)".*/, "\\1 \\2 \\3", "g"); \
- printf "%s.dir: %s\n\n", $$1, $$3; \
- printf "%s:\n", $$3; \
+ printf "$(OBJ_DIR)/%s.dir: $(OBJ_DIR)/%s\n\n", $$1, $$3; \
+ printf "$(OBJ_DIR)/%s:\n", $$3; \
printf "\techo Downloading %s dictionary source\n", $$1; \
- printf "\twget -q %s/%s/%s\n\n", base, $$2, $$3 } \
+ printf "\twget -q %s/%s/%s -O $$@\n\n", base, $$2, $$3 } \
/<\/table>/ { exit }' > $@
-include $(wildcard src.mk)
+include $(wildcard $(OBJ_DIR)/src.mk)
-INSTALL_ASPELL_DICT = tar xjf $(1) && \
+INSTALL_ASPELL_DICT = cd $(OBJ_DIR) && \
+ tar xjf $(1) && \
cd $(2) && \
./configure && \
make
ASPELL_DUMP_MASTER = aspell --dict-dir=$(2) -d $(1) dump master $(1) | \
aspell --dict-dir=$(2) -l $(1) expand | \
tr -s '[:space:]' '\n' | \
- LC_ALL=C sort -S28G -u > $(1).low
+ LC_ALL=C sort -S28G -u > $(3)
%.dir:
- echo Installing $(@:.dir=) dictionary
+ echo Installing $@ dictionary
$(call INSTALL_ASPELL_DICT,$<,$(<:.tar.bz2=))
mv $(<:.tar.bz2=) $@
%.low: %.dir
echo Building list of word $@
- $(call ASPELL_DUMP_MASTER,$(<:.dir=),./$<)
+ $(call ASPELL_DUMP_MASTER,$(patsubst $(OBJ_DIR)/%.dir,%,$<),$<,$@)
-no.low:
- make nb.low
- mv nb.low $@
+$(OBJ_DIR)/no.low:
+ make $(OBJ_DIR)/nb.low
+ mv $(OBJ_DIR)/nb.low $@
-pt.low:
- make pt_PT.low
- mv pt_PT.low $@
+$(OBJ_DIR)/pt.low:
+ make $(OBJ_DIR)/pt_PT.low
+ mv $(OBJ_DIR)/pt_PT.low $@
-$(ROOT_DICT)/ar.dict: ar.low $(DEPEND)
+$(ROOT_DICT)/ar.dict: $(OBJ_DIR)/ar.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
uniq > $@
# ا ل ن ش ا ش ي بِ ي ي ب ا ل ن ش ا ش ي بِ ي ي ب ن ش ا ش ي بِ ي ي ف ا ل ن ش ا ش ي بِ ي ي ف ب ا ل ن ش ا ش ي بِ ي ي ف ب ن ش ا ش ي بِ ي ي ف ك ا ل ن ش ا ش ي بِ ي ي ف ك ن ش ا ش ي بِ ي ي ف ل ل ن ش ا ش ي بِ ي ي ف ل ن ش ا ش ي بِ ي ي ف ن ش ا ش ي بِ ي ي ك ا ل ن ش ا ش ي بِ ي ي ك ن ش ا ش ي بِ ي ي ل ل ن ش ا ش ي بِ ي ي ل ن ش ا ش ي بِ ي ي ن ش ا ش ي بِ ي ي و ا ل ن ش ا ش ي بِ ي ي و ب ا ل ن ش ا ش ي بِ ي ي و ب ن ش ا ش ي بِ ي ي و ك ا ل ن ش ا ش ي بِ ي ي و ك ن ش ا ش ي بِ ي ي و ل ل ن ش ا ش ي بِ ي ي و ل ن ش ا ش ي بِ ي ي و ن ش ا ش ي بِ ي ي
-$(ROOT_DICT)/bg.dict: bg.low $(DEPEND)
+$(ROOT_DICT)/bg.dict: $(OBJ_DIR)/bg.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/br.dict: br.low $(DEPEND)
+$(ROOT_DICT)/br.dict: $(OBJ_DIR)/br.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/ca.dict: ca.low $(DEPEND)
+$(ROOT_DICT)/ca.dict: $(OBJ_DIR)/ca.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/cs.dict: cs.low $(DEPEND)
+$(ROOT_DICT)/cs.dict: $(OBJ_DIR)/cs.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/cy.dict: cy.low $(DEPEND)
+$(ROOT_DICT)/cy.dict: $(OBJ_DIR)/cy.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/da.dict: da.low $(DEPEND)
+$(ROOT_DICT)/da.dict: $(OBJ_DIR)/da.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/de.dict: de.low $(DEPEND)
+$(ROOT_DICT)/de.dict: $(OBJ_DIR)/de.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/el.dict: el.low $(DEPEND)
+$(ROOT_DICT)/el.dict: $(OBJ_DIR)/el.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/en.dict: en.low $(DEPEND)
+$(ROOT_DICT)/en.dict: $(OBJ_DIR)/en.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/eo.dict: eo.low $(DEPEND)
+$(ROOT_DICT)/eo.dict: $(OBJ_DIR)/eo.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/es.dict: es.low $(DEPEND)
+$(ROOT_DICT)/es.dict: $(OBJ_DIR)/es.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/et.dict: et.low $(DEPEND)
+$(ROOT_DICT)/et.dict: $(OBJ_DIR)/et.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/fi.dict: fi.low $(DEPEND)
+$(ROOT_DICT)/fi.dict: $(OBJ_DIR)/fi.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/fr.dict: fr.low $(DEPEND)
+$(ROOT_DICT)/fr.dict: $(OBJ_DIR)/fr.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/ga.dict: ga.low $(DEPEND)
+$(ROOT_DICT)/ga.dict: $(OBJ_DIR)/ga.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/he.dict: he.low $(DEPEND)
+$(ROOT_DICT)/he.dict: $(OBJ_DIR)/he.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/hr.dict: hr.low $(DEPEND)
+$(ROOT_DICT)/hr.dict: $(OBJ_DIR)/hr.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/hu.dict: hu.low $(DEPEND)
+$(ROOT_DICT)/hu.dict: $(OBJ_DIR)/hu.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
uniq > $@
#grep -v "['ԁԃԂԃ-]"
-$(ROOT_DICT)/hy.dict: hy.low $(DEPEND)
+$(ROOT_DICT)/hy.dict: $(OBJ_DIR)/hy.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/it.dict: it.low $(DEPEND)
+$(ROOT_DICT)/it.dict: $(OBJ_DIR)/it.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/is.dict: is.low $(DEPEND)
+$(ROOT_DICT)/is.dict: $(OBJ_DIR)/is.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/lv.dict: lv.low $(DEPEND)
+$(ROOT_DICT)/lv.dict: $(OBJ_DIR)/lv.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/nl.dict: nl.low $(DEPEND)
+$(ROOT_DICT)/nl.dict: $(OBJ_DIR)/nl.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/no.dict: no.low $(DEPEND)
+$(ROOT_DICT)/no.dict: $(OBJ_DIR)/no.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/pl.dict: pl.low $(DEPEND)
+$(ROOT_DICT)/pl.dict: $(OBJ_DIR)/pl.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/pt.dict: pt.low $(DEPEND)
+$(ROOT_DICT)/pt.dict: $(OBJ_DIR)/pt.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/ro.dict: ro.low $(DEPEND)
+$(ROOT_DICT)/ro.dict: $(OBJ_DIR)/ro.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/ru.dict: ru.low $(DEPEND)
+$(ROOT_DICT)/ru.dict: $(OBJ_DIR)/ru.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/sk.dict: sk.low $(DEPEND)
+$(ROOT_DICT)/sk.dict: $(OBJ_DIR)/sk.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/sl.dict: sl.low $(DEPEND)
+$(ROOT_DICT)/sl.dict: $(OBJ_DIR)/sl.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/sv.dict: sv.low $(DEPEND)
+$(ROOT_DICT)/sv.dict: $(OBJ_DIR)/sv.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \
sort | \
uniq > $@
-$(ROOT_DICT)/uk.dict: uk.low $(DEPEND)
+$(ROOT_DICT)/uk.dict: $(OBJ_DIR)/uk.low $(DEPEND)
echo Building $@ from $<
cat $< | \
grep -v '^.$$' | \