event_nlp 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -2
- data.tar.gz.sig +0 -0
- data/lib/event_nlp.rb +29 -1
- metadata +1 -1
- metadata.gz.sig +1 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54ba784176824a213dcdbd4ca421b388687fba9f
|
4
|
+
data.tar.gz: ed2a521afa3726671c01ecb62977c0b9b48ce203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6b8bbe02b6a14f5a5b8f918995bae07aac3a867721570706a08572989a1bd6bb5014a965c8efd5b386046ac06292f24610c1d08c5a76409ed9e996e8351f083
|
7
|
+
data.tar.gz: b735297f5f76c702e6c9c177fc5a486926457dc2c33c288c452de2672a167517afa1d5769b6b31058d71bc4dabd836264c334dff7bd365ad574b42c25b3dc834
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
�^���#ZK��7��A�C`U�&�R���e`�U��v"S�DX�e�YP�w��P��|1��<�I��c4�1B�ʽ�*�n��o��X�r�_w�E�$h\q�r�v�?�vF�Bz��a���+�
|
1
|
+
�̖�9|�W�`�Be$����e��=��ӭ�Nz>e,���&T���c
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/event_nlp.rb
CHANGED
@@ -233,8 +233,36 @@ class EventNlp
|
|
233
233
|
|
234
234
|
end
|
235
235
|
|
236
|
+
# Group meeting Red Hall 2pm-4pm on Monday (4th Dec 2017)
|
237
|
+
get /^(.*)\s+(#{times2})(?: on) +(#{weekdays})(?: \(([^\)]+)\))?/i do |title, xtimes, raw_day, actual_date|
|
238
|
+
|
239
|
+
puts 'actual_date: ' + actual_date.inspect if @debug
|
240
|
+
puts 'raw_day: ' + raw_day.inspect if @debug
|
241
|
+
puts 'xtimes: ' + xtimes.inspect if @debug
|
242
|
+
|
243
|
+
input = params[:input].clone
|
244
|
+
|
245
|
+
if actual_date then
|
246
|
+
d = Chronic.parse actual_date
|
247
|
+
else
|
248
|
+
d = Chronic.parse(raw_day)
|
249
|
+
input.sub!(/#{weekdays}/i,%Q(#{raw_day} (#{d.strftime("#{d.day.ordinal} %b %Y")})))
|
250
|
+
end
|
251
|
+
|
252
|
+
t1, t2 = xtimes.split(/-/,2)
|
253
|
+
|
254
|
+
puts 'd: ' + d.inspect if @debug
|
255
|
+
|
256
|
+
d1, d2 = [t1, t2].map {|t| Chronic.parse([d.to_date.to_s, t].join(' ')) }
|
257
|
+
|
258
|
+
puts [4.65, input, title, raw_day, d1, d2].inspect if @debug
|
259
|
+
|
260
|
+
{input: input, title: title, date: d1, end_date: d2 }
|
261
|
+
|
262
|
+
end
|
236
263
|
|
237
264
|
# hall 2 friday at 11am
|
265
|
+
|
238
266
|
get /^(.*)\s+(#{weekdays})(?: \(([^\)]+)\))?(#{times})?/i do |title, raw_day, actual_date, time|
|
239
267
|
|
240
268
|
puts 'actual_date: ' + actual_date.inspect if @debug
|
@@ -250,7 +278,7 @@ class EventNlp
|
|
250
278
|
input.sub!(/#{weekdays}/i,%Q(#{raw_day} (#{d.strftime("#{d.day.ordinal} %b %Y")})))
|
251
279
|
end
|
252
280
|
|
253
|
-
puts '
|
281
|
+
puts 'd: ' + d.inspect if @debug
|
254
282
|
|
255
283
|
|
256
284
|
puts [1.7, input, title, raw_day].inspect if @debug
|
metadata
CHANGED
metadata.gz.sig
CHANGED