Пример #1
0
 def test_dollar_present(self):
     self.assertEqual(unescape_latex(
         'The revenue is $30 per cow'), 'The revenue is $30 per cow')
     self.assertEqual(remove_latex_math_dollars('The revenue is $30 per cow'),
                      'The revenue is $30 per cow')
     self.assertEqual(remove_latex_math_dollars('Instead of $15, the revenue is $30 per cow'),
                      'Instead of $15, the revenue is $30 per cow')
Пример #2
0
 def test_remove_latex_math_dollars(self):
     self.assertEqual(remove_latex_math_dollars(
         'This is an $α$ test'), 'This is an α test')
     self.assertEqual(remove_latex_math_dollars(
         'This is an $α + x$ test'), 'This is an α + x test')
Пример #3
0
 def test_remove_latex_math_dollars(self):
     self.assertEqual(remove_latex_math_dollars('This is $\\beta$-reduction explained'), 'This is \\beta-reduction explained')
     self.assertEqual(remove_latex_math_dollars('Compare $\\frac{2}{3}$ to $\\\\pi$'), 'Compare \\frac{2}{3} to \\\\pi')
     self.assertEqual(remove_latex_math_dollars('Click here to win $100'), 'Click here to win $100')
     self.assertEqual(remove_latex_math_dollars('What do you prefer, $50 or $100?'), 'What do you prefer, $50 or $100?')