event_nlp 0.6.1 → 0.6.2

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
  SHA256:
3
- metadata.gz: c4ec4582a9a97efbf6e4b24803edb1675c8cc8bbcdff692b90472502bfd71c1e
4
- data.tar.gz: 63226f49c9ad8b5f2219cc8506152c5ddaed21e97e0e7c6e55c017bc83d3e644
3
+ metadata.gz: 34bd0366a4fd2bc97bf23dfaa4811bbf7b1add8b682c4a12133bacad71fe1126
4
+ data.tar.gz: d55983a0b2b70f388d1e1d06b0bf884d38c907c80045afe79c5542f346ecf864
5
5
  SHA512:
6
- metadata.gz: eab396db7a03c0416d71eb911d4bd35d573f33a265c8aa773dcbbf45368a8702df0f695701ee3f2472c084106de6c60d3aee5826e68ec8c032770be191db7a76
7
- data.tar.gz: b70f2239f852026b7b3559c0814c331be502a47410ecdf8808646faec727c5adc17e282d8d9159c2bf4658d2ce03ddf161d0b84433b95cbe529658cf965b0b29
6
+ metadata.gz: be80fc3036e3944e2dd50bfa4efa8d63ddd0bc09093b10fd8d8504f79da261d59a020b0277d679142c6bd185faa9f18e16bddd89da11c7123a649de73aad57dc
7
+ data.tar.gz: d050f6ab6363fe62b40240a821ab4a6aaa554b78fba9d2ed9126581dc705bcf799cbce42cc24c8bdd6a8778c07d40762c457a460090e5f661f5af1c9c47b3e79
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/event_nlp.rb CHANGED
@@ -7,7 +7,6 @@ require 'ostruct'
7
7
  require 'app-routes'
8
8
 
9
9
 
10
-
11
10
  module Ordinals
12
11
 
13
12
  refine Integer do
@@ -66,6 +65,27 @@ class EventNlp
66
65
 
67
66
  end
68
67
 
68
+ # returns an Array object of dates, projected from a recurring event
69
+ #
70
+ def project(s, year: Time.now.year)
71
+
72
+ r = parse s
73
+ dates = []
74
+ now = @now
75
+
76
+ while r.date.year == year.to_i do
77
+
78
+ dates << r.date
79
+ @now = r.date + 1
80
+ r = parse(r.input)
81
+
82
+ end
83
+
84
+ @now = now
85
+ return dates
86
+
87
+ end
88
+
69
89
  private
70
90
 
71
91
  def expressions(params)
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.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file