class Lingo::Language::WordForm

Die Klasse WordForm ist die Basisklasse für weitere Klassen, die im Rahmen der Objektstruktur eines Wortes benötigt werden. Die Klasse stellt eine Zeichenkette bereit, die mit einem Attribut versehen werden kann.

Attributes

attr[RW]
form[RW]

Public Class Methods

new(form, attr = '-') click to toggle source
# File lib/lingo/language/word_form.rb, line 40
def initialize(form, attr = '-')
  @form, @attr = form || '', attr || ''
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/lingo/language/word_form.rb, line 52
def <=>(other)
  other.nil? ? 1 : to_a <=> other.to_a
end
==(other) click to toggle source
Alias for: eql?
eql?(other) click to toggle source
# File lib/lingo/language/word_form.rb, line 72
def eql?(other)
  self.class.equal?(other.class) && (self <=> other) == 0
end
Also aliased as: ==
hash() click to toggle source
# File lib/lingo/language/word_form.rb, line 68
def hash
  to_s.hash
end
identified?() click to toggle source
# File lib/lingo/language/word_form.rb, line 48
def identified?
  attr == WA_IDENTIFIED
end
inspect() click to toggle source
# File lib/lingo/language/word_form.rb, line 64
def inspect
  to_s
end
to_a() click to toggle source
# File lib/lingo/language/word_form.rb, line 56
def to_a
  [form, attr]
end
to_s() click to toggle source
# File lib/lingo/language/word_form.rb, line 60
def to_s
  to_a.join('/')
end
unknown?() click to toggle source
# File lib/lingo/language/word_form.rb, line 44
def unknown?
  [WA_UNKNOWN, WA_UNKMULPART].include?(attr)
end