Skip to content

Commit

Permalink
aded nepali unit test files
Browse files Browse the repository at this point in the history
  • Loading branch information
khumnath committed Dec 6, 2023
1 parent d61adeb commit 0c8d325
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/ne.rb
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions test/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ def get_varnam_handle(scheme_id)
require "minitest/autorun"
require_relative './ml'
require_relative './hi'
require_relative './ne'

0 comments on commit 0c8d325

Please sign in to comment.