def parse(date_str, allow_interval = false)
      str = preprocess(date_str.dup)
      date = parse_interval(str) if allow_interval
      date ||= parse_m_d_y(str)
      date ||= Date.edtf(str.gsub('.', '-'))
      date ||= partial_edtf(str)
      date ||= decade_hyphen(str)
      date ||= month_year(str)
      date ||= decade_s(str)
      date ||= hyphenated_partial_range(str)
      date ||= parse_date(str)
      # Only do this if certian letters are present to avoid infinite loops.
      date ||= circa(str) if str.match(/[circabout]/i)
      date = date.first if date.is_a? EDTF::Set
      date || nil
    end
def parse(date_str, allow_interval = false)
      str = preprocess(date_str.dup)
      date = parse_interval(str) if allow_interval
      date ||= parse_m_d_y(str)
      date ||= Date.edtf(str.gsub('.', '-'))
      date ||= partial_edtf(str)
      date ||= decade_hyphen(str)
      date ||= month_year(str)
      date ||= decade_s(str)
      date ||= hyphenated_partial_range(str)
      date ||= parse_date(str)
      # Only do this if certian letters are present to avoid infinite loops.
      date ||= circa(str) if str.match(/[circabout]/i)
      date = date.first if date.is_a? EDTF::Set
      date || nil
    end
Attempts to parse a string into a valid EDTF or `Date` format.

   - Attempts to split `#providedLabel` on '-', '/', '..', 'to', 'until', and
     looks for EDTF and `Date.parse` patterns on either side, setting them to
     `#begin` and `#end`. Both split and unsplit dates are parsed as follows:
   - Attempts to parse `#providedLabel` as an EDTF interval and populates
     begin and end with their respective values.
   - Attempts to match to a number of regular expressions which specify
     ranges informally.
   - Attempts to parse `#providedLabel` as a single date value with
     `Date.parse` and enters that value to both `#begin` and `#end`.

 @param date_str [String] a string which may contain a date range
 @param allow_interval [Boolean] a flag specifing whethe to use
   #range_match to look for range values.

 @return [Date, EDTF::Epoch, EDTF::Interval, nil] the date parsed or nil
 @see http://www.loc.gov/standards/datetime/