MCPcopy Index your code
hub / github.com/modelscope/FunASR / isAllChinese

Function isAllChinese

funasr/utils/postprocess_utils.py:19–40  ·  view source on GitHub ↗

Isallchinese. Args: word: TODO.

(word: Union[List[Any], str])

Source from the content-addressed store, hash-verified

17
18
19def isAllChinese(word: Union[List[Any], str]):
20 """Isallchinese.
21
22 Args:
23 word: TODO.
24 """
25 word_lists = []
26 for i in word:
27 cur = i.replace(" ", "")
28 cur = cur.replace("</s>", "")
29 cur = cur.replace("<s>", "")
30 cur = cur.replace("<unk>", "")
31 cur = cur.replace("<OOV>", "")
32 word_lists.append(cur)
33
34 if len(word_lists) == 0:
35 return False
36
37 for ch in word_lists:
38 if isChinese(ch) is False:
39 return False
40 return True
41
42
43def isAllAlpha(word: Union[List[Any], str]):

Callers 1

sentence_postprocessFunction · 0.70

Calls 1

isChineseFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…