Beispiel #1
0
    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)
Beispiel #2
0
    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)
Beispiel #3
0
 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 ")
Beispiel #4
0
 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 ')