diff --git a/test/ne.rb b/test/ne.rb new file mode 100644 index 0000000..ba6a67c --- /dev/null +++ b/test/ne.rb @@ -0,0 +1,34 @@ +# encoding: utf-8 + +class TestNe < Minitest::Test + def setup + @varnam = get_varnam_handle('ne') + @varnam.config(Varnam::VARNAM_CONFIG_SET_TOKENIZER_SUGGESTIONS_LIMIT, 30) + end + + def test_words + list = { + 'kitaab' => 'किताब', + 'pitaa' => 'पिता', + 'prastuti' => 'प्रस्तुति', + 'kaaThamaanDau' => 'काठमान्डौ', + # not working vowel+vowel combinations + 'euTaa' => 'एउटा', + 'aaimaai' => 'आइमाइ' + } + list.each do |pattern, expected| + # TODO assert length of result array too + assert_equal expected, @varnam.transliterate(pattern)[0].Word + end + end + + def test_reverse_transliteration + list = { + 'नेपाली' => %w[nepaalee nepaalI nepAlee nepaalii nepali] + } + + list.each do |word, expected| + assert_equal expected, @varnam.reverse_transliterate(word) + end + end +end diff --git a/test/run.rb b/test/run.rb index 8b1c457..a60f7ec 100755 --- a/test/run.rb +++ b/test/run.rb @@ -25,3 +25,4 @@ def get_varnam_handle(scheme_id) require "minitest/autorun" require_relative './ml' require_relative './hi' +require_relative './ne'