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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/event_nlp.rb +21 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34bd0366a4fd2bc97bf23dfaa4811bbf7b1add8b682c4a12133bacad71fe1126
|
4
|
+
data.tar.gz: d55983a0b2b70f388d1e1d06b0bf884d38c907c80045afe79c5542f346ecf864
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
metadata.gz.sig
CHANGED
Binary file
|