module Cadmium::Wordnet

Overview

API to grant full access to the Stanford Wordnet project allowing you to find words, definitions (gloss), hypernyms, hyponyms, antonyms, etc.

Defined in:

cadmium/wordnet.cr
cadmium/wordnet/db.cr
cadmium/wordnet/lemma.cr
cadmium/wordnet/pointer.cr
cadmium/wordnet/pointers.cr
cadmium/wordnet/synset.cr

Constant Summary

ADJECTIVE_POINTERS = {";r" => "Domain of synset - REGION", "!" => "Antonym", "\\" => "Pertainym (pertains to noun)", "<" => "Participle of verb", "&" => "Similar to", "=" => "Attribute", ";c" => "Domain of synset - TOPIC"}

Valid pointer symbols for adjectives

ADVERB_POINTERS = {";r" => "Domain of synset - REGION", "!" => "Antonym", ";u" => "Domain of synset - USAGE", "\\" => "Derived from adjective", ";c" => "Domain of synset - TOPIC"}

Valid pointer symbols for adverbs

NOUN_POINTERS = {"-c" => "Member of this domain - TOPIC", "+" => "Derivationally related form", "%p" => "Part meronym", "~i" => "Instance Hyponym", "@" => "Hypernym", ";r" => "Domain of synset - REGION", "!" => "Antonym", "#p" => "Part holonym", "%s" => "Substance meronym", ";u" => "Domain of synset - USAGE", "-r" => "Member of this domain - REGION", "#s" => "Substance holonym", "=" => "Attribute", "-u" => "Member of this domain - USAGE", ";c" => "Domain of synset - TOPIC", "%m" => "Member meronym", "~" => "Hyponym", "@i" => "Instance Hypernym", "#m" => "Member holonym"}

Valid pointer synbols for nouns

VERB_POINTERS = {"+" => "Derivationally related form", "@" => "Hypernym", ";r" => "Domain of synset - REGION", "!" => "Antonym", ";u" => "Domain of synset - USAGE", "$" => "Verb Group", ";c" => "Domain of synset - TOPIC", ">" => "Cause", "~" => "Hyponym", "*" => "Entailment"}

Valid pointer symbols for verbs

Class Method Summary

Class Method Detail

def self.get(offset : Int32, pos : Lemma::POS) #

Create a Synset by offset and pos


[View source]
def self.lookup(word : String, pos : Lemma::POS) #

Find a lemma for a given word and pos. Valid parts of speech are: :adj, :adv, :noun, :verb. Additionally, you can use the shorthand


[View source]
def self.lookup(word : String) #

Find all lemmas for this word across all known parts of speech


[View source]
def self.morphy(form : String, pos : Lemma::POS) #

Get the root of a form with a specific pos


[View source]
def self.morphy(form : String) #

Get the root of a form


[View source]
def self.random(pos : Lemma::POS | Nil = nil, min : Int32 | Nil = nil, max : Int32 | Nil = nil, random : Random = Random.new) #

Find a random lemma with the given part of speech and min/max size.


[View source]
def self.random(pos : Lemma::POS | Nil = nil, random : Random = Random.new) #

Get a random synset, optionally with a specific pos


[View source]