# File lib/perseus_match/token.rb, line 11 def initialize(form, wc = nil) @form = form.sub(WC_RE, '') @wc = wc || $1 super(@form) end
# File lib/perseus_match/token.rb, line 27 def ==(other) other.is_a?(self.class) ? form == other.form : form == other end
# File lib/perseus_match/token.rb, line 31 def eql?(other) self == other && wc == other.wc end
# File lib/perseus_match/token.rb, line 35 def inspect "#{super}/#{wc}" end
# File lib/perseus_match/token.rb, line 18 def match?(wcs) wcs = [*wcs].compact wcs.include?(wc) || wcs.include?(ANY_WC) end
# File lib/perseus_match/token.rb, line 23 def unk? wc == '?' end