Sha256: d500252cb83e1e36001b36f8b9e9ea55131886bc52c24c802cdb9d1a93978f26

Contents?: true

Size: 649 Bytes

Versions: 4

Compression:

Stored size: 649 Bytes

Contents

require "rubygems" # import gem package manager
gem "hunspell"     # load Hunspell module
require "Hunspell" # inject Hunspell class to Ruby namespace

# instantiate Hunspell with Hungarian affix and dictionary files
#
sp = Hunspell.new("hu.aff", "hu.dic") 

# spell check Hungarian word 'ablak' (window) => true
#
puts "Is 'ablak' correct? #{sp.spellcheck('ablak')}"

# get suggestions for mispelled word 'paprika'
#   => ["kaprica", "patrica", "paprika", "papcica",
#       "papráca", "papruca", "paprima", "paprikáz",
#       "paprikása", "paprikás", "Papradnó"
#      ]
#
puts "Suggestions for 'paprica': " + sp.suggest("paprica").inspect

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hunspell-0.1.4 example.rb
hunspell-0.1.2 example.rb
hunspell-0.1 example.rb
hunspell-0.1.1 example.rb