er
This commit is contained in:
parent
af86822479
commit
8b4c9c10a8
1 changed files with 14 additions and 11 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
#-*-coding:utf-8-*-
|
#-*-coding:utf-8-*-
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
@ -121,10 +122,10 @@ class MainWindow(QtGui.QMainWindow, ui.Ui_MainWindow):
|
||||||
def input_characters(self):
|
def input_characters(self):
|
||||||
import re
|
import re
|
||||||
characters = self.lineEdit.text()
|
characters = self.lineEdit.text()
|
||||||
chinese_char_pattern = re.compile(u"^([一-鿌㐀-䶵\U00020000-\U0002A6D6])+$",re.UNICODE)
|
chinese_char_pattern = re.compile(u"^((?<cjk>[一-鿌㐀-䶵𠀀-𪛖𪜀-𫜴𫝀-𫠝𫠠-𬺡])|[^\CJK\s\t\n]+)+$",re.UNICODE)
|
||||||
is_chinese_chars = chinese_char_pattern.match(characters)
|
is_chinese_chars = chinese_char_pattern.match(characters)
|
||||||
|
|
||||||
if is_chinese_chars:
|
if 1:
|
||||||
char_code_list = [(ch,find_code(ch,self.c)) for ch in characters]
|
char_code_list = [(ch,find_code(ch,self.c)) for ch in characters]
|
||||||
self.show_result(char_code_list)
|
self.show_result(char_code_list)
|
||||||
else:
|
else:
|
||||||
|
@ -143,3 +144,5 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue