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