class Eiwa::Tag::Meaning

Attributes

antonyms[R]
comments[R]
cross_references[R]
definitions[R]
dialects[R]
fields[R]
misc_tags[R]
parts_of_speech[R]
restricted_to_readings[R]
restricted_to_spellings[R]
source_languages[R]

Public Class Methods

new() click to toggle source
# File lib/eiwa/tag/meaning.rb, line 8
def initialize
  @parts_of_speech = []
  @definitions = []
  @misc_tags = []
  @cross_references = []
  @restricted_to_readings = []
  @restricted_to_spellings = []
  @antonyms = []
  @fields = []
  @source_languages = []
  @dialects = []
  @comments = []
end

Public Instance Methods

end_child(child) click to toggle source
# File lib/eiwa/tag/meaning.rb, line 22
def end_child(child)
  case child.tag_name
  when "pos"
    @parts_of_speech << child
  when "gloss"
    @definitions << child
  when "misc"
    @misc_tags << child
  when "field"
    @fields << child
  when "xref"
    @cross_references << child
  when "ant"
    @antonyms << child
  when "stagr"
    @restricted_to_readings << child.characters
  when "stagk"
    @restricted_to_spellings << child.characters
  when "lsource"
    @source_languages << child
  when "dial"
    @dialects << child
  when "s_inf"
    @comments << child.characters
  end
end
trickle_down(previous) click to toggle source
# File lib/eiwa/tag/meaning.rb, line 49
def trickle_down(previous)
  @parts_of_speech = previous.parts_of_speech if @parts_of_speech.empty?
  @misc_tags = previous.misc_tags if @misc_tags.empty?
end