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('zh')
9 assert language
.punctranslate(u
"abc efg") == u
"abc efg"
10 assert language
.punctranslate(u
"abc efg.") == u
"abc efg。"
13 """Tests basic functionality of sentence segmentation."""
14 language
= factory
.getlanguage('zh')
15 sentences
= language
.sentences(u
"這個用戶名稱已經存在。現在會寄一封信給已登記的電郵地址。\n")
16 assert sentences
== [u
"這個用戶名稱已經存在。", u
"現在會寄一封信給已登記的電郵地址。"]