小编Tay*_*orT的帖子

红宝石中简单的拼写检查方法/宝石?

我正在寻找一种相对快速的方法来检查单词是否拼写错误,无论是使用gem还是API.

我尝试过使用几种宝石 - raspell,ffi-aspell,hunspell-ffi,spell_cheker和spellchecker--每种都有不同的错误.

我对ruby很新,并希望有一个简单的解决方案(我正在处理大量的短文本文件,并且想要计算错误拼写的单词的百分比),这不包括从头开始构建的东西.

尝试ffi-aspell时,我收到以下错误:

/Users/ntaylorthompson/.rvm/gems/ruby-1.9.2-p320/gems/ffi-aspell-0.0.3/lib/ffi/aspell/speller.rb:121: [BUG] Segmentation fault
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-darwin11.4.0]

-- control frame ----------
c:0005 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC  :speller_check
c:0004 p:0113 s:0013 b:0013 l:000012 d:000012 METHOD /Users/ntaylorthompson/.rvm/gems/ruby-1.9.2-p320/gems/ffi-aspell-0.0.3/lib/ffi/aspell/speller.rb:121
c:0003 p:0049 s:0007 b:0007 l:0005a8 d:0005d0 EVAL   ffi-aspell_test.rb:5
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0005a8 d:0005a8 TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
ffi-aspell_test.rb:5:in `<main>'
/Users/ntaylorthompson/.rvm/gems/ruby-1.9.2-p320/gems/ffi-aspell-0.0.3/lib/ffi/aspell/speller.rb:121:in `correct?'
/Users/ntaylorthompson/.rvm/gems/ruby-1.9.2-p320/gems/ffi-aspell-0.0.3/lib/ffi/aspell/speller.rb:121:in `speller_check'

-- C level backtrace information -------------------------------------------

[NOTE]
You may …
Run Code Online (Sandbox Code Playgroud)

ruby spell-checking aspell spelling hunspell

9
推荐指数
1
解决办法
3996
查看次数

标签 统计

aspell ×1

hunspell ×1

ruby ×1

spell-checking ×1

spelling ×1