iainbeeston / nickel

Nickel extracts date, time, and message information from naturally worded text.
MIT License
112 stars 17 forks source link

day_of_week should be DAY_OF_WEEK #11

Closed copiousfreetime closed 10 years ago

copiousfreetime commented 10 years ago

A random test of 'the last thursday of the month' yieled an undefined variable.

Quick fix, here you go.

  1) Nickel::NLP#parse when the query is 'the last thursday of the month' #occurrences is last thursday this month
     Failure/Error: let(:nlp) { NLP.new(query, run_date).tap(&:parse) }
     NameError:
       undefined local variable or method `day_of_week' for "the 5th thu of the month ":Nickel::NLPQuery
     # ./lib/nickel/query.rb:1164:in `block in standardize_input'
     # ./lib/nickel/query.rb:58:in `block in nsub!'
     # ./lib/nickel/query.rb:58:in `sub'
     # ./lib/nickel/query.rb:58:in `nsub!'
     # ./lib/nickel/query.rb:1164:in `standardize_input'
     # ./lib/nickel/query.rb:71:in `query_pre_processing'
     # ./lib/nickel/query.rb:20:in `standardize'
     # ./lib/nickel/nlp.rb:36:in `parse'
     # ./spec/lib/nickel/nlp_spec.rb:12:in `tap'
     # ./spec/lib/nickel/nlp_spec.rb:12:in `block (3 levels) in <module:Nickel>'
     # ./spec/lib/nickel/nlp_spec.rb:663:in `block (5 levels) in <module:Nickel>'
iainbeeston commented 10 years ago

Good catch, thanks!