2 # -*- coding: utf-8 -*-
4 from translate
.lang
import factory
7 """Tests basic functionality of sentence segmentation."""
8 language
= factory
.getlanguage('af')
9 sentences
= language
.sentences(u
"Normal case. Nothing interesting.")
10 assert sentences
== [u
"Normal case.", "Nothing interesting."]
11 sentences
= language
.sentences(u
"Wat? 'n Fout?")
12 assert sentences
== [u
"Wat?", "'n Fout?"]
13 sentences
= language
.sentences(u
"Dit sal a.g.v. 'n fout gebeur.")
14 assert sentences
== [u
"Dit sal a.g.v. 'n fout gebeur."]
17 """Tests that the indefinite article ('n) doesn't confuse startcaps()."""
18 language
= factory
.getlanguage('af')
19 assert language
.capsstart("Koeie kraam koeie")
20 assert language
.capsstart("'Koeie' kraam koeie")
21 assert not language
.capsstart("koeie kraam koeie")
22 assert language
.capsstart("\n\nKoeie kraam koeie")
23 assert language
.capsstart("'n Koei kraam koeie")
24 assert language
.capsstart("'n 'Koei' kraam koeie")
25 assert not language
.capsstart("'n koei kraam koeie")
26 assert language
.capsstart("\n\n'n Koei kraam koeie")