Finite-state Machine Construction Methods and Algorithms for Phonology and Morphology