Skip to content

Commit

Permalink
Merge b2f4fd4 into ab64c6e
Browse files Browse the repository at this point in the history
  • Loading branch information
sih4sing5hong5 committed Aug 2, 2018
2 parents ab64c6e + b2f4fd4 commit fd3bbbb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 試驗/testItaigi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class itaigi試驗(TestCase):
@classmethod
def setUpClass(cls):
call_command('itaigi')
return super(itaigi試驗, cls).setUpClass()
return super().setUpClass()

def test句數正確(self):
self.assertGreater(訓練過渡格式.資料數量(), 8000)
Expand Down
27 changes: 26 additions & 1 deletion 試驗/test教典詞條.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
from django.test.testcases import TestCase
from 臺灣言語服務.models import 訓練過渡格式
from 匯入.management.commands.教典詞條 import Command
from 臺灣言語工具.解析整理.拆文分析器 import 拆文分析器


class 教典詞條試驗(TestCase):
@classmethod
def setUpClass(cls):
call_command('教典詞條')
return super().setUpClass()

def test句數正確(self):
call_command('教典詞條')
self.assertGreater(訓練過渡格式.資料數量(), 25000)

def test切腔口又音(self):
Expand All @@ -21,3 +25,24 @@ def test切tsē又音(self):
Command().tsheh_iuim('ē-kì--tsit、ē-kì--lit、ē-kì--lih、ē-kì--eh'),
['ē-kì--tsit', 'ē-kì--lit', 'ē-kì--lih', 'ē-kì--eh']
)

def test主詞條(self):
self.assertTrue(
訓練過渡格式.objects.filter(
文本=拆文分析器.建立句物件('上青苔', 'tshiūnn-tshenn-thî').看分詞()
).exists()
)

def test第二優勢腔(self):
self.assertTrue(
訓練過渡格式.objects.filter(
文本=拆文分析器.建立句物件('上青苔', 'tshiūnn-tshinn-thî').看分詞()
).exists()
)

def test又音(self):
self.assertTrue(
訓練過渡格式.objects.filter(
文本=拆文分析器.建立句物件('上青苔', 'tshiūnn-tshenn-tî').看分詞()
).exists()
)

0 comments on commit fd3bbbb

Please sign in to comment.