0.0
No commit activity in last 3 years
No release in over 3 years
a simple program for suggest or spellcheck keyword use trie tree
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

suggest

a simple program for suggest or spellcheck keyword use trie tree

How to use

  • install depends gem
gem install natto
gem install romaji
gem install activesupport
  • install trie suggest
gem install trie_suggest
  • add keyword data
require 'trie_suggest'

data = trie_suggest.new
data.add_word('foo', 999)
data.add_word('bar', 666)
  .
  .
  .
  • suggest
# responcse will sort by score
data.suggest('f')
=> [["foo", 999]]
data.suggest('b')
=> [["bar", 666]]
  • spellcheck
data.spellcheck('foe')
=> [["foo", 999]]

Depends

  • natto
  • romaji

Trouble Shooting

  • MECAB_PATH error

    LoadError: Please set MECAB_PATH to the full path to libmecab.dylib
    
    sudo find /usr/ -name "libmecab*"
    export MECAB_PATH=you_libmecab_path
    
  • Function 'mecab_model_new2' not found

    brew install mecab
    brew install mecab-ipadic