<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/numerizer/numerizer.rb</filename>
    </added>
    <added>
      <filename>test/test_Numerizer.rb</filename>
    </added>
    <added>
      <filename>test/test_Time.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,8 @@
+= 0.2.0 2007-03-20
+
+* fixed time overflow issue
+* implemented numerizer, allowing the use of number words (e.g. five weeks ago) (thanks shalev!)
+
 = 0.1.6 2006-01-15
 
 * added 'weekend' support (eventualbuddha)</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -26,10 +26,11 @@ lib/chronic/repeaters/repeater_weekend.rb
 lib/chronic/repeaters/repeater_year.rb
 lib/chronic/scalar.rb
 lib/chronic/separator.rb
-test/parse_numbers.rb
+lib/numerizer/numerizer.rb
 test/suite.rb
 test/test_Chronic.rb
 test/test_Handler.rb
+test/test_Numerizer.rb
 test/test_RepeaterDayName.rb
 test/test_RepeaterFortnight.rb
 test/test_RepeaterHour.rb
@@ -37,6 +38,7 @@ test/test_RepeaterMonth.rb
 test/test_RepeaterMonthName.rb
 test/test_RepeaterTime.rb
 test/test_RepeaterWeek.rb
+test/test_RepeaterWeekend.rb
 test/test_RepeaterYear.rb
 test/test_Span.rb
 test/test_Token.rb</diff>
      <filename>Manifest.txt</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,8 @@ require './lib/chronic.rb'
 Hoe.new('chronic', Chronic::VERSION) do |p|
   p.rubyforge_name = 'chronic'
   p.summary = 'A natural language date parser'
+  p.author = 'Tom Preston-Werner'
+  p.email = 'tom@rubyisawesome.com'
   p.description = p.paragraphs_of('README.txt', 2).join(&quot;\n\n&quot;)
   p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
   p.changes = p.paragraphs_of('History.txt', 0..1).join(&quot;\n\n&quot;)
@@ -14,28 +16,4 @@ Hoe.new('chronic', Chronic::VERSION) do |p|
   p.extra_deps = []
 end
 
-# vim: syntax=Ruby
-
-__END__
-
-require 'rubygems'
-
-SPEC = Gem::Specification.new do |s|
-  s.name = 'chronic'
-  s.version = '0.1.5'
-  s.author = 'Tom Preston-Werner'
-  s.email = 'tom@rubyisawesome.com'
-  s.homepage = 'http://chronic.rubyforge.org'
-  s.platform = Gem::Platform::RUBY
-  s.summary = &quot;A natural language date parser&quot;
-  candidates = Dir[&quot;{lib,test}/**/*&quot;]
-  s.files = candidates.delete_if do |item|
-    item.include?('.svn')
-  end
-  s.require_path = &quot;lib&quot;
-  s.autorequire = &quot;chronic&quot;
-  s.test_file = &quot;test/suite.rb&quot;
-  s.has_rdoc = true
-  s.extra_rdoc_files = ['README']
-  s.rdoc_options &lt;&lt; '--main' &lt;&lt; 'README'
-end
\ No newline at end of file
+# vim: syntax=Ruby
\ No newline at end of file</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,8 @@
 #
 #=============================================================================
 
+$:.unshift File.dirname(__FILE__)     # For use/testing when no gem is installed
+
 require 'chronic/chronic'
 require 'chronic/handlers'
 
@@ -33,8 +35,10 @@ require 'chronic/scalar'
 require 'chronic/ordinal'
 require 'chronic/separator'
 
+require 'numerizer/numerizer'
+
 module Chronic
-  VERSION = &quot;0.1.6&quot;
+  VERSION = &quot;0.2.0&quot;
   
   def self.debug; false; end
 end
@@ -44,4 +48,50 @@ alias p_orig p
 def p(val)
   p_orig val
   puts
+end
+
+class Time
+  def self.construct(year, month = 1, day = 1, hour = 0, minute = 0, second = 0)
+    if second &gt;= 60
+      minute += second / 60
+      second = second % 60
+    end
+    
+    if minute &gt;= 60
+      hour += minute / 60
+      minute = minute % 60
+    end
+    
+    if hour &gt;= 24
+      day += hour / 24
+      hour = hour % 24
+    end
+    
+    # determine if there is a day overflow. this is complicated by our crappy calendar
+    # system (non-constant number of days per month)
+    day &lt;= 56 || raise(&quot;day must be no more than 56 (makes month resolution easier)&quot;)
+    if day &gt; 28
+      # no month ever has fewer than 28 days, so only do this if necessary
+      leap_year = (year % 4 == 0) &amp;&amp; !(year % 100 == 0)
+      leap_year_month_days = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+      common_year_month_days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+      days_this_month = leap_year ? leap_year_month_days[month - 1] : common_year_month_days[month - 1]
+      if day &gt; days_this_month
+        month += day / days_this_month
+        day = day % days_this_month
+      end
+    end
+    
+    if month &gt; 12
+      if month % 12 == 0
+        year += (month - 12) / 12
+        month = 12
+      else
+        year += month / 12
+        month = month % 12
+      end
+    end
+    
+    Time.local(year, month, day, hour, minute, second)
+  end
 end
\ No newline at end of file</diff>
      <filename>lib/chronic.rb</filename>
    </modified>
    <modified>
      <diff>@@ -101,6 +101,7 @@ module Chronic
     # ordinals (third =&gt; 3rd)
     def pre_normalize(text) #:nodoc:
       normalized_text = text.to_s.downcase
+      normalized_text = numericize_numbers(normalized_text)
       normalized_text.gsub!(/['&quot;\.]/, '')
       normalized_text.gsub!(/([\/\-\,\@])/) { ' ' + $1 + ' ' }
       normalized_text.gsub!(/\btoday\b/, 'this day')
@@ -118,15 +119,12 @@ module Chronic
       normalized_text.gsub!(/\btonight\b/, 'this night')
       normalized_text.gsub!(/(?=\w)([ap]m|oclock)\b/, ' \1')
       normalized_text.gsub!(/\b(hence|after|from)\b/, 'future')
-      normalized_text.gsub!(/\ba\b/, '1')
-      normalized_text.gsub!(/\s+/, ' ')
-      normalized_text = numericize_numbers(normalized_text)
       normalized_text = numericize_ordinals(normalized_text)
     end
   
     # Convert number words to numbers (three =&gt; 3)
     def numericize_numbers(text) #:nodoc:
-      text
+      Numerizer.numerize(text)
     end
   
     # Convert ordinal words to numeric ordinals (third =&gt; 3rd)</diff>
      <filename>lib/chronic/chronic.rb</filename>
    </modified>
    <modified>
      <diff>@@ -214,17 +214,19 @@ module Chronic
     def handle_s_r_p(tokens, options) #:nodoc:
       repeater = tokens[1].get_tag(Repeater)
             
-      span = 
-      case true
-      when [RepeaterYear, RepeaterSeason, RepeaterSeasonName, RepeaterMonth, RepeaterMonthName, RepeaterFortnight, RepeaterWeek].include?(repeater.class)
-        self.parse(&quot;this hour&quot;, :guess =&gt; false, :now =&gt; @now)
-      when [RepeaterWeekend, RepeaterDay, RepeaterDayName, RepeaterDayPortion, RepeaterHour].include?(repeater.class)
-        self.parse(&quot;this minute&quot;, :guess =&gt; false, :now =&gt; @now)
-      when [RepeaterMinute, RepeaterSecond].include?(repeater.class)
-        self.parse(&quot;this second&quot;, :guess =&gt; false, :now =&gt; @now)
-      else
-        raise(ChronicPain, &quot;Invalid repeater: #{repeater.class}&quot;)
-      end
+      # span = 
+      # case true
+      # when [RepeaterYear, RepeaterSeason, RepeaterSeasonName, RepeaterMonth, RepeaterMonthName, RepeaterFortnight, RepeaterWeek].include?(repeater.class)
+      #   self.parse(&quot;this hour&quot;, :guess =&gt; false, :now =&gt; @now)
+      # when [RepeaterWeekend, RepeaterDay, RepeaterDayName, RepeaterDayPortion, RepeaterHour].include?(repeater.class)
+      #   self.parse(&quot;this minute&quot;, :guess =&gt; false, :now =&gt; @now)
+      # when [RepeaterMinute, RepeaterSecond].include?(repeater.class)
+      #   self.parse(&quot;this second&quot;, :guess =&gt; false, :now =&gt; @now)
+      # else
+      #   raise(ChronicPain, &quot;Invalid repeater: #{repeater.class}&quot;)
+      # end
+      
+      span = self.parse(&quot;this second&quot;, :guess =&gt; false, :now =&gt; @now)
       
       self.handle_srp(tokens, span, options)
     end</diff>
      <filename>lib/chronic/handlers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,9 +10,9 @@ module Chronic
     end
   
     def self.scan_for_all(token)
-      scanner = {/past/ =&gt; :past,
-                 /future/ =&gt; :future,
-                 /in/ =&gt; :future}
+      scanner = {/\bpast\b/ =&gt; :past,
+                 /\bfuture\b/ =&gt; :future,
+                 /\bin\b/ =&gt; :future}
       scanner.keys.each do |scanner_item|
         return self.new(scanner[scanner_item]) if scanner_item =~ token.word
       end</diff>
      <filename>lib/chronic/pointer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,14 +19,14 @@ class Chronic::RepeaterDay &lt; Chronic::Repeater #:nodoc:
     
     case pointer
     when :future
-      day_begin = Time.local(@now.year, @now.month, @now.day, @now.hour + 1)
-      day_end = Time.local(@now.year, @now.month, @now.day) + DAY_SECONDS
+      day_begin = Time.construct(@now.year, @now.month, @now.day, @now.hour + 1)
+      day_end = Time.construct(@now.year, @now.month, @now.day) + DAY_SECONDS
     when :past
-      day_begin = Time.local(@now.year, @now.month, @now.day)
-      day_end = Time.local(@now.year, @now.month, @now.day, @now.hour)
+      day_begin = Time.construct(@now.year, @now.month, @now.day)
+      day_end = Time.construct(@now.year, @now.month, @now.day, @now.hour)
     when :none
-      day_begin = Time.local(@now.year, @now.month, @now.day)
-      day_end = Time.local(@now.year, @now.month, @now.day) + DAY_SECONDS
+      day_begin = Time.construct(@now.year, @now.month, @now.day)
+      day_end = Time.construct(@now.year, @now.month, @now.day) + DAY_SECONDS
     end
     
     Chronic::Span.new(day_begin, day_end)</diff>
      <filename>lib/chronic/repeaters/repeater_day.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ class Chronic::RepeaterDayName &lt; Chronic::Repeater #:nodoc:
     direction = pointer == :future ? 1 : -1
     
     if !@current_day_start
-      @current_day_start = Time.local(@now.year, @now.month, @now.day)
+      @current_day_start = Time.construct(@now.year, @now.month, @now.day)
       @current_day_start += direction * DAY_SECONDS
 
       day_num = symbol_to_number(@type)</diff>
      <filename>lib/chronic/repeaters/repeater_day_name.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,27 +28,27 @@ class Chronic::RepeaterDayPortion &lt; Chronic::Repeater #:nodoc:
     full_day = 60 * 60 * 24
     
     if !@current_span
-      now_seconds = @now - Time.local(@now.year, @now.month, @now.day)
+      now_seconds = @now - Time.construct(@now.year, @now.month, @now.day)
       if now_seconds &lt; @range.begin
         case pointer
         when :future
-          range_start = Time.local(@now.year, @now.month, @now.day) + @range.begin
+          range_start = Time.construct(@now.year, @now.month, @now.day) + @range.begin
         when :past
-          range_start = Time.local(@now.year, @now.month, @now.day) - full_day + @range.begin
+          range_start = Time.construct(@now.year, @now.month, @now.day) - full_day + @range.begin
         end
       elsif now_seconds &gt; @range.end
         case pointer
         when :future
-          range_start = Time.local(@now.year, @now.month, @now.day) + full_day + @range.begin
+          range_start = Time.construct(@now.year, @now.month, @now.day) + full_day + @range.begin
         when :past
-          range_start = Time.local(@now.year, @now.month, @now.day) + @range.begin
+          range_start = Time.construct(@now.year, @now.month, @now.day) + @range.begin
         end
       else
         case pointer
         when :future
-          range_start = Time.local(@now.year, @now.month, @now.day) + full_day + @range.begin
+          range_start = Time.construct(@now.year, @now.month, @now.day) + full_day + @range.begin
         when :past
-          range_start = Time.local(@now.year, @now.month, @now.day) - full_day + @range.begin
+          range_start = Time.construct(@now.year, @now.month, @now.day) - full_day + @range.begin
         end
       end
       
@@ -66,7 +66,7 @@ class Chronic::RepeaterDayPortion &lt; Chronic::Repeater #:nodoc:
   def this(context = :future)
     super
     
-    range_start = Time.local(@now.year, @now.month, @now.day) + @range.begin
+    range_start = Time.construct(@now.year, @now.month, @now.day) + @range.begin
     @current_span = Chronic::Span.new(range_start, range_start + (@range.end - @range.begin))
   end
   </diff>
      <filename>lib/chronic/repeaters/repeater_day_portion.rb</filename>
    </modified>
    <modified>
      <diff>@@ -33,7 +33,7 @@ class Chronic::RepeaterFortnight &lt; Chronic::Repeater #:nodoc:
     
     case pointer
     when :future
-      this_fortnight_start = Time.local(@now.year, @now.month, @now.day, @now.hour) + Chronic::RepeaterHour::HOUR_SECONDS
+      this_fortnight_start = Time.construct(@now.year, @now.month, @now.day, @now.hour) + Chronic::RepeaterHour::HOUR_SECONDS
       sunday_repeater = Chronic::RepeaterDayName.new(:sunday)
       sunday_repeater.start = @now
       sunday_repeater.this(:future)
@@ -41,7 +41,7 @@ class Chronic::RepeaterFortnight &lt; Chronic::Repeater #:nodoc:
       this_fortnight_end = this_sunday_span.begin
       Chronic::Span.new(this_fortnight_start, this_fortnight_end)
     when :past
-      this_fortnight_end = Time.local(@now.year, @now.month, @now.day, @now.hour)
+      this_fortnight_end = Time.construct(@now.year, @now.month, @now.day, @now.hour)
       sunday_repeater = Chronic::RepeaterDayName.new(:sunday)
       sunday_repeater.start = @now
       last_sunday_span = sunday_repeater.next(:past)</diff>
      <filename>lib/chronic/repeaters/repeater_fortnight.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,9 +7,9 @@ class Chronic::RepeaterHour &lt; Chronic::Repeater #:nodoc:
     if !@current_hour_start
       case pointer
       when :future
-        @current_hour_start = Time.local(@now.year, @now.month, @now.day, @now.hour + 1)
+        @current_hour_start = Time.construct(@now.year, @now.month, @now.day, @now.hour + 1)
       when :past
-        @current_hour_start = Time.local(@now.year, @now.month, @now.day, @now.hour - 1)
+        @current_hour_start = Time.construct(@now.year, @now.month, @now.day, @now.hour - 1)
       end
     else
       direction = pointer == :future ? 1 : -1
@@ -24,13 +24,13 @@ class Chronic::RepeaterHour &lt; Chronic::Repeater #:nodoc:
     
     case pointer
     when :future
-      hour_start = Time.local(@now.year, @now.month, @now.day, @now.hour, @now.min + 1)
-      hour_end = Time.local(@now.year, @now.month, @now.day, @now.hour + 1)
+      hour_start = Time.construct(@now.year, @now.month, @now.day, @now.hour, @now.min + 1)
+      hour_end = Time.construct(@now.year, @now.month, @now.day, @now.hour + 1)
     when :past
-      hour_start = Time.local(@now.year, @now.month, @now.day, @now.hour)
-      hour_end = Time.local(@now.year, @now.month, @now.day, @now.hour, @now.min)
+      hour_start = Time.construct(@now.year, @now.month, @now.day, @now.hour)
+      hour_end = Time.construct(@now.year, @now.month, @now.day, @now.hour, @now.min)
     when :none
-      hour_start = Time.local(@now.year, @now.month, @now.day, @now.hour)
+      hour_start = Time.construct(@now.year, @now.month, @now.day, @now.hour)
       hour_end = hour_begin + HOUR_SECONDS
     end
     </diff>
      <filename>lib/chronic/repeaters/repeater_hour.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,13 +15,13 @@ class Chronic::RepeaterMinute &lt; Chronic::Repeater #:nodoc:
     case pointer
     when :future
       minute_begin = @now
-      minute_end = Time.local(@now.year, @now.month, @now.day, @now.hour, @now.min)
+      minute_end = Time.construct(@now.year, @now.month, @now.day, @now.hour, @now.min)
     when :past
-      minute_begin = Time.local(@now.year, @now.month, @now.day, @now.hour, @now.min)
+      minute_begin = Time.construct(@now.year, @now.month, @now.day, @now.hour, @now.min)
       minute_end = @now
     when :none
-      minute_begin = Time.local(@now.year, @now.month, @now.day, @now.hour, @now.min)
-      minute_end = Time.local(@now.year, @now.month, @now.day, @now.hour, @now.min) + MINUTE_SECONDS
+      minute_begin = Time.construct(@now.year, @now.month, @now.day, @now.hour, @now.min)
+      minute_end = Time.construct(@now.year, @now.month, @now.day, @now.hour, @now.min) + MINUTE_SECONDS
     end
     
     Chronic::Span.new(minute_begin, minute_end)</diff>
      <filename>lib/chronic/repeaters/repeater_minute.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,12 +6,12 @@ class Chronic::RepeaterMonth &lt; Chronic::Repeater #:nodoc:
     super
     
     if !@current_month_start
-      @current_month_start = offset_by(Time.local(@now.year, @now.month), 1, pointer)
+      @current_month_start = offset_by(Time.construct(@now.year, @now.month), 1, pointer)
     else
-      @current_month_start = offset_by(Time.local(@current_month_start.year, @current_month_start.month), 1, pointer)
+      @current_month_start = offset_by(Time.construct(@current_month_start.year, @current_month_start.month), 1, pointer)
     end
     
-    Chronic::Span.new(@current_month_start, Time.local(@current_month_start.year, @current_month_start.month + 1))
+    Chronic::Span.new(@current_month_start, Time.construct(@current_month_start.year, @current_month_start.month + 1))
   end
   
   def this(pointer = :future)
@@ -19,14 +19,14 @@ class Chronic::RepeaterMonth &lt; Chronic::Repeater #:nodoc:
     
     case pointer
     when :future
-      month_start = Time.local(@now.year, @now.month, @now.day + 1)
-      month_end = self.offset_by(Time.local(@now.year, @now.month), 1, :future)
+      month_start = Time.construct(@now.year, @now.month, @now.day + 1)
+      month_end = self.offset_by(Time.construct(@now.year, @now.month), 1, :future)
     when :past
-      month_start = Time.local(@now.year, @now.month)
-      month_end = Time.local(@now.year, @now.month, @now.day)
+      month_start = Time.construct(@now.year, @now.month)
+      month_end = Time.construct(@now.year, @now.month, @now.day)
     when :none
-      month_start = Time.local(@now.year, @now.month)
-      month_end = self.offset_by(Time.local(@now.year, @now.month), 1, :future)
+      month_start = Time.construct(@now.year, @now.month)
+      month_end = self.offset_by(Time.construct(@now.year, @now.month), 1, :future)
     end
     
     Chronic::Span.new(month_start, month_end)
@@ -48,7 +48,7 @@ class Chronic::RepeaterMonth &lt; Chronic::Repeater #:nodoc:
       new_year += 1
       new_month -= YEAR_MONTHS
     end
-    Time.local(new_year, new_month, time.day, time.hour, time.min, time.sec)
+    Time.construct(new_year, new_month, time.day, time.hour, time.min, time.sec)
   end
   
   def width</diff>
      <filename>lib/chronic/repeaters/repeater_month.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,30 +9,30 @@ class Chronic::RepeaterMonthName &lt; Chronic::Repeater #:nodoc:
       case pointer
       when :future
         if @now.month &lt; target_month
-          @current_month_begin = Time.local(@now.year, target_month)
+          @current_month_begin = Time.construct(@now.year, target_month)
         else @now.month &gt; target_month
-          @current_month_begin = Time.local(@now.year + 1, target_month)
+          @current_month_begin = Time.construct(@now.year + 1, target_month)
         end
       when :none
         if @now.month &lt;= target_month
-          @current_month_begin = Time.local(@now.year, target_month)
+          @current_month_begin = Time.construct(@now.year, target_month)
         else @now.month &gt; target_month
-          @current_month_begin = Time.local(@now.year + 1, target_month)
+          @current_month_begin = Time.construct(@now.year + 1, target_month)
         end
       when :past
         if @now.month &gt; target_month
-          @current_month_begin = Time.local(@now.year, target_month)
+          @current_month_begin = Time.construct(@now.year, target_month)
         else @now.month &lt; target_month
-          @current_month_begin = Time.local(@now.year - 1, target_month)
+          @current_month_begin = Time.construct(@now.year - 1, target_month)
         end
       end
       @current_month_begin || raise(&quot;Current month should be set by now&quot;)
     else
       case pointer
       when :future
-        @current_month_begin = Time.local(@current_month_begin.year + 1, @current_month_begin.month)
+        @current_month_begin = Time.construct(@current_month_begin.year + 1, @current_month_begin.month)
       when :past
-        @current_month_begin = Time.local(@current_month_begin.year - 1, @current_month_begin.month)
+        @current_month_begin = Time.construct(@current_month_begin.year - 1, @current_month_begin.month)
       end
     end
     
@@ -47,7 +47,7 @@ class Chronic::RepeaterMonthName &lt; Chronic::Repeater #:nodoc:
       next_month_month = cur_month_month + 1
     end
       
-    Chronic::Span.new(@current_month_begin, Time.local(next_month_year, next_month_month))
+    Chronic::Span.new(@current_month_begin, Time.construct(next_month_year, next_month_month))
   end
   
   def this(pointer = :future)</diff>
      <filename>lib/chronic/repeaters/repeater_month_name.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,16 +6,16 @@ class Chronic::RepeaterYear &lt; Chronic::Repeater #:nodoc:
     if !@current_year_start
       case pointer
       when :future
-        @current_year_start = Time.local(@now.year + 1)
+        @current_year_start = Time.construct(@now.year + 1)
       when :past
-        @current_year_start = Time.local(@now.year - 1)
+        @current_year_start = Time.construct(@now.year - 1)
       end
     else
       diff = pointer == :future ? 1 : -1
-      @current_year_start = Time.local(@current_year_start.year + diff)
+      @current_year_start = Time.construct(@current_year_start.year + diff)
     end
     
-    Chronic::Span.new(@current_year_start, Time.local(@current_year_start.year + 1))
+    Chronic::Span.new(@current_year_start, Time.construct(@current_year_start.year + 1))
   end
   
   def this(pointer = :future)
@@ -23,14 +23,14 @@ class Chronic::RepeaterYear &lt; Chronic::Repeater #:nodoc:
     
     case pointer
     when :future
-      this_year_start = Time.local(@now.year, @now.month, @now.day) + Chronic::RepeaterDay::DAY_SECONDS
-      this_year_end = Time.local(@now.year + 1, 1, 1)
+      this_year_start = Time.construct(@now.year, @now.month, @now.day) + Chronic::RepeaterDay::DAY_SECONDS
+      this_year_end = Time.construct(@now.year + 1, 1, 1)
     when :past
-      this_year_start = Time.local(@now.year, 1, 1)
-      this_year_end = Time.local(@now.year, @now.month, @now.day)
+      this_year_start = Time.construct(@now.year, 1, 1)
+      this_year_end = Time.construct(@now.year, @now.month, @now.day)
     when :none
-      this_year_start = Time.local(@now.year, 1, 1)
-      this_year_end = Time.local(@now.year + 1, 1, 1)
+      this_year_start = Time.construct(@now.year, 1, 1)
+      this_year_end = Time.construct(@now.year + 1, 1, 1)
     end
     
     Chronic::Span.new(this_year_start, this_year_end)
@@ -40,10 +40,10 @@ class Chronic::RepeaterYear &lt; Chronic::Repeater #:nodoc:
     direction = pointer == :future ? 1 : -1
     
     sb = span.begin
-    new_begin = Time.local(sb.year + (amount * direction), sb.month, sb.day, sb.hour, sb.min, sb.sec)
+    new_begin = Time.construct(sb.year + (amount * direction), sb.month, sb.day, sb.hour, sb.min, sb.sec)
     
     se = span.end
-    new_end = Time.local(se.year + (amount * direction), se.month, se.day, se.hour, se.min, se.sec)
+    new_end = Time.construct(se.year + (amount * direction), se.month, se.day, se.hour, se.min, se.sec)
     
     Chronic::Span.new(new_begin, new_end)
   end</diff>
      <filename>lib/chronic/repeaters/repeater_year.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,514 +2,520 @@ require 'chronic'
 require 'test/unit'
 
 class TestParsing &lt; Test::Unit::TestCase
+  # Wed Aug 16 14:00:00 UTC 2006
+  TIME_2006_08_16_14_00_00 = Time.local(2006, 8, 16, 14, 0, 0, 0)
   
   def setup
-    # Wed Aug 16 14:00:00 UTC 2006
-    @time_2006_08_16_14_00_00 = Time.local(2006, 8, 16, 14, 0, 0, 0)
-    @time_2006_08_16_03_00_00 = Time.local(2006, 8, 16, 3, 0, 0, 0)
+    @time_2006_08_16_14_00_00 = TIME_2006_08_16_14_00_00
   end
   
-  def test__parse_guess_dates
+  def test_parse_guess_dates
     # rm_sd
 
-    time = Chronic.parse(&quot;may 27&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;may 27&quot;)
     assert_equal Time.local(2007, 5, 27, 12), time
     
-    time = Chronic.parse(&quot;may 28&quot;, :now =&gt; @time_2006_08_16_14_00_00, :context =&gt; :past)
+    time = parse_now(&quot;may 28&quot;, :context =&gt; :past)
     assert_equal Time.local(2006, 5, 28, 12), time
     
-    time = Chronic.parse(&quot;may 28 5pm&quot;, :now =&gt; @time_2006_08_16_14_00_00, :context =&gt; :past)
+    time = parse_now(&quot;may 28 5pm&quot;, :context =&gt; :past)
     assert_equal Time.local(2006, 5, 28, 17), time
     
-    time = Chronic.parse(&quot;may 28 at 5pm&quot;, :now =&gt; @time_2006_08_16_14_00_00, :context =&gt; :past)
+    time = parse_now(&quot;may 28 at 5pm&quot;, :context =&gt; :past)
     assert_equal Time.local(2006, 5, 28, 17), time
     
-    time = Chronic.parse(&quot;may 28 at 5:32.19pm&quot;, :now =&gt; @time_2006_08_16_14_00_00, :context =&gt; :past)
+    time = parse_now(&quot;may 28 at 5:32.19pm&quot;, :context =&gt; :past)
     assert_equal Time.local(2006, 5, 28, 17, 32, 19), time
     
     # rm_od
     
-    time = Chronic.parse(&quot;may 27th&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;may 27th&quot;)
     assert_equal Time.local(2007, 5, 27, 12), time
     
-    time = Chronic.parse(&quot;may 27th&quot;, :now =&gt; @time_2006_08_16_14_00_00, :context =&gt; :past)
+    time = parse_now(&quot;may 27th&quot;, :context =&gt; :past)
     assert_equal Time.local(2006, 5, 27, 12), time
     
-    time = Chronic.parse(&quot;may 27th 5:00 pm&quot;, :now =&gt; @time_2006_08_16_14_00_00, :context =&gt; :past)
+    time = parse_now(&quot;may 27th 5:00 pm&quot;, :context =&gt; :past)
     assert_equal Time.local(2006, 5, 27, 17), time
     
-    time = Chronic.parse(&quot;may 27th at 5pm&quot;, :now =&gt; @time_2006_08_16_14_00_00, :context =&gt; :past)
+    time = parse_now(&quot;may 27th at 5pm&quot;, :context =&gt; :past)
     assert_equal Time.local(2006, 5, 27, 17), time
     
-    time = Chronic.parse(&quot;may 27th at 5&quot;, :now =&gt; @time_2006_08_16_14_00_00, :ambiguous_time_range =&gt; :none)
+    time = parse_now(&quot;may 27th at 5&quot;, :ambiguous_time_range =&gt; :none)
     assert_equal Time.local(2007, 5, 27, 5), time
     
     # rm_sy
     
-    time = Chronic.parse(&quot;June 1979&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;June 1979&quot;)
     assert_equal Time.local(1979, 6, 16, 0), time
     
-    time = Chronic.parse(&quot;dec 79&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;dec 79&quot;)
     assert_equal Time.local(1979, 12, 16, 12), time
     
     # rm_sd_sy
     
-    time = Chronic.parse(&quot;jan 3 2010&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;jan 3 2010&quot;)
     assert_equal Time.local(2010, 1, 3, 12), time
     
-    time = Chronic.parse(&quot;jan 3 2010 midnight&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;jan 3 2010 midnight&quot;)
     assert_equal Time.local(2010, 1, 4, 0), time
     
-    time = Chronic.parse(&quot;jan 3 2010 at midnight&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;jan 3 2010 at midnight&quot;)
     assert_equal Time.local(2010, 1, 4, 0), time
     
-    time = Chronic.parse(&quot;jan 3 2010 at 4&quot;, :now =&gt; @time_2006_08_16_14_00_00, :ambiguous_time_range =&gt; :none)
+    time = parse_now(&quot;jan 3 2010 at 4&quot;, :ambiguous_time_range =&gt; :none)
     assert_equal Time.local(2010, 1, 3, 4), time
     
-    #time = Chronic.parse(&quot;January 12, '00&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    #time = parse_now(&quot;January 12, '00&quot;)
     #assert_equal Time.local(2000, 1, 12, 12), time
     
-    time = Chronic.parse(&quot;may 27 79&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;may 27 79&quot;)
     assert_equal Time.local(1979, 5, 27, 12), time
     
-    time = Chronic.parse(&quot;may 27 79 4:30&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;may 27 79 4:30&quot;)
     assert_equal Time.local(1979, 5, 27, 16, 30), time
     
-    time = Chronic.parse(&quot;may 27 79 at 4:30&quot;, :now =&gt; @time_2006_08_16_14_00_00, :ambiguous_time_range =&gt; :none)
+    time = parse_now(&quot;may 27 79 at 4:30&quot;, :ambiguous_time_range =&gt; :none)
     assert_equal Time.local(1979, 5, 27, 4, 30), time
     
     # sd_rm_sy
 
-    time = Chronic.parse(&quot;3 jan 2010&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;3 jan 2010&quot;)
     assert_equal Time.local(2010, 1, 3, 12), time
     
-    time = Chronic.parse(&quot;3 jan 2010 4pm&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;3 jan 2010 4pm&quot;)
     assert_equal Time.local(2010, 1, 3, 16), time
     
     # sm_sd_sy
     
-    time = Chronic.parse(&quot;5/27/1979&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;5/27/1979&quot;)
     assert_equal Time.local(1979, 5, 27, 12), time
     
-    time = Chronic.parse(&quot;5/27/1979 4am&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;5/27/1979 4am&quot;)
     assert_equal Time.local(1979, 5, 27, 4), time
     
     # sd_sm_sy
     
-    time = Chronic.parse(&quot;27/5/1979&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;27/5/1979&quot;)
     assert_equal Time.local(1979, 5, 27, 12), time
     
-    time = Chronic.parse(&quot;27/5/1979 @ 0700&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;27/5/1979 @ 0700&quot;)
     assert_equal Time.local(1979, 5, 27, 7), time
     
     # sm_sy
     
-    time = Chronic.parse(&quot;05/06&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;05/06&quot;)
     assert_equal Time.local(2006, 5, 16, 12), time
     
-    time = Chronic.parse(&quot;12/06&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;12/06&quot;)
     assert_equal Time.local(2006, 12, 16, 12), time
     
-    time = Chronic.parse(&quot;13/06&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;13/06&quot;)
     assert_equal nil, time
     
     # sy_sm_sd
     
-    time = Chronic.parse(&quot;2000-1-1&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;2000-1-1&quot;)
     assert_equal Time.local(2000, 1, 1, 12), time
     
-    time = Chronic.parse(&quot;2006-08-20&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;2006-08-20&quot;)
     assert_equal Time.local(2006, 8, 20, 12), time
     
-    time = Chronic.parse(&quot;2006-08-20 7pm&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;2006-08-20 7pm&quot;)
     assert_equal Time.local(2006, 8, 20, 19), time
     
-    time = Chronic.parse(&quot;2006-08-20 03:00&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;2006-08-20 03:00&quot;)
     assert_equal Time.local(2006, 8, 20, 3), time
     
-    time = Chronic.parse(&quot;2006-08-20 03:30:30&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;2006-08-20 03:30:30&quot;)
     assert_equal Time.local(2006, 8, 20, 3, 30, 30), time
     
-    time = Chronic.parse(&quot;2006-08-20 15:30:30&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;2006-08-20 15:30:30&quot;)
     assert_equal Time.local(2006, 8, 20, 15, 30, 30), time
     
-    time = Chronic.parse(&quot;2006-08-20 15:30.30&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;2006-08-20 15:30.30&quot;)
     assert_equal Time.local(2006, 8, 20, 15, 30, 30), time
     
     # rm_sd_rt
     
-    #time = Chronic.parse(&quot;jan 5 13:00&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    #time = parse_now(&quot;jan 5 13:00&quot;)
     #assert_equal Time.local(2007, 1, 5, 13), time
     
     # due to limitations of the Time class, these don't work
     
-    time = Chronic.parse(&quot;may 40&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;may 40&quot;)
     assert_equal nil, time
     
-    time = Chronic.parse(&quot;may 27 40&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;may 27 40&quot;)
     assert_equal nil, time
     
-    time = Chronic.parse(&quot;1800-08-20&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;1800-08-20&quot;)
     assert_equal nil, time
   end
 
   def test_parse_guess_r
-    time = Chronic.parse(&quot;friday&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;friday&quot;)
     assert_equal Time.local(2006, 8, 18, 12), time
     
-    time = Chronic.parse(&quot;5&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;5&quot;)
     assert_equal Time.local(2006, 8, 16, 17), time
     
-    time = Chronic.parse(&quot;5&quot;, :now =&gt; @time_2006_08_16_03_00_00, :ambiguous_time_range =&gt; :none)
+    time = Chronic.parse(&quot;5&quot;, :now =&gt; Time.local(2006, 8, 16, 3, 0, 0, 0), :ambiguous_time_range =&gt; :none)
     assert_equal Time.local(2006, 8, 16, 5), time
     
-    time = Chronic.parse(&quot;13:00&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;13:00&quot;)
     assert_equal Time.local(2006, 8, 17, 13), time
     
-    time = Chronic.parse(&quot;13:45&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;13:45&quot;)
     assert_equal Time.local(2006, 8, 17, 13, 45), time
     
-    time = Chronic.parse(&quot;november&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;november&quot;)
     assert_equal Time.local(2006, 11, 16), time
   end
   
   def test_parse_guess_rr
-    time = Chronic.parse(&quot;friday 13:00&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;friday 13:00&quot;)
     assert_equal Time.local(2006, 8, 18, 13), time
     
-    time = Chronic.parse(&quot;monday 4:00&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;monday 4:00&quot;)
     assert_equal Time.local(2006, 8, 21, 16), time
     
-    time = Chronic.parse(&quot;sat 4:00&quot;, :now =&gt; @time_2006_08_16_14_00_00, :ambiguous_time_range =&gt; :none)
+    time = parse_now(&quot;sat 4:00&quot;, :ambiguous_time_range =&gt; :none)
     assert_equal Time.local(2006, 8, 19, 4), time
     
-    time = Chronic.parse(&quot;sunday 4:20&quot;, :now =&gt; @time_2006_08_16_14_00_00, :ambiguous_time_range =&gt; :none)
+    time = parse_now(&quot;sunday 4:20&quot;, :ambiguous_time_range =&gt; :none)
     assert_equal Time.local(2006, 8, 20, 4, 20), time
     
-    time = Chronic.parse(&quot;4 pm&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;4 pm&quot;)
     assert_equal Time.local(2006, 8, 16, 16), time
     
-    time = Chronic.parse(&quot;4 am&quot;, :now =&gt; @time_2006_08_16_14_00_00, :ambiguous_time_range =&gt; :none)
+    time = parse_now(&quot;4 am&quot;, :ambiguous_time_range =&gt; :none)
     assert_equal Time.local(2006, 8, 16, 4), time
     
-    time = Chronic.parse(&quot;4:00 in the morning&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;4:00 in the morning&quot;)
     assert_equal Time.local(2006, 8, 16, 4), time
     
-    time = Chronic.parse(&quot;november 4&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;november 4&quot;)
     assert_equal Time.local(2006, 11, 4, 12), time
     
-    time = Chronic.parse(&quot;aug 24&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;aug 24&quot;)
     assert_equal Time.local(2006, 8, 24, 12), time
   end
   
   def test_parse_guess_rrr
-    time = Chronic.parse(&quot;friday 1 pm&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;friday 1 pm&quot;)
     assert_equal Time.local(2006, 8, 18, 13), time
     
-    time = Chronic.parse(&quot;friday 11 at night&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;friday 11 at night&quot;)
     assert_equal Time.local(2006, 8, 18, 23), time
     
-    time = Chronic.parse(&quot;friday 11 in the evening&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;friday 11 in the evening&quot;)
     assert_equal Time.local(2006, 8, 18, 23), time
     
-    time = Chronic.parse(&quot;sunday 6am&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;sunday 6am&quot;)
     assert_equal Time.local(2006, 8, 20, 6), time
   end
   
   def test_parse_guess_gr
     # year
     
-    time = Chronic.parse(&quot;this year&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;this year&quot;)
     assert_equal Time.local(2006, 10, 24, 12, 30), time
     
-    time = Chronic.parse(&quot;this year&quot;, :now =&gt; @time_2006_08_16_14_00_00, :context =&gt; :past)
+    time = parse_now(&quot;this year&quot;, :context =&gt; :past)
     assert_equal Time.local(2006, 4, 24, 12, 30), time
     
     # month
     
-    time = Chronic.parse(&quot;this month&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;this month&quot;)
     assert_equal Time.local(2006, 8, 24, 12), time
     
-    time = Chronic.parse(&quot;this month&quot;, :now =&gt; @time_2006_08_16_14_00_00, :context =&gt; :past)
+    time = parse_now(&quot;this month&quot;, :context =&gt; :past)
     assert_equal Time.local(2006, 8, 8, 12), time
     
+    time = Chronic.parse(&quot;next month&quot;, :now =&gt; Time.local(2006, 11, 15))
+    assert_equal Time.local(2006, 12, 16, 12), time
+    
     # month name
     
-    time = Chronic.parse(&quot;last november&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;last november&quot;)
     assert_equal Time.local(2005, 11, 16), time
     
     # fortnight
     
-    time = Chronic.parse(&quot;this fortnight&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;this fortnight&quot;)
     assert_equal Time.local(2006, 8, 21, 19, 30), time
     
-    time = Chronic.parse(&quot;this fortnight&quot;, :now =&gt; @time_2006_08_16_14_00_00, :context =&gt; :past)
+    time = parse_now(&quot;this fortnight&quot;, :context =&gt; :past)
     assert_equal Time.local(2006, 8, 14, 19), time
     
     # week
     
-    time = Chronic.parse(&quot;this week&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;this week&quot;)
     assert_equal Time.local(2006, 8, 18, 7, 30), time
     
-    time = Chronic.parse(&quot;this week&quot;, :now =&gt; @time_2006_08_16_14_00_00, :context =&gt; :past)
+    time = parse_now(&quot;this week&quot;, :context =&gt; :past)
     assert_equal Time.local(2006, 8, 14, 19), time
     
     # weekend
     
-    time = Chronic.parse(&quot;this weekend&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;this weekend&quot;)
     assert_equal Time.local(2006, 8, 20), time
     
-    time = Chronic.parse(&quot;this weekend&quot;, :now =&gt; @time_2006_08_16_14_00_00, :context =&gt; :past)
+    time = parse_now(&quot;this weekend&quot;, :context =&gt; :past)
     assert_equal Time.local(2006, 8, 13), time
     
-    time = Chronic.parse(&quot;last weekend&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;last weekend&quot;)
     assert_equal Time.local(2006, 8, 13), time
     
     # day
     
-    time = Chronic.parse(&quot;this day&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;this day&quot;)
     assert_equal Time.local(2006, 8, 16, 19, 30), time
     
-    time = Chronic.parse(&quot;this day&quot;, :now =&gt; @time_2006_08_16_14_00_00, :context =&gt; :past)
+    time = parse_now(&quot;this day&quot;, :context =&gt; :past)
     assert_equal Time.local(2006, 8, 16, 7), time
     
-    time = Chronic.parse(&quot;today&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;today&quot;)
     assert_equal Time.local(2006, 8, 16, 19, 30), time
     
-    time = Chronic.parse(&quot;yesterday&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;yesterday&quot;)
     assert_equal Time.local(2006, 8, 15, 12), time
     
-    time = Chronic.parse(&quot;tomorrow&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;tomorrow&quot;)
     assert_equal Time.local(2006, 8, 17, 12), time
     
     # day name
     
-    time = Chronic.parse(&quot;this tuesday&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;this tuesday&quot;)
     assert_equal Time.local(2006, 8, 22, 12), time
     
-    time = Chronic.parse(&quot;next tuesday&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;next tuesday&quot;)
     assert_equal Time.local(2006, 8, 22, 12), time
     
-    time = Chronic.parse(&quot;last tuesday&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;last tuesday&quot;)
     assert_equal Time.local(2006, 8, 15, 12), time
     
-    time = Chronic.parse(&quot;this wed&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;this wed&quot;)
     assert_equal Time.local(2006, 8, 23, 12), time
     
-    time = Chronic.parse(&quot;next wed&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;next wed&quot;)
     assert_equal Time.local(2006, 8, 23, 12), time
     
-    time = Chronic.parse(&quot;last wed&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;last wed&quot;)
     assert_equal Time.local(2006, 8, 9, 12), time
     
     # day portion
     
-    time = Chronic.parse(&quot;this morning&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;this morning&quot;)
     assert_equal Time.local(2006, 8, 16, 9), time
     
-    time = Chronic.parse(&quot;tonight&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;tonight&quot;)
     assert_equal Time.local(2006, 8, 16, 22), time
     
     # second
     
-    time = Chronic.parse(&quot;this second&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;this second&quot;)
     assert_equal Time.local(2006, 8, 16, 14), time
     
-    time = Chronic.parse(&quot;this second&quot;, :now =&gt; @time_2006_08_16_14_00_00, :context =&gt; :past)
+    time = parse_now(&quot;this second&quot;, :context =&gt; :past)
     assert_equal Time.local(2006, 8, 16, 14), time
     
-    time = Chronic.parse(&quot;next second&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;next second&quot;)
     assert_equal Time.local(2006, 8, 16, 14, 0, 1), time
     
-    time = Chronic.parse(&quot;last second&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;last second&quot;)
     assert_equal Time.local(2006, 8, 16, 13, 59, 59), time
   end
   
   def test_parse_guess_grr    
-    time = Chronic.parse(&quot;yesterday at 4:00&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;yesterday at 4:00&quot;)
     assert_equal Time.local(2006, 8, 15, 16), time
     
-    time = Chronic.parse(&quot;today at 9:00&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;today at 9:00&quot;)
     assert_equal Time.local(2006, 8, 16, 9), time
     
-    time = Chronic.parse(&quot;today at 2100&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;today at 2100&quot;)
     assert_equal Time.local(2006, 8, 16, 21), time
     
-    time = Chronic.parse(&quot;this day at 0900&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;this day at 0900&quot;)
     assert_equal Time.local(2006, 8, 16, 9), time
     
-    time = Chronic.parse(&quot;tomorrow at 0900&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;tomorrow at 0900&quot;)
     assert_equal Time.local(2006, 8, 17, 9), time
     
-    time = Chronic.parse(&quot;yesterday at 4:00&quot;, :now =&gt; @time_2006_08_16_14_00_00, :ambiguous_time_range =&gt; :none)
+    time = parse_now(&quot;yesterday at 4:00&quot;, :ambiguous_time_range =&gt; :none)
     assert_equal Time.local(2006, 8, 15, 4), time
     
-    time = Chronic.parse(&quot;last friday at 4:00&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;last friday at 4:00&quot;)
     assert_equal Time.local(2006, 8, 11, 16), time
     
-    time = Chronic.parse(&quot;next wed 4:00&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;next wed 4:00&quot;)
     assert_equal Time.local(2006, 8, 23, 16), time
     
-    time = Chronic.parse(&quot;yesterday afternoon&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;yesterday afternoon&quot;)
     assert_equal Time.local(2006, 8, 15, 15), time
     
-    time = Chronic.parse(&quot;last week tuesday&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;last week tuesday&quot;)
     assert_equal Time.local(2006, 8, 8, 12), time
   end
   
   def test_parse_guess_grrr
-    time = Chronic.parse(&quot;today at 6:00pm&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;today at 6:00pm&quot;)
     assert_equal Time.local(2006, 8, 16, 18), time
     
-    time = Chronic.parse(&quot;today at 6:00am&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;today at 6:00am&quot;)
     assert_equal Time.local(2006, 8, 16, 6), time
     
-    time = Chronic.parse(&quot;this day 1800&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;this day 1800&quot;)
     assert_equal Time.local(2006, 8, 16, 18), time
     
-    time = Chronic.parse(&quot;yesterday at 4:00pm&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;yesterday at 4:00pm&quot;)
     assert_equal Time.local(2006, 8, 15, 16), time
   end
   
   def test_parse_guess_rgr
-    time = Chronic.parse(&quot;afternoon yesterday&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;afternoon yesterday&quot;)
     assert_equal Time.local(2006, 8, 15, 15), time
     
-    time = Chronic.parse(&quot;tuesday last week&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;tuesday last week&quot;)
     assert_equal Time.local(2006, 8, 8, 12), time
   end
   
   def test_parse_guess_s_r_p
     # past
     
-    time = Chronic.parse(&quot;3 years ago&quot;, :now =&gt; @time_2006_08_16_14_00_00)
-    assert_equal Time.local(2003, 8, 16, 14, 30, 30), time
+    time = parse_now(&quot;3 years ago&quot;)
+    assert_equal Time.local(2003, 8, 16, 14), time
     
-    time = Chronic.parse(&quot;1 month ago&quot;, :now =&gt; @time_2006_08_16_14_00_00)
-    assert_equal Time.local(2006, 7, 16, 14, 30, 30), time
+    time = parse_now(&quot;1 month ago&quot;)
+    assert_equal Time.local(2006, 7, 16, 14), time
     
-    time = Chronic.parse(&quot;1 fortnight ago&quot;, :now =&gt; @time_2006_08_16_14_00_00)
-    assert_equal Time.local(2006, 8, 2, 14, 30, 30), time
+    time = parse_now(&quot;1 fortnight ago&quot;)
+    assert_equal Time.local(2006, 8, 2, 14), time
     
-    time = Chronic.parse(&quot;2 fortnights ago&quot;, :now =&gt; @time_2006_08_16_14_00_00)
-    assert_equal Time.local(2006, 7, 19, 14, 30, 30), time
+    time = parse_now(&quot;2 fortnights ago&quot;)
+    assert_equal Time.local(2006, 7, 19, 14), time
     
-    time = Chronic.parse(&quot;3 weeks ago&quot;, :now =&gt; @time_2006_08_16_14_00_00)
-    assert_equal Time.local(2006, 7, 26, 14, 30, 30), time
+    time = parse_now(&quot;3 weeks ago&quot;)
+    assert_equal Time.local(2006, 7, 26, 14), time
     
-    time = Chronic.parse(&quot;2 weekends ago&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;2 weekends ago&quot;)
     assert_equal Time.local(2006, 8, 5), time
     
-    time = Chronic.parse(&quot;3 days ago&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;3 days ago&quot;)
     assert_equal Time.local(2006, 8, 13, 14), time
     
-    #time = Chronic.parse(&quot;1 monday ago&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    #time = parse_now(&quot;1 monday ago&quot;)
     #assert_equal Time.local(2006, 8, 14, 12), time
     
-    time = Chronic.parse(&quot;5 mornings ago&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;5 mornings ago&quot;)
     assert_equal Time.local(2006, 8, 12, 9), time
     
-    time = Chronic.parse(&quot;7 hours ago&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;7 hours ago&quot;)
     assert_equal Time.local(2006, 8, 16, 7), time
     
-    time = Chronic.parse(&quot;3 minutes ago&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;3 minutes ago&quot;)
     assert_equal Time.local(2006, 8, 16, 13, 57), time
     
-    time = Chronic.parse(&quot;20 seconds before now&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;20 seconds before now&quot;)
     assert_equal Time.local(2006, 8, 16, 13, 59, 40), time
 
     # future
     
-    time = Chronic.parse(&quot;3 years from now&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;3 years from now&quot;)
     assert_equal Time.local(2009, 8, 16, 14, 0, 0), time
     
-    time = Chronic.parse(&quot;6 months hence&quot;, :now =&gt; @time_2006_08_16_14_00_00)
-    assert_equal Time.local(2007, 2, 16, 14, 30, 30), time
+    time = parse_now(&quot;6 months hence&quot;)
+    assert_equal Time.local(2007, 2, 16, 14), time
     
-    time = Chronic.parse(&quot;3 fortnights hence&quot;, :now =&gt; @time_2006_08_16_14_00_00)
-    assert_equal Time.local(2006, 9, 27, 14, 30, 30), time
+    time = parse_now(&quot;3 fortnights hence&quot;)
+    assert_equal Time.local(2006, 9, 27, 14), time
     
-    time = Chronic.parse(&quot;1 week from now&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;1 week from now&quot;)
     assert_equal Time.local(2006, 8, 23, 14, 0, 0), time
     
-    time = Chronic.parse(&quot;1 weekend from now&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;1 weekend from now&quot;)
     assert_equal Time.local(2006, 8, 19), time
     
-    time = Chronic.parse(&quot;2 weekends from now&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;2 weekends from now&quot;)
     assert_equal Time.local(2006, 8, 26), time
     
-    time = Chronic.parse(&quot;1 day hence&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;1 day hence&quot;)
     assert_equal Time.local(2006, 8, 17, 14), time
     
-    time = Chronic.parse(&quot;5 mornings hence&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;5 mornings hence&quot;)
     assert_equal Time.local(2006, 8, 21, 9), time
     
-    time = Chronic.parse(&quot;1 hour from now&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;1 hour from now&quot;)
     assert_equal Time.local(2006, 8, 16, 15), time
     
-    time = Chronic.parse(&quot;20 minutes hence&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;20 minutes hence&quot;)
     assert_equal Time.local(2006, 8, 16, 14, 20), time
     
-    time = Chronic.parse(&quot;20 seconds from now&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;20 seconds from now&quot;)
     assert_equal Time.local(2006, 8, 16, 14, 0, 20), time
+    
+    time = Chronic.parse(&quot;2 months ago&quot;, :now =&gt; Time.parse(&quot;2007-03-07 23:30&quot;))
+    assert_equal Time.local(2007, 1, 7, 23, 30), time
   end
   
   def test_parse_guess_p_s_r
-    time = Chronic.parse(&quot;in 3 hours&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;in 3 hours&quot;)
     assert_equal Time.local(2006, 8, 16, 17), time
   end
   
   def test_parse_guess_s_r_p_a
     # past
     
-    time = Chronic.parse(&quot;3 years ago tomorrow&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;3 years ago tomorrow&quot;)
     assert_equal Time.local(2003, 8, 17, 12), time
     
-    time = Chronic.parse(&quot;3 years ago this friday&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;3 years ago this friday&quot;)
     assert_equal Time.local(2003, 8, 18, 12), time
     
-    time = Chronic.parse(&quot;3 months ago saturday at 5:00 pm&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;3 months ago saturday at 5:00 pm&quot;)
     assert_equal Time.local(2006, 5, 19, 17), time
     
-    time = Chronic.parse(&quot;2 days from this second&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;2 days from this second&quot;)
     assert_equal Time.local(2006, 8, 18, 14), time
     
-    time = Chronic.parse(&quot;7 hours before tomorrow at midnight&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;7 hours before tomorrow at midnight&quot;)
     assert_equal Time.local(2006, 8, 17, 17), time
     
     # future
   end
   
   def test_parse_guess_o_r_s_r
-    time = Chronic.parse(&quot;3rd wednesday in november&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;3rd wednesday in november&quot;)
     assert_equal Time.local(2006, 11, 15, 12), time
     
-    time = Chronic.parse(&quot;10th wednesday in november&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;10th wednesday in november&quot;)
     assert_equal nil, time
   end
   
   def test_parse_guess_o_r_g_r
-    time = Chronic.parse(&quot;3rd month next year&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;3rd month next year&quot;)
     assert_equal Time.local(2007, 3, 16, 12, 30), time
     
-    time = Chronic.parse(&quot;3rd thursday this september&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;3rd thursday this september&quot;)
     assert_equal Time.local(2006, 9, 21, 12), time
     
-    time = Chronic.parse(&quot;4th day last week&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;4th day last week&quot;)
     assert_equal Time.local(2006, 8, 9, 12), time
   end
   
   def test_parse_guess_nonsense
-    time = Chronic.parse(&quot;some stupid nonsense&quot;, :now =&gt; @time_2006_08_16_14_00_00)
+    time = parse_now(&quot;some stupid nonsense&quot;)
     assert_equal nil, time
   end
   
   def test_parse_span
-    span = Chronic.parse(&quot;friday&quot;, :now =&gt; @time_2006_08_16_14_00_00, :guess =&gt; false)
+    span = parse_now(&quot;friday&quot;, :guess =&gt; false)
     assert_equal Time.local(2006, 8, 18), span.begin
     assert_equal Time.local(2006, 8, 19), span.end
     
-    span = Chronic.parse(&quot;november&quot;, :now =&gt; @time_2006_08_16_14_00_00, :guess =&gt; false)
+    span = parse_now(&quot;november&quot;, :guess =&gt; false)
     assert_equal Time.local(2006, 11), span.begin
     assert_equal Time.local(2006, 12), span.end
     
@@ -518,6 +524,18 @@ class TestParsing &lt; Test::Unit::TestCase
     assert_equal Time.local(2006, 8, 21), span.end
   end
   
+  def test_parse_words
+    assert_equal parse_now(&quot;33 days from now&quot;), parse_now(&quot;thirty-three days from now&quot;)
+    assert_equal parse_now(&quot;2867532 seconds from now&quot;), parse_now(&quot;two million eight hundred and sixty seven thousand five hundred and thirty two seconds from now&quot;)
+    assert_equal parse_now(&quot;may 10th&quot;), parse_now(&quot;may tenth&quot;)
+  end
+  
+  def test_parse_only_complete_pointers
+    assert_equal parse_now(&quot;eat pasty buns today at 2pm&quot;), @time_2006_08_16_14_00_00
+    assert_equal parse_now(&quot;futuristically speaking today at 2pm&quot;), @time_2006_08_16_14_00_00
+    assert_equal parse_now(&quot;meeting today at 2pm&quot;), @time_2006_08_16_14_00_00
+  end
+  
   def test_argument_validation
     assert_raise(Chronic::InvalidArgumentException) do
       time = Chronic.parse(&quot;may 27&quot;, :foo =&gt; :bar)
@@ -528,4 +546,8 @@ class TestParsing &lt; Test::Unit::TestCase
     end
   end
   
+  private
+  def parse_now(string, options={})
+    Chronic.parse(string, {:now =&gt; TIME_2006_08_16_14_00_00 }.merge(options))
+  end
 end
\ No newline at end of file</diff>
      <filename>test/test_parsing.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>test/parse_numbers.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>fc507350c9dabd55415c4d6b93e8c376f8c9b90f</id>
    </parent>
  </parents>
  <author>
    <name>Tom Preston-Werner</name>
    <email>tom@mojombo.com</email>
  </author>
  <url>http://github.com/technoweenie/chronic/commit/044fbd787e3de2509dd69d386df78aa6c2acfddb</url>
  <id>044fbd787e3de2509dd69d386df78aa6c2acfddb</id>
  <committed-date>2007-03-31T19:56:18-07:00</committed-date>
  <authored-date>2007-03-31T19:56:18-07:00</authored-date>
  <message>numerizer, time overflow</message>
  <tree>02579c14a6db29ac8e5255e82d9d10d5c8aee48d</tree>
  <committer>
    <name>Tom Preston-Werner</name>
    <email>tom@mojombo.com</email>
  </committer>
</commit>
