class Cadmium::Wordnet::Lemma
- Cadmium::Wordnet::Lemma
- Reference
- Object
Defined in:
cadmium/wordnet/lemma.crConstant Summary
-
SPACE =
" "
Constructors
-
.new(lexicon_line : String, id : Int32)
Create a lemma from a line in an lexicon file.
Class Method Summary
-
.find(word : String, pos : POS)
Find a lemma for a given word and pos.
-
.find_all(word : String)
Find all lemmas for this word across all known parts of speech
-
.random(pos : POS | Nil = nil, min : Int32 | Nil = nil, max : Int32 | Nil = nil, random : Random = Random.new)
Find a random lemma
Instance Method Summary
-
#id : Int32
A unique integer id that references this lemma.
-
#pointer_symbols : Array(String)
An array of valid pointer symbols for this lemma.
-
#pos : POS
The part of speech (noun, verb, adjective) of this lemma.
-
#synset_offsets : Array(Int32)
The offset, in bytes, at which the synsets contained in this lemma are stored in Wordnet's internal database.
-
#synsets
Return a list of synsets for this Lemma.
-
#tagsense_count : Int32
The number of times the sense is tagged in various semantic concordance texts.
-
#to_s(io)
Returns a compact string representation of this lemma, e.g.
-
#word : String
The word this lemma represents
Constructor Detail
Create a lemma from a line in an lexicon file. You should not be creating Lemmas by hand; instead, use the Wordnet::Lemma.find and Wordnet::Lemma.find_all methods to find the Lemma for a word.
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 forms of each of these ("a", "r", "n", "v")/
Find a random lemma
Instance Method Detail
A unique integer id that references this lemma. Used internally within Wordnet's database.
An array of valid pointer symbols for this lemma. The list of all valid pointer symbols is defined in pointers.cr.
The offset, in bytes, at which the synsets contained in this lemma are stored in Wordnet's internal database.
Return a list of synsets for this Lemma. Each synset represents a different sense, or meaning, of the word.
The number of times the sense is tagged in various semantic concordance texts. A tagsense_count of 0 indicates that the sense has not been semantically tagged.
Returns a compact string representation of this lemma, e.g. "fall, v" for the verb form of the word "fall".