class Lingo::Language::Lexical

Die Klasse Lexical, abgeleitet von der Klasse WordForm, stellt den Container für eine Grundform eines Wortes bereit, welches mit der Wortklasse versehen ist.

Wird z.B. aus dem Wörterbuch eine Grundform gelesen, so wird dies in Form eines Lexical-Objektes zurückgegeben, z.B. Lexical.new(‘Rennen’, ‘S’) -> (rennen/s)

Public Instance Methods

<=>(other) click to toggle source
# File lib/lingo/language/lexical.rb, line 38
def <=>(other)
  return 1 unless other.is_a?(self.class)

  a1, a2 = attr, other.attr

  if a1 == a2
    form <=> other.form
  else
    a1.empty? ? 1 : a2.empty? ? -1 : begin
      i1, i2 = [a1, a2].map(&LA_SORTORDER.method(:index))
      i1 ? i2 ? i2 <=> i1 : -1 : i2 ? 1 : a1 <=> a2
    end
  end
end
to_s() click to toggle source
# File lib/lingo/language/lexical.rb, line 57
def to_s
  "(#{super})"
end
to_str() click to toggle source
# File lib/lingo/language/lexical.rb, line 53
def to_str
  to_a.join('#')
end