class Chronic::Token

def get_tag(tag_class)

Returns The first Tag that matches the given class.

tag_class - The tag Class to search for.
def get_tag(tag_class)
  @tags.find { |m| m.kind_of? tag_class }
end

def initialize(word)

def initialize(word)
  @word = word
  @tags = []
end

def inspect

def inspect
  to_s
end

def tag(new_tag)

Returns nothing.

new_tag - The new Tag object.

Tag this token with the specified tag.
def tag(new_tag)
  @tags << new_tag
end

def tagged?

Returns true if this token has any tags.
def tagged?
  @tags.size > 0
end

def to_s

Print this Token in a pretty way
def to_s
  @word << '(' << @tags.join(', ') << ') '
end

def untag(tag_class)

Returns nothing.

tag_class - The tag Class to remove.

Remove all tags of the given class.
def untag(tag_class)
  @tags.delete_if { |m| m.kind_of? tag_class }
end