<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -18,11 +18,8 @@ mat,1
 
 * Fork the project.
 * Make your feature addition or bug fix.
-* Add tests for it. This is important so I don't break it in a
-  future version unintentionally.
-* Commit, do not mess with rakefile, version, or history.
-  (if you want to have your own version, that is fine but
-   bump version in a commit by itself I can ignore when I pull)
+* Add tests for it. This is important so I don't break it in a future version unintentionally.
+* Commit, do not mess with rakefile, version, or history.(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
 * Send me a pull request. Bonus points for topic branches.
 
 == Copyright</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -3,12 +3,11 @@
 $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
 require 'vocab_counter'
 
-unless File.exists?(ARGV[0].to_s)
-  puts &quot;Vocab counter: please specify a file&quot;
-  Process.exit
-end
+v = VocabCounter.new
 
-file = File.open(ARGV[0])
+ARGF.each do |line|
+  v.count(line)
+end
 
-puts VocabCounter.count(file.read)
+puts v.report
 </diff>
      <filename>bin/vocab_counter</filename>
    </modified>
    <modified>
      <diff>@@ -1,16 +1,21 @@
 class VocabCounter
 
-  def self.count(input)
-    input.downcase!
-    input.gsub!(/[^a-z0-9']/, ' ')
-    input.gsub!(/\s'|'\s/, ' ')
-    count = Hash.new(0)
-    input.split(/\s+/).each do |term|
-      count[term.to_sym] += 1
+  def initialize
+    @count = Hash.new(0)
+  end
+
+  def count(line)
+    line.downcase!
+    line.gsub!(/[^a-z0-9']/, ' ')
+    line.gsub!(/\s'|'\s/, ' ')
+    line.split(/\s+/).each do |term|
+      @count[term.to_sym] += 1
     end
+  end
 
+  def report
     out = &quot;&quot;
-    count.sort { |a,b| b[1] &lt;=&gt; a[1] }.each do |k,v|
+    @count.sort { |a,b| b[1] &lt;=&gt; a[1] }.each do |k,v|
       out &lt;&lt; &quot;#{k.to_s},#{v}\n&quot;
     end
     out</diff>
      <filename>lib/vocab_counter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@
 
 Gem::Specification.new do |s|
   s.name = %q{vocab_counter}
-  s.version = &quot;0.1.1&quot;
+  s.version = &quot;1.0.0&quot;
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Julian Burgess&quot;]</diff>
      <filename>vocab_counter.gemspec</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e84ece8c571aee1b013a0eb0b9bf253aae835874</id>
    </parent>
  </parents>
  <author>
    <name>Julian Burgess</name>
    <email>aubergene@gmail.com</email>
  </author>
  <url>http://github.com/aubergene/vocab_counter/commit/c1e54873489a9fb00ea09581ee7e431dc40f0f30</url>
  <id>c1e54873489a9fb00ea09581ee7e431dc40f0f30</id>
  <committed-date>2009-11-07T14:47:50-08:00</committed-date>
  <authored-date>2009-11-07T14:47:50-08:00</authored-date>
  <message>Changed to work better with standard unix pipes</message>
  <tree>403ea62f3c0d9a5bce71405016b6bdef3d285096</tree>
  <committer>
    <name>Julian Burgess</name>
    <email>aubergene@gmail.com</email>
  </committer>
</commit>
