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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53e08647b8e240d081ace6865f4cd49ff1195cc6
4
- data.tar.gz: 765a6dddc50561c1b6533c422a9f5ec0ba83dd1f
3
+ metadata.gz: 54ba784176824a213dcdbd4ca421b388687fba9f
4
+ data.tar.gz: ed2a521afa3726671c01ecb62977c0b9b48ce203
5
5
  SHA512:
6
- metadata.gz: e95368e97d7c8ffdfaf13384b9da4e6b3bfa0aac91d119ad41379a124bb3537ac1a6e50d9b3163182fad1825763dfec06bb5f46ea814becefc247c913db9864c
7
- data.tar.gz: 56901f3d50338cb0b5a93198aff0c04b6eb94d55fd4675a978ebabee677b3fb42ec4b967ae80803e9495fbe613c161f0627f529b4cc9ab12a49fc291a182eaef
6
+ metadata.gz: d6b8bbe02b6a14f5a5b8f918995bae07aac3a867721570706a08572989a1bd6bb5014a965c8efd5b386046ac06292f24610c1d08c5a76409ed9e996e8351f083
7
+ data.tar.gz: b735297f5f76c702e6c9c177fc5a486926457dc2c33c288c452de2672a167517afa1d5769b6b31058d71bc4dabd836264c334dff7bd365ad574b42c25b3dc834
@@ -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
@@ -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 'foo' + d.inspect
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
@@ -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.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
@@ -1,4 +1 @@
1
- �9W�r�e�|�t®@%s�$��0�
2
- e�������P>�'��nS/s��Զ�`��Ӷ������ua�P'렏��0�� IA���gZ�-����
3
- U'��W���)�����C@�s�6GL.�ɜ%��U��k K�U8�e��e��=vF�ԛ�b�g��?2g:��"�S�����
4
- ����ɋ�<Ω�R�^�k��
1
+ +��iq-nɼUɶ�����y�U