File size: 734 Bytes
7c73423
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""

char_

"""


def detect_lang_from_unicode():
    pass


def is_digit_char(uchar):
    return uchar in "0123456789"


def contains_digit(text):
    return any(is_digit_char(ch) for ch in text)


def get_digit_count(text):
    pass

def is_all_digit(text):
    return all(is_digit_char(char) for char in text)


def get_digit_count(text):
    digit_count = 0
    for char in text:
        if char in "0123456789":
            digit_count += 1
    return digit_count


def has_space(text):
    pass

def is_all_space(text):
    pass

def get_space_count(text):
    space_count = 0
    for char in text:
        if len(char.strip()) == 0:
            space_count += 1
    return space_count