(self, string)
| 35 | return string.strip().lower() |
| 36 | |
| 37 | def norm_str(self, string): |
| 38 | string = re.sub(self.other_char, " ", string) |
| 39 | |
| 40 | if self.nlp is None: |
| 41 | from spacy.lang.en import English |
| 42 | self.nlp = English() |
| 43 | |
| 44 | new_doc = list() |
| 45 | doc = self.nlp(string) |
| 46 | for token in doc: |
| 47 | if token.is_space or token.is_punct: |
| 48 | continue |
| 49 | if token.is_digit: |
| 50 | token = "[num]" |
| 51 | else: |
| 52 | token = token.text |
| 53 | |
| 54 | new_doc.append(token) |
| 55 | |
| 56 | return " ".join(new_doc).lower() |
| 57 | |
| 58 | def lean_str_sst(self, string): |
| 59 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected