
现代信息检索
WNCBB2
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
信息检索作业
# -*- coding:utf-8 -*- require './stemmable.rb' #词干还原代码require './correct2.rb' #peter novig拼写检查代码class String include Stemmable #字符串类包含进 词干还原模块, 字符串可以使用stem函数进行词干还原endwordCou原创 2014-03-31 16:22:43 · 1209 阅读 · 0 评论 -
Peter Novig Spell Check http://norvig.com/spell-correct.html
def words text text.downcase.scan(/[a-z]+/)enddef train features model = Hash.new(1) features.each {|f| model[f] += 1 } return modelendNWORDS = train(words(File.new('holmes.txt').read))转载 2014-03-20 20:42:05 · 1105 阅读 · 0 评论 -
ruby porter词干还原算法 http://tartarus.org/martin/PorterStemmer/
#! /local/ruby/bin/ruby## $Id: stemmable.rb,v 1.2 2003/02/01 02:07:30 condit Exp $## See example usage at the end of this file.#module Stemmable STEP_2_LIST = { 'ational'=>'ate', 'tional转载 2014-03-18 17:47:48 · 1087 阅读 · 0 评论