Sha256: 1f03ed8e4f51fc7ce8b9969d97d8de2ab909cad9c3fc1b18f435fb4f2d65aca5

Contents?: true

Size: 601 Bytes

Versions: 3

Compression:

Stored size: 601 Bytes

Contents

require 'test/unit'
require "Hunspell"

class HunspellTest < Test::Unit::TestCase
  def setup
    @sp = Hunspell.new("test/dict/hu_HU.aff", "test/dict/hu_HU.dic")
  end

  def test_spellcheck
    assert @sp.spellcheck('ablak')
  end

  def test_false_spellcheck
    assert !@sp.spellcheck("paprica")
  end

  def test_suggestions
    assert !@sp.spellcheck('paprica')

    suggestions = @sp.suggest("paprica")
    assert !suggestions.include?('paprica')
    assert suggestions.include?('paprika')
  end

  def test_analyze
    assert @sp.analyze('paprika') == [" st:paprika po:noun ts:NOM"]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hunspell-1.1.0 test/test_hunspell.rb
hunspell-1.0.0 test/test_hunspell.rb
hunspell-0.1.7 test/test_hunspell.rb