#!/usr/bin/python3 """Generate words for the language of the hadix. This still needs some work, and in particular some kind of weight function to do things like prefer words with ā€œiā€. """ onsets = ['p', 'k', 'kl', 'w', 's', 'd', ''] vowels = ['a', 'i', 'z', 'l', 'e', 'r', 'ie'] codas = ['p', 't', 'x', ''] syllables = [O + V + C for O in onsets for V in vowels for C in codas if not 'll' in O + V] words = [w for wo in (syllables + [A + B for A in syllables for B in syllables]) for w in [wo, wo + 'k'] if (w.endswith('kle') or (w.endswith('k') and not w.endswith('tk') and not w.endswith('pk')) or w.endswith('z') or w.endswith('ie') or w.endswith('ix'))]