Class: NWordTest
- Inherits:
-
Test::Unit::TestCase
- Object
- Test::Unit::TestCase
- NWordTest
- Defined in:
- ext/word_tagger/test.rb
Instance Method Summary collapse
Instance Method Details
#setup ⇒ Object
7 8 9 10 11 12 13 |
# File 'ext/word_tagger/test.rb', line 7 def setup if !defined?($tagger) $tagger = Tagger::WordTagger.new $tagger.( File.read('../../tags.txt').split("\n") ) $tagger.set_words( 4 ); end end |
#test_basic ⇒ Object
15 16 17 18 19 20 21 |
# File 'ext/word_tagger/test.rb', line 15 def test_basic timer = Time.now text = "This is a sa'mple doc[]ument lets see how cancer ngrams 4 works out for this interesting text!" = $tagger.execute( text ) assert_equal ['cancer','work'], puts "Duration: #{Time.now - timer} sec" end |
#test_ngram_size3 ⇒ Object
23 24 25 26 27 28 29 |
# File 'ext/word_tagger/test.rb', line 23 def test_ngram_size3 timer = Time.now text = "This body of text contains something like ventricular septal defect" = $tagger.execute( text ) assert_equal ['ventricular septal defect'], puts "Duration: #{Time.now - timer} sec" end |