是否有一个库可以告诉特定unicode字符属于哪个脚本?
例如,对于输入"u'ሕ'",它应该返回Ethiopic或类似的.
也许unicodedata模块中的数据是您正在寻找的:
print unicodedata.name(u"?")
Run Code Online (Sandbox Code Playgroud)
版画
ETHIOPIC SYLLABLE HHE
Run Code Online (Sandbox Code Playgroud)
打印的名称可用于查找相应的字符:
unicodedata.lookup("ETHIOPIC SYLLABLE HHE")
Run Code Online (Sandbox Code Playgroud)