def _load_hangul_syllable_types():
filename = "<STR_LIT>"<EOL>current_dir = os.path.abspath(os.path.dirname(__file__))<EOL>with codecs.open(os.path.join(current_dir, filename), mode="<STR_LIT:r>", encoding="<STR_LIT:utf-8>") as fp:<EOL><INDENT>for line in fp:<EOL><INDENT>if not line.strip() or line.startswith("<STR_LIT:#>"):<EOL><INDENT>continue  <EOL><DEDENT>data = line.strip().split("<STR_LIT:;>")<EOL>syllable_type, _ = map(six.text_type.strip, data[<NUM_LIT:1>].split("<STR_LIT:#>"))<EOL>if "<STR_LIT:..>" in data[<NUM_LIT:0>]:  <EOL><INDENT>start, end = map(lambda x: int(x, <NUM_LIT:16>), data[<NUM_LIT:0>].strip().split("<STR_LIT:..>"))<EOL>for idx in range(start, end + <NUM_LIT:1>):<EOL><INDENT>_hangul_syllable_types[idx] = syllable_type<EOL><DEDENT><DEDENT>else:<EOL><INDENT>_hangul_syllable_types[int(data[<NUM_LIT:0>].strip(), <NUM_LIT:16>)] = syllable_type<EOL><DEDENT><DEDENT><DEDENT>
Helper function for parsing the contents of "HangulSyllableType.txt" from the Unicode Character Database (UCD) and
generating a lookup table for determining whether or not a given Hangul syllable is of type "L", "V", "T", "LV" or
"LVT".  For more info on the UCD, see the following website: https://www.unicode.org/ucd/