def _clean(self, text): """ Cleans up MediaWiki text of markup. Currently a "naive" version in that it just strips *all* punctuation. Will eventually want to strip out unnecessary markup syntax as well, such as 'File:' and 'Category'. Args: | text (str) -- the MediaWiki text to cleanup. Returns: | str -- the replaced text. """ return brain.depunctuate(text)
def test_depunctuate(self): data = "[h%e@l&l~o* (t/h>e,r.e:" self.assertEqual(brain.depunctuate(data), " h e l l o t h e r e ")
def test_depunctuate(self): data = '[h%e@l&l~o* (t/h>e,r.e:' self.assertEqual(brain.depunctuate(data), ' h e l l o t h e r e ')