Hangul Automata for Javascript