Displaying 1 result from an estimated 1 matches for "get_synonyms".
2007 Jul 07
2
Extending/Modifying QueryParser
...m.text = text
end
def next
return @synonym_stack.pop if @synonym_stack.size > 0
if token = @token_stream.next
add_synonyms_to_stack(token) unless token.nil?
end
return token
end
private
def add_synonyms_to_stack(token)
synonyms = @synonym_engine.get_synonyms(token.text)
return if synonyms.nil?
synonyms.each do |s|
@synonym_stack.push(
Token.new(s, token.start, token.end, 0))
end
end
end
FInally a WordnetSynonymEngine that queries my wordnet index I created:
class WordnetSynonymEngine
include Ferret::Search
d...