Beispiel #1
0
 def test_interpunction_single_line(self, sign):
     inp = 'Aa{sign} Bb{sign}  aa{sign}'.format(sign=sign)
     exp = {
         '':   { 'aa': 1 },
         'aa': { sign: 2 },
         sign:  { 'bb': 1, 'aa': 1 },
         'bb': { sign: 1 },
     }
     assert build_dict([inp])[0] == exp
Beispiel #2
0
 def test_caps(self):
     inp = ['Hello John McClane.']
     caps = build_dict(inp)[1]
     assert 'hello' not in caps
     assert caps['john'] == 'John'
     assert caps['mcclane'] == 'McClane'
Beispiel #3
0
 def test_lines_with_new_paragraphs(self, inp, exp):
     assert build_dict(inp)[0] == exp
Beispiel #4
0
 def test_multiple_empty_lines(self):
     d = build_dict(['', '   ', ''])[0]
     assert d[''] == {}
Beispiel #5
0
 def test_hyphen_single_line(self, inp, exp):
     assert build_dict([inp])[0] == exp