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

Function isAllAlpha

funasr/utils/postprocess_utils.py:43–67  ·  view source on GitHub ↗

Isallalpha. Args: word: TODO.

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

Source from the content-addressed store, hash-verified

41
42
43def isAllAlpha(word: Union[List[Any], str]):
44 """Isallalpha.
45
46 Args:
47 word: TODO.
48 """
49 word_lists = []
50 for i in word:
51 cur = i.replace(" ", "")
52 cur = cur.replace("</s>", "")
53 cur = cur.replace("<s>", "")
54 cur = cur.replace("<unk>", "")
55 cur = cur.replace("<OOV>", "")
56 word_lists.append(cur)
57
58 if len(word_lists) == 0:
59 return False
60
61 for ch in word_lists:
62 if ch.isalpha() is False and ch != "'":
63 return False
64 elif ch.isalpha() is True and isChinese(ch) is True:
65 return False
66
67 return True
68
69
70# def abbr_dispose(words: List[Any]) -> List[Any]:

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…