Exemple #1
0
 def test_latex_to_unicode_names(self):
     self.assertEqual(
         u'Bernd van Linder',
         latex_to_unicode('Bernd {van Linder}', capitalize='name'))
     self.assertEqual(
         u'Bernd van Linder',
         latex_to_unicode('Bernd van Linder', capitalize='name'))
     self.assertEqual(
         u'John-Jules Ch. Meyer',
         latex_to_unicode('{John-Jules Ch.} meyer', capitalize='name'))
     self.assertEqual(
         u'Eijkhof, Frank van den',
         latex_to_unicode('eijkhof, frank {v}an {d}en', capitalize='name'))
     self.assertEqual(
         u'Feng, Wen-Mei Hwu',
         latex_to_unicode('Feng, Wen-mei Hwu', capitalize='name'))
     self.assertEqual(
         u'Feng, Wen-mei Hwu',
         latex_to_unicode('Feng, Wen{-mei} Hwu', capitalize='name'))
     self.assertEqual(
         u'McCartney, Paul',
         latex_to_unicode('McCartney, Paul', capitalize='name'))
     self.assertEqual(u'Leo MacGarry',
                      latex_to_unicode('Leo MacGarry', capitalize='name'))
     self.assertEqual(
         u'Patrick O\'Mahoney',
         latex_to_unicode('Patrick O\'Mahoney', capitalize='name'))
     self.assertEqual(u'O\'Boyle, Jim',
                      latex_to_unicode('O\'Boyle, Jim', capitalize='name'))
Exemple #2
0
 def test_latex_to_unicode_titles(self):
     self.assertEqual(
         u'A guide for ChemDataExtractor',
         latex_to_unicode('A Guide For {ChemDataExtractor}',
                          capitalize='sentence'))
     self.assertEqual(
         u'A Guide for ChemDataExtractor',
         latex_to_unicode('A Guide For {ChemDataExtractor}',
                          capitalize='title'))
     self.assertEqual(
         u'A Guide for ChemDataExtractor',
         latex_to_unicode('A Guide For {ChemDataExtractor}',
                          capitalize='title'))
Exemple #3
0
 def test_latex_to_unicode_math(self):
     self.assertEqual(
         u'[g,f]-colorings of Partial k-trees',
         latex_to_unicode('$[g,f]$-colorings of Partial $k$-trees',
                          capitalize='title'))
     self.assertEqual(
         u'On K_3,3-free or K_5-free Graphs',
         latex_to_unicode('On {$K_{3,3}$}-free or {$K_5$}-free graphs',
                          capitalize='title'))
     self.assertEqual(
         u'Clique-width \u22643 Graphs',
         latex_to_unicode('clique-width $\\leq 3$ graphs',
                          capitalize='title'))
     self.assertEqual(
         u'An O(n^2.5) Algorithm',
         latex_to_unicode('An {O}($n^{2.5}$) Algorithm',
                          capitalize='title'))
     self.assertEqual(
         u'An n \xd7 N Board',
         latex_to_unicode('an $n \\times n$ board', capitalize='title'))
     self.assertEqual(
         u'Of k-trees Is O(k)',
         latex_to_unicode('of \\mbox{$k$-trees} is {$O(k)$}',
                          capitalize='title'))