class Lingo::Attendee::Abbreviator

Public Instance Methods

control(cmd, *) click to toggle source
# File lib/lingo/attendee/abbreviator.rb, line 80
def control(cmd, *)
  send_abbr(@abbr) if [:RECORD, :EOF].include?(cmd)
end
init() click to toggle source
# File lib/lingo/attendee/abbreviator.rb, line 75
def init
  set_dic
  @abbr = nil
end
process(obj) click to toggle source
# File lib/lingo/attendee/abbreviator.rb, line 84
def process(obj)
  if obj.is_a?(Token)
    if obj.form == CHAR_PUNCT
      if @abbr && (abbr = find_word(form = @abbr.form)).identified?
        form << CHAR_PUNCT unless form.end_with?(CHAR_PUNCT)
        send_abbr(abbr)
      else
        send_abbr(@abbr)
        forward(obj)
      end
    else
      send_abbr(@abbr, obj)
    end
  else
    send_abbr(obj)
  end
end

Private Instance Methods

send_abbr(abbr, obj = nil) click to toggle source
# File lib/lingo/attendee/abbreviator.rb, line 104
def send_abbr(abbr, obj = nil)
  @abbr = obj
  forward(abbr) if abbr
end