lib/emendate/lexer.rb
# ambiguous things
# c - at beginning = circa, at end = century
# nd - if directly after number, ordinal indicator; otherwise unknown date. normalize_orig attempts
#      to clear this up for most cases.
ambiguous things
c - at beginning = circa, at end = century
nd - if directly after number, ordinal indicator; otherwise unknown date. normalize_orig attempts
to clear this up for most cases.
ambiguous things c - at beginning = circa at end = century nd - if directly after number ordinal indicator ; otherwise unknown date . normalize_orig attempts to clear this up for most cases .
def letter_type(lexeme)
      if AFTER.include?(lexeme)
        :after
      elsif AND.include?(lexeme)
        :and
      elsif BEFORE.include?(lexeme)
        :before
      elsif CENTURY.include?(lexeme)
        :century
      elsif CIRCA.include?(lexeme)
        :approximate
      elsif DAYS.include?(lexeme)
        :day_of_week_alpha
      elsif ERA.include?(lexeme)
        :era
      elsif PARTIAL.include?(lexeme)
        :partial
      elsif MONTHS.include?(lexeme)
        :month_alpha
      elsif MONTH_ABBREVS.include?(lexeme)
        :month_abbr_alpha
      elsif OR_INDICATOR.include?(lexeme)
        :or
      elsif ORDINAL_INDICATOR.include?(lexeme)
        :ordinal_indicator
      elsif RANGE_INDICATOR.include?(lexeme)
        :range_indicator
      elsif SEASONS.include?(lexeme)
        :season
      elsif UNKNOWN_DATE.include?(lexeme)
        :unknown_date
      elsif lexeme.match?(/^x+$/)
        :uncertainty_digits
      elsif lexeme.match?(/^u+$/)
        :uncertainty_digits
      elsif lexeme == 'c'
        :letter_c
      elsif lexeme == 'e'
        :letter_e
      elsif lexeme == 's'
        :letter_s
      elsif lexeme == 't'
        :letter_t
      elsif lexeme == 'y'
        :letter_y
      elsif lexeme == 'z'
        :letter_z
      else
        :unknown
      end
    end
def letter_type ( lexeme ) if AFTER . include? ( lexeme ) :after elsif AND . include? ( lexeme ) :and elsif BEFORE . include? ( lexeme ) :before elsif CENTURY . include? ( lexeme ) :century elsif CIRCA . include? ( lexeme ) :approximate elsif DAYS . include? ( lexeme ) :day_of_week_alpha elsif ERA . include? ( lexeme ) :era elsif PARTIAL . include? ( lexeme ) :partial elsif MONTHS . include? ( lexeme ) :month_alpha elsif MONTH_ABBREVS . include? ( lexeme ) :month_abbr_alpha elsif OR_INDICATOR . include? ( lexeme ) :or elsif ORDINAL_INDICATOR . include? ( lexeme ) :ordinal_indicator elsif RANGE_INDICATOR . include? ( lexeme ) :range_indicator elsif SEASONS . include? ( lexeme ) :season elsif UNKNOWN_DATE . include? ( lexeme ) :unknown_date elsif lexeme . match? ( / ^x+$ / ) :uncertainty_digits elsif lexeme . match? ( / ^u+$ / ) :uncertainty_digits elsif lexeme == 'c' :letter_c elsif lexeme == 'e' :letter_e elsif lexeme == 's' :letter_s elsif lexeme == 't' :letter_t elsif lexeme == 'y' :letter_y elsif lexeme == 'z' :letter_z else :unknown end end
ambiguous things
c - at beginning = circa, at end = century
nd - if directly after number, ordinal indicator; otherwise unknown date.
ambiguous things c - at beginning = circa at end = century nd - if directly after number ordinal indicator ; otherwise unknown date .
lexeme
<not_specific>