24 lines
495 B
Python
24 lines
495 B
Python
import re
|
||
|
||
|
||
def capfirst(s):
|
||
if s is not None:
|
||
return s[:1].upper() + s[1:]
|
||
return s
|
||
|
||
|
||
def is_cjk(string: str):
|
||
if re.match(
|
||
"^[A-Za-z0-9!@#\$%^&*()_+=\[\]{};:'’\",.<>\/\\|λéÓíäā?\-–*$~μ♨☆★♥♡♪↑↓◆××・⑨“”°Δ ]*$",
|
||
string,
|
||
):
|
||
return False
|
||
else:
|
||
return True
|
||
|
||
|
||
def fetchKey(key: str, wordlist):
|
||
for wordentry in wordlist["items"]:
|
||
if wordentry["key"] == key:
|
||
return wordentry
|