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('ko')
9 # Nothing should be translated
10 assert language
.punctranslate(u
"abc efg") == u
"abc efg"
11 assert language
.punctranslate(u
"abc efg.") == u
"abc efg."
12 assert language
.punctranslate(u
"abc efg. hij.") == u
"abc efg. hij."
13 assert language
.punctranslate(u
"abc efg!") == u
"abc efg!"
14 assert language
.punctranslate(u
"abc efg? hij!") == u
"abc efg? hij!"
15 assert language
.punctranslate(u
"Delete file: %s?") == u
"Delete file: %s?"
18 """Tests basic functionality of sentence segmentation."""
19 language
= factory
.getlanguage('ko')
20 sentences
= language
.sentences(u
"이 연락처에 바뀐 부분이 있습니다. 바뀐 사항을 저장하시겠습니까?")
22 assert sentences
== [u
"이 연락처에 바뀐 부분이 있습니다.", u
"바뀐 사항을 저장하시겠습니까?"]