Isallchinese. Args: word: TODO.
(word: Union[List[Any], str])
| 17 | |
| 18 | |
| 19 | def 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 | |
| 43 | def isAllAlpha(word: Union[List[Any], str]): |
no test coverage detected
searching dependent graphs…