Handle error with empty word lists
Initial rewrite of grammar exporter
Update dummy grammar