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.crcadmium/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
-
.get(offset : Int32, pos : Lemma::POS)
Create a
Synset
by offset and pos -
.lookup(word : String, pos : Lemma::POS)
Find a lemma for a given word and pos.
-
.lookup(word : String)
Find all lemmas for this word across all known parts of speech
-
.morphy(form : String, pos : Lemma::POS)
Get the root of a form with a specific pos
-
.morphy(form : String)
Get the root of a form
-
.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.
-
.random(pos : Lemma::POS | Nil = nil, random : Random = Random.new)
Get a random synset, optionally with a specific pos
Class Method Detail
Find a lemma for a given word and pos. Valid parts of speech are: :adj, :adv, :noun, :verb. Additionally, you can use the shorthand
Find a random lemma with the given part of speech and min/max size.
Get a random synset, optionally with a specific pos