Clean a string (e.g. a training set) by removing all ngrams previously registered as contaminants. Returns a list of clean chunks, or empty if the string was too dirty
(self, dirty_string)
| 157 | return self.register_contaminant_python(dirt_string) |
| 158 | |
| 159 | def clean(self, dirty_string): |
| 160 | """Clean a string (e.g. a training set) by removing all ngrams previously |
| 161 | registered as contaminants. Returns a list of clean chunks, or empty if |
| 162 | the string was too dirty""" |
| 163 | if JANITOR_CPP: |
| 164 | return self.clean_cpp(dirty_string) |
| 165 | else: |
| 166 | print("WARNING: Janitor running in python mode") |
| 167 | return self.clean_python(dirty_string) |
| 168 | |
| 169 | def _split_chunks(self, dirty_string, dirty_parts): |
| 170 | clean_chunks = [] |
nothing calls this directly
no test coverage detected