<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,7 @@
 == 0.1.2 TBA
 
 * Replace a number phrase within a string with their numeral equivalents
+* Handle upper case number phrases
 
 == 0.1.1 2009-09-03
 </diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -27,4 +27,8 @@ Feature: Recognise from zero to ten
  
   Scenario: Number string contains noise
     When 'a bratwurst costs two euros' is parsed
+    Then the number will be 2
+
+  Scenario: Number is upper case
+    When 'a bratwurst costs TWO euros' is parsed
     Then the number will be 2
\ No newline at end of file</diff>
      <filename>features/parse_zero_to_ten.feature</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,7 @@ module Numerouno
     def search
       if match = next_match
         @string = string_without match
-        @numbers[match.pre_match.length] = NUMBER_LOOKUP[match.to_s]
+        @numbers[match.pre_match.length] = NUMBER_LOOKUP[match.to_s.downcase]
       else
         @string = ''
       end
@@ -39,7 +39,7 @@ module Numerouno
     
     def next_match
       NUMBER_STRINGS.collect do |number_string, number|
-        @string.match number_string
+        @string.match(/#{number_string}/i)
       end.compact.first
     end
     </diff>
      <filename>lib/numerouno/search.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,7 @@ module Numerouno
       NUMBER_STRINGS.each do |number_string, number|
         matches = matches_within(@source, number_string).merge(matches)
       end
-      
+
       matches.empty? ? @source : replace(matches, @source)
     end
     
@@ -25,7 +25,7 @@ module Numerouno
     def match_locations source, string
       match_locations = []
       scanner = StringScanner.new source
-      while(scanner.scan_until(/#{string}/))
+      while(scanner.scan_until(/#{string}/i))
         match_locations &lt;&lt; scanner.pre_match.length
       end
       match_locations
@@ -48,7 +48,7 @@ module Numerouno
       
       phrase = source[range]
       
-      source.sub(phrase, Parser.number_from(phrase).to_s)
+      source.sub(/#{phrase.downcase}/i, Parser.number_from(phrase).to_s)
     end
   end
   </diff>
      <filename>lib/numerouno/substitution.rb</filename>
    </modified>
    <modified>
      <diff>@@ -51,6 +51,12 @@ describe Numerouno::Parser, 'will parse' do
   it 'numbers starting with a alphabetic character as a phrase' do
     subject.number_from('two 5').should == 2
   end
+  
+  it 'uppercase numbers' do
+    subject.number_from('NINE is uppercase').should == 9
+  end
+  
+  it 'shouldnt parse &quot;stone the crows&quot; as 1'
  
 end
 </diff>
      <filename>spec/numerouno/parser_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,9 @@ describe Numerouno::Substitution do
     substitution_for('I have seven hundred and seventy seven apricots').should == 'I have 777 apricots'
   end
   
-  it 'handles upper case'
+  it 'replaces upper case number phrases' do
+    substitution_for('my hamster has NINE lives').should == 'my hamster has 9 lives'
+  end
     
   def substitution_for string
     Numerouno::Substitution.new(string).sub</diff>
      <filename>spec/numerouno/substitution_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bfa84f4f3ed2de26b9b2467f428134126a979e5f</id>
    </parent>
  </parents>
  <author>
    <name>Brent Snook</name>
    <email>brent@fuglylogic.com</email>
  </author>
  <url>http://github.com/brentsnook/numerouno/commit/40c21c93460bfc478fd4f8519e37ed335579298a</url>
  <id>40c21c93460bfc478fd4f8519e37ed335579298a</id>
  <committed-date>2009-10-09T10:21:56-07:00</committed-date>
  <authored-date>2009-10-09T10:21:56-07:00</authored-date>
  <message>recognise upper case number strings when parsing and substituting</message>
  <tree>b3f95332be0d71b87b25309fbaaf38a7824a809f</tree>
  <committer>
    <name>Brent Snook</name>
    <email>brent@fuglylogic.com</email>
  </committer>
</commit>
