event_nlp 0.6.6 → 0.6.7

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
  SHA256:
3
- metadata.gz: a841e6980bb14291c3a224491b761e57f6966260c3b11e6e8a78eb121c37220b
4
- data.tar.gz: 9d7686cde4d18d14bfb9b35d29ae2a268423c396c4decb6a5bf4c8e9541df8a1
3
+ metadata.gz: 246bf075ca72ce30cb7a2d8742909e72165b30a607de948cff0c69f031cc333e
4
+ data.tar.gz: 5634642b23bb6b0dd5c5b6e411efb521929ca8e66808cf26a1503023777b7130
5
5
  SHA512:
6
- metadata.gz: a000f3bcffe7f4388a75e3aab7de09fa6f01bf63bf673c3c6faca9a041603dd2ccd21af608008493d8f2c6c3b9547bc6aad7e45b79ef882740f195ddd8b0b2c1
7
- data.tar.gz: ac5744ba228a291483b2bf52a2688d07d3516d46ca951edf982fa5e4ca8fde6e7cb53647d723f5067c807a03a765bf5d2a93ad0e901962b6c2283ecc6c490b11
6
+ metadata.gz: b692393ba9b24a0378afd6ce9c965e8f0e481374d76365824c645b1b28c10cbfe430a952ddceaceb5d8875d2b6f373b2fbeafda3fa3e27185d32efcfb39d17f6
7
+ data.tar.gz: f75b6af7438aa329f57c074d47542e3c81318fa79d79bed033055f9ce569e8e25a211e2e08cb70c5341e550a0fd8473416787793b658aea2046dd2c51b60a3c4
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/event_nlp.rb CHANGED
@@ -107,6 +107,18 @@ class EventNlp
107
107
  s = raws.sub(pattern, s2)
108
108
  end
109
109
 
110
+ months = (Date::MONTHNAMES + Date::ABBR_MONTHNAMES).join('|').downcase
111
+
112
+ # the following would be ambiguous input, but we will assume they
113
+ # meant the 14th day of every month
114
+ # e.g. "Cafe meeting 14th May Monthly"
115
+ found = raws.match(/(?<title>.*)\s+(?<day>\w+(?:st|nd|rd|th)) (#{months}) monthly/i)
116
+
117
+ if found then
118
+ s = "%s on the %s of every month" % [found[:title],
119
+ found[:day].to_i.ordinal]
120
+ end
121
+
110
122
  # e.g. "Cafe meeting 14th Monthly" =>
111
123
  # Cafe meeting on the 14th of every month
112
124
  #
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.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  w8lJ+I6Lqqr5GpsweOnEHW4w200sMRD40u8qmGHrqirihL2KrwTD6A9UObvA5AxZ
36
36
  4Z4EPvKg+3jsK9Gv3GGSLdrD
37
37
  -----END CERTIFICATE-----
38
- date: 2022-04-03 00:00:00.000000000 Z
38
+ date: 2022-05-03 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: chronic_cron
metadata.gz.sig CHANGED
Binary file