Scala Hyphenation Algorithm