Taiko/tooling/helpers.py
2025-01-20 23:20:26 +01:00

24 lines
495 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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