all: latin.hash

paradigmas: latin.dic_
	cat latin.dic_ | cut -d '/' -f 3 | sort | uniq -c | sort -n | tail -56  | awk '{ print $$2 }' | sort|tail -55 > paradigmas


latin.aff latin.dic: latin.aff_ latin.dic_ paradigmas
	./associa-flags

latin.hash: latin.aff latin.dic
	jbuild latin.dic latin.aff latin.hash

latin.aff_: latin-rules.txt
	cat headaff > latin.aff_
	../NooJ-Tools/nooj2jspell latin-rules.txt >> latin.aff_

latin.dic_: latin-lexicon.txt
	../NooJ-Tools/noojd2jspelld latin-lexicon.txt > latin.dic_

clean:
	rm -f latin.aff latin.dic latin.hash latin.aff_ latin.dic_ paradigmas latin.dic.cnt latin.dic.stat

install: all
	cp latin.hash `jspell-dict --dic-dir`