def _build_unicode_character_database(self):
filename = "<STR_LIT>"<EOL>current_dir = os.path.abspath(os.path.dirname(__file__))<EOL>tag = re.compile(r"<STR_LIT>")<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():<EOL><INDENT>continue<EOL><DEDENT>data = line.strip().split("<STR_LIT:;>")<EOL>if data[<NUM_LIT:1>].endswith((u"<STR_LIT>", u"<STR_LIT>")) and _is_derived(int(data[<NUM_LIT:0>], <NUM_LIT:16>)):<EOL><INDENT>data[<NUM_LIT:1>] = _get_nr_prefix(int(data[<NUM_LIT:0>], <NUM_LIT:16>))<EOL>if data[<NUM_LIT:1>].startswith("<STR_LIT>"):  <EOL><INDENT>data[<NUM_LIT:1>] += _get_hangul_syllable_name(int(data[<NUM_LIT:0>], <NUM_LIT:16>))<EOL><DEDENT>else:  <EOL><INDENT>data[<NUM_LIT:1>] += data[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>data[<NUM_LIT:3>] = int(data[<NUM_LIT:3>])  <EOL>if data[<NUM_LIT:5>]:  <EOL><INDENT>data[<NUM_LIT:5>] = u"<STR_LIT:U+0020>".join([_hexstr_to_unichr(s) if not tag.match(s) else s for s in data[<NUM_LIT:5>].split()])<EOL><DEDENT>for i in [<NUM_LIT:6>, <NUM_LIT:7>, <NUM_LIT:8>]:  <EOL><INDENT>if data[i]:<EOL><INDENT>if "<STR_LIT:/>" in data[i]:<EOL><INDENT>data[i] = Fraction(data[i])<EOL><DEDENT>else:<EOL><INDENT>data[i] = int(data[i])<EOL><DEDENT><DEDENT><DEDENT>for i in [<NUM_LIT:12>, <NUM_LIT>, <NUM_LIT>]:  <EOL><INDENT>if data[i]:<EOL><INDENT>data[i] = _hexstr_to_unichr(data[i])<EOL><DEDENT><DEDENT>lookup_name = _uax44lm2transform(data[<NUM_LIT:1>])<EOL>uc_data = UnicodeCharacter(u"<STR_LIT>" + data[<NUM_LIT:0>], *data[<NUM_LIT:1>:])<EOL>self._unicode_character_database[int(data[<NUM_LIT:0>], <NUM_LIT:16>)] = uc_data<EOL>self._name_database[lookup_name] = uc_data<EOL><DEDENT><DEDENT>for lookup_range, prefix_string in _nr_prefix_strings.items():<EOL><INDENT>exemplar = self._unicode_character_database.__getitem__(lookup_range[<NUM_LIT:0>])<EOL>for item in lookup_range:<EOL><INDENT>hex_code = _padded_hex(item)<EOL>new_name = prefix_string<EOL>if prefix_string.startswith("<STR_LIT>"):  <EOL><INDENT>new_name += _get_hangul_syllable_name(item)<EOL><DEDENT>else:  <EOL><INDENT>new_name += hex_code<EOL><DEDENT>uc_data = exemplar._replace(code=u"<STR_LIT>" + hex_code, name=new_name)<EOL>self._unicode_character_database[item] = uc_data<EOL>self._name_database[_uax44lm2transform(new_name)] = uc_data<EOL><DEDENT><DEDENT>
Function for parsing the Unicode character data from the Unicode Character
Database (UCD) and generating a lookup table.  For more info on the UCD,
see the following website: https://www.unicode.org/ucd/