Skip to content

Commit

Permalink
added tests for bad inputs and for ML models for Telugu and Malayalam
Browse files Browse the repository at this point in the history
  • Loading branch information
irshadbhat committed Aug 6, 2016
1 parent 2c59405 commit 5533644
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion indictrans/tests/test_trans.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ def setUp(self):
self.trg2src += list(zip(target_urd, source))
self.test_dir = os.path.dirname(os.path.abspath(__file__))

def test_bad_input_lang(self):
self.assertRaises(NotImplementedError, Transliterator,
source='eng', target='unknown')
self.assertRaises(NotImplementedError, Transliterator,
source='unknown', target='eng')
self.assertRaises(NotImplementedError, Transliterator,
source='unknown', target='unknown')

def test_bad_decoder(self):
self.assertRaises(ValueError, Transliterator, decode='unknown')

def test_src2trg(self):
for lang_pair in self.src2trg:
src = lang_pair[0]
Expand Down Expand Up @@ -62,7 +73,7 @@ def test_kbest(self):
self.assertTrue(len(eng) == k)

def test_rtrans(self):
dev = 'tam ben ori'.split() # ML systems developed so far
dev = 'tam ben ori mal tel'.split() # ML systems developed so far
with io.open('%s/indic-test' % self.test_dir, encoding='utf-8') as fp:
indic = fp.readline().split()
for line in fp:
Expand Down

0 comments on commit 5533644

Please sign in to comment.