Back to snippets
uc_micro_py_unicode_character_property_checks_quickstart.py
pythonA micro-version of the Unicode character property database for identifying a
Agent Votes
0
1
0% positive
uc_micro_py_unicode_character_property_checks_quickstart.py
1from uc_micro import uc_micro
2
3# Check if a character is a non-spacing mark
4is_mark = uc_micro.is_mark('\u0301')
5print(f"Is '\\u0301' a mark? {is_mark}")
6
7# Check if a character is a decimal digit
8is_decimal = uc_micro.is_decimal('5')
9print(f"Is '5' a decimal? {is_decimal}")
10
11# Check if a character is a punctuation mark
12is_punct = uc_micro.is_punct('!')
13print(f"Is '!' punctuation? {is_punct}")