natter 0.1.2 → 0.1.3
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 +4 -4
- data/lib/natter/parser.rb +4 -1
- data/lib/natter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e82826a5f958086cdf0af5610b338c96485193d7
|
4
|
+
data.tar.gz: abcc661c8395a04a9b6efe86ac34d97ecd94e476
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 989c2bf070947318c652f982308b36af1c54ba65f50f0ff58a7e8949bbb7c2427bcef167e572c01188ab3937a0a6a9d961686f8a7bdd90393d70060eae4caae3
|
7
|
+
data.tar.gz: d3ba8862c8cc6950c41ea17bc5f3cc88febbb16eb8f03059385a79d5012ec872509d92183448a9b3f3356e7be559083d59cb6dd56226baae52f1bcddd215d624
|
data/lib/natter/parser.rb
CHANGED
@@ -2,6 +2,9 @@ module Natter
|
|
2
2
|
# Public: The parser is the main workhorse, responsible for deriving the
|
3
3
|
# intent from an utterance.
|
4
4
|
class Parser
|
5
|
+
# Read access to the Hash containing known rules.
|
6
|
+
attr_reader :rules
|
7
|
+
|
5
8
|
def initialize
|
6
9
|
@known_utterances = Hash.new # key = utterance, value = Intent
|
7
10
|
@contractions = init_contractions # key = contraction, value = expansion
|
@@ -32,7 +35,7 @@ module Natter
|
|
32
35
|
add_rule(rules)
|
33
36
|
end
|
34
37
|
end
|
35
|
-
|
38
|
+
|
36
39
|
# Public: Adds a pre-computed utterance/intent pair to the parser.
|
37
40
|
# Used when a specific utterance(s) match a predetermined intent. This saves
|
38
41
|
# overhead as there is no regex processing required. These utterances are
|
data/lib/natter/version.rb
CHANGED