Taiko/tooling/helpers.py

24 lines
495 B
Python
Raw Normal View History

2025-01-20 23:19:14 +01:00
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