Skip to content

Commit

Permalink
unit test for language ne (#12)
Browse files Browse the repository at this point in the history
* aded and modified some characters for language ne

* aded nepali unit test files
  • Loading branch information
khumnath authored Dec 7, 2023
1 parent 2c4137a commit 6faf3af
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 6faf3af

Please sign in to comment.