event_nlp 0.2.10 → 0.2.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 613506d5982645c82945f69d275104e12e493711
4
- data.tar.gz: 5b4b04e370621b17ad1f6f57e163ea2f7b0b01d5
3
+ metadata.gz: d394e7eb9da0f8a92e3966819fec1288936260a9
4
+ data.tar.gz: a85d522b2208ef9a9cd6aff61adde643d1963b35
5
5
  SHA512:
6
- metadata.gz: 8d04d93e89943d23c52ec39b9b9588584e1b9b7801a81db1c35da31fc775f558cf9932aadebda725776201701414ef9286bbb5941fea15016281c8e673676162
7
- data.tar.gz: 578329f65b9aaa98baac0e2a05f11308e5c22daa3e9f925984866f30e4ee7a17512063315b07b1a1ebe4c94435dbf808d8be818e58f0aa3e3f5483208b857573
6
+ metadata.gz: 8661e5a81643dc94cd6ceeb18ec6dd54b10ebcdbbd083ae60b56b7dd12bd4914c958bdd665a80ed577ef6b585bb916e92d9cf2e32833a0842a4fbc62dbd956d7
7
+ data.tar.gz: e10c87e9c4a1f1c410d0e1408540f6c4b546642f73555bb2d2d18e30f0893b38a5bf7a7f9f2d9137424cf53239acda33481128058792741c1dd64224d7b12a95
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/event_nlp.rb CHANGED
@@ -63,6 +63,7 @@ class EventNlp
63
63
  months = (Date::MONTHNAMES[1..-1] + Date::ABBR_MONTHNAMES[1..-1])\
64
64
  .join('|').downcase
65
65
  times = /(?: *(?:at |@ |from )?(\d+(?::\d+)?[ap]m) *)/
66
+ times2 = /\d+(?::\d+)?[ap]m-\d+(?::\d+)?[ap]m|\d+(?::\d+)?-\d+(?::\d+)?/
66
67
  days = /\d+(?:st|nd|rd|th)/
67
68
 
68
69
  #weekdays = Date::DAYNAMES.join('|').downcase
@@ -253,6 +254,21 @@ class EventNlp
253
254
 
254
255
  end
255
256
 
257
+
258
+ # Some event (10 Woodhouse Lane) 30th Nov from 9:15-17:00
259
+
260
+ get /^(.*) (#{days}) (#{months}) from (#{times2})/i do |title, day, month, xtimes|
261
+
262
+ t1, t2 = xtimes.split(/-/,2)
263
+
264
+ d1 = Chronic.parse([month, day, t1].join(' '))
265
+ d2 = Chronic.parse([month, day, t2].join(' '))
266
+
267
+ puts [4.5, title, d1, d2].inspect if @debug
268
+
269
+ { title: title, date: d1, end_date: d2 }
270
+ end
271
+
256
272
  # Tuesday 3rd October gas service at Barbara's house morning 9am-1pm
257
273
 
258
274
  get '*' do
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: event_nlp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  /WtgKLMzCAKTHZ2OpN3OTs6j+vsUBIwCb/Ki17Z4YULtRaGg7I8nTjTrHIIJ0yNm
32
32
  kbRihMTezaC+4A==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-10-06 00:00:00.000000000 Z
34
+ date: 2017-11-14 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: chronic_cron
metadata.gz.sig CHANGED
Binary file