#!/bin/bash

./build_combinations.pl < root_words.dat > a.tmp

tr À-ß à-ÿ < a.tmp > b.tmp

sort < b.tmp > a.tmp
uniq < a.tmp > b.tmp

perl mix_identical.pl < b.tmp > a.tmp

tail +2 a.tmp > b.tmp

perl make_fixed_size.pl no_binary < b.tmp > a.tmp

echo -n "Combinations.Word.MaxSize=" >> config.dat
head -1 a.tmp >> config.dat

echo -n "Combinations.Types.MaxNum=" >> config.dat
head -2 a.tmp | tail -1 >> config.dat

echo -n "Combinations.Types.MaxSize=" >> config.dat
head -3 a.tmp | tail -1 >> config.dat


tail +4 a.tmp > combinations.dat

rm -f *.tmp
