2 # -*- coding: utf-8 -*-
4 from translate
.lang
import factory
6 def test_punctranslate():
7 """Tests that we can translate punctuation."""
8 language
= factory
.getlanguage('am')
9 assert language
.punctranslate(u
"abc efg") == u
"abc efg"
10 assert language
.punctranslate(u
"abc efg.") == u
"abc efg።"
11 assert language
.punctranslate(u
"abc efg. hij.") == u
"abc efg። hij።"
12 assert language
.punctranslate(u
"abc efg, hij;") == u
"abc efg፣ hij፤"
13 assert language
.punctranslate(u
"Delete file: %s?") == u
"Delete file: %s?"
16 """Tests basic functionality of sentence segmentation."""
17 language
= factory
.getlanguage('am')
18 sentences
= language
.sentences(u
"ለምልክቱ መግቢያ የተለየ መለያ። ይህ የሚጠቅመው የታሪኩን ዝርዝር ለማስቀመጥ ነው።")
20 assert sentences
== [u
"ለምልክቱ መግቢያ የተለየ መለያ።", u
"ይህ የሚጠቅመው የታሪኩን ዝርዝር ለማስቀመጥ ነው።"]