event_nlp 0.2.11 → 0.2.12
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 +18 -2
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6bd12bdaa5603fec5552ea339467cdabce44a47
|
4
|
+
data.tar.gz: aa8534ac2c9cbaa2caaeb5cb8711a011a4fc9f54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9483586440445991c2e6745ea364702636e1a16c123bd122ae7a393a33405d0164f7345d53bb4dc930b6338536a16684c46fceb8c16bbb6c2da1ee25f0899e1
|
7
|
+
data.tar.gz: cb980603815f2da3409446e34fa56beb03f06dc508533058b38db2f0a03938c643402c30248e0c55cfe8b35c5be7e2f7eeb18df8ad8fd3c72d48bc21706905ad
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/event_nlp.rb
CHANGED
@@ -65,12 +65,28 @@ class EventNlp
|
|
65
65
|
times = /(?: *(?:at |@ |from )?(\d+(?::\d+)?[ap]m) *)/
|
66
66
|
times2 = /\d+(?::\d+)?[ap]m-\d+(?::\d+)?[ap]m|\d+(?::\d+)?-\d+(?::\d+)?/
|
67
67
|
days = /\d+(?:st|nd|rd|th)/
|
68
|
+
periods = /day|week|month/
|
68
69
|
|
69
70
|
#weekdays = Date::DAYNAMES.join('|').downcase
|
70
71
|
#
|
71
72
|
#times = /(?: *at )?\d[ap]m/
|
72
|
-
|
73
73
|
|
74
|
+
# e.g. electricity bill on the 28th of every month
|
75
|
+
|
76
|
+
get /(.*) on the (#{days}) of every (#{periods})/ do |title, day, recurring|
|
77
|
+
|
78
|
+
|
79
|
+
d = Chronic.parse(day)
|
80
|
+
|
81
|
+
|
82
|
+
if @debug then
|
83
|
+
puts [0.1, title, recurring, d].inspect
|
84
|
+
end
|
85
|
+
|
86
|
+
{title: title, recurring: recurring, date: d}
|
87
|
+
|
88
|
+
end
|
89
|
+
|
74
90
|
|
75
91
|
get /^(.*)\s+(every \d\w+ \w+#{times})\s*#{starting}/ do \
|
76
92
|
|title, recurring, time, raw_date, end_date|
|
@@ -92,7 +108,7 @@ class EventNlp
|
|
92
108
|
end
|
93
109
|
|
94
110
|
if @debug then
|
95
|
-
puts [0, input, title, recurring, time, raw_date, end_date].inspect
|
111
|
+
puts [0.2, input, title, recurring, time, raw_date, end_date].inspect
|
96
112
|
end
|
97
113
|
|
98
114
|
{input: input, title: title, recurring: recurring, date: d,
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
X`-�����&��t�Fv)u��vя���B�&��D������b�|�F/6��O
|
2
|
+
�y�.��p�ҝ/�Ϩ���FCpɆ���l�G�l��dN�i��nT��NҚ�Y�}��|]e�*��j�r� Ԝ�X�@ �u0z�C�6=��2��a$h�]���˖2�3���ax�U�Me=��}�<�8��8P�t0x��F0-}TuF�\����Y�Y�$[I�� �^�Ļ8?'�%����Ν�
|