Class: Mods::Date::CenturyFormat
- Inherits:
-
ExtractorDateFormat
- Object
- Mods::Date
- ExtractorDateFormat
- Mods::Date::CenturyFormat
- Defined in:
- lib/mods/date.rb
Overview
Full-text extractor for dates given as centuries
Constant Summary collapse
- REGEX =
/(?<century>\d{2})th C(entury)?/i
Instance Attribute Summary
Attributes inherited from Mods::Date
Class Method Summary collapse
Methods inherited from ExtractorDateFormat
Methods inherited from Mods::Date
#approximate?, #as_range, #encoding, #encoding?, #end?, from_element, #inferred?, #initialize, parse_date, #point, #qualifier, #questionable?, #single?, #start?, #text, #to_a, #type
Constructor Details
This class inherits a constructor from Mods::Date
Class Method Details
.cleanup(text) ⇒ Object
178 179 180 181 |
# File 'lib/mods/date.rb', line 178 def self.cleanup(text) matches = text.match(REGEX) "#{matches[:century].to_i - 1}XX" end |