Пример #1
0
 def test_unicode(self):
     self.assertEqual(remove_latex_braces(
         'th{í}s is a Test'), 'thís is a Test')
     self.assertEqual(remove_latex_braces(
         '{t}hís is a Test'), 'thís is a Test')
     self.assertEqual(remove_latex_braces(
         'thís {is} a Test'), 'thís is a Test')
Пример #2
0
 def test_simple(self):
     self.assertEqual(remove_latex_braces(
         'this is a test'), 'this is a test')
     self.assertEqual(remove_latex_braces(
         'this is a {Test}'), 'this is a Test')
     self.assertEqual(remove_latex_braces(
         'this {is} a Test'), 'this is a Test')
     self.assertEqual(remove_latex_braces(
         '{this} is a Test'), 'this is a Test')
     self.assertEqual(remove_latex_braces(
         '{this is a Test}'), 'this is a Test')
Пример #3
0
 def test_remove_latex_braces(self):
     self.assertEqual(remove_latex_braces('Th{é}odore'), 'Th\xe9odore')
     self.assertEqual(remove_latex_braces('the {CADE} conference'), 'the CADE conference')
     self.assertEqual(remove_latex_braces('consider 2^{a+b}'), 'consider 2^{a+b}')
     self.assertEqual(remove_latex_braces('{why these braces?}'), 'why these braces?')
Пример #4
0
 def test_multiple(self):
     self.assertEqual(remove_latex_braces('J{é}r{é}mie'), 'Jérémie')
Пример #5
0
 def test_command(self):
     self.assertEqual(remove_latex_braces(
         'in \\mathbb{R} let'), 'in \\mathbb{R} let')
     self.assertEqual(remove_latex_braces(
         'in \\emph{blue} let'), 'in \\emph{blue} let')
Пример #6
0
 def test_math(self):
     self.assertEqual(remove_latex_braces(
         'base^{superscript}_{subscript}'), 'base^{superscript}_{subscript}')
Пример #7
0
def parse_authors_list(authors):
    authors = unescape_latex(authors)
    authors = et_al_re.sub('', authors)
    return map(parse_comma_name,
               remove_latex_braces(unescape_latex(authors)).split(' and '))
Пример #8
0
def parse_authors_list(authors):
    authors = unescape_latex(authors)
    authors = et_al_re.sub('', authors)
    return map(parse_comma_name,
                remove_latex_braces(unescape_latex(authors)).split(' and '))