Skip to content

Commit

Permalink
Add test for Hindi
Browse files Browse the repository at this point in the history
  • Loading branch information
subins2000 committed Dec 3, 2023
1 parent c6a5300 commit a787bd6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/hi.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# encoding: utf-8

class TestHi < Minitest::Test
def setup
@varnam = get_varnam_handle('hi')
@varnam.config(Varnam::VARNAM_CONFIG_SET_TOKENIZER_SUGGESTIONS_LIMIT, 30)
end

def test_words
list = {
'kithaab' => 'किताब',
'pithaa' => 'पिता'
}
list.each do |pattern, expected|
# TODO assert length of result array too
assert_equal expected, @varnam.transliterate(pattern)[0].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 @@ -24,3 +24,4 @@ def get_varnam_handle(scheme_id)

require "minitest/autorun"
require_relative './ml'
require_relative './hi'

0 comments on commit a787bd6

Please sign in to comment.