replace with more up to date code from https://sourceforge.net/p/hfst/code/HEAD/tree/trunk/hfst-ospell/