xaiml 0.1.1 → 0.1.2
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/.gitignore +1 -0
- data/bin/console +1 -1
- data/lib/xaiml/document.rb +4 -4
- data/lib/xaiml/element/category.rb +1 -1
- data/lib/xaiml/element/condition.rb +1 -1
- data/lib/xaiml/element.rb +5 -0
- data/lib/xaiml/version.rb +1 -1
- data/lib/xaiml.rb +12 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebc987d33e8d51396d003669820a75e69babecbe4d8030c01e509e800e850adf
|
4
|
+
data.tar.gz: aa5a3e32a72532369b1405b6ceeea097b22d1804ac120a402659b5b7f619f8fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 138e8aa875d705d876c5b363179857541626d4072147640f70ca6bc8700d095ec04661056295c3c30673e270a51805b21a7a99ab43bb0e5ad9b26b7873032ed2
|
7
|
+
data.tar.gz: 2e84d6896fa6c14e1e4209ee1d44ae7773a6646602ca24e7458cc2ec3dfc660eab40db087d14bcbc62464c78e8d5f8b3e56f1bd2476b1fbb2b3d5ba1bb156579
|
data/.gitignore
CHANGED
data/bin/console
CHANGED
data/lib/xaiml/document.rb
CHANGED
@@ -17,7 +17,7 @@ module XAIML
|
|
17
17
|
aiml[:xmlns] = "http://www.nttdocomo.com/aiml/schema"
|
18
18
|
aiml[:'xmlns:html'] = "http://www.w3.org/1999/xhtml"
|
19
19
|
aiml[:'xmlns:xsi'] = "http://www.w3.org/2001/XMLSchema-instance"
|
20
|
-
aiml[:'xsi:schemaLocation'] = "http://www.nttdocomo.com/aiml/schema/
|
20
|
+
aiml[:'xsi:schemaLocation'] = "http://www.nttdocomo.com/aiml/schema/AIML.xsd"
|
21
21
|
@document << aiml
|
22
22
|
@element = aiml
|
23
23
|
end
|
@@ -47,10 +47,10 @@ module XAIML
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def allowed_object?(object)
|
50
|
-
|
51
|
-
return true
|
50
|
+
allowed_object = self.class.allowed_object
|
51
|
+
return true if !allowed_object || (object.is_a?(String) && object.empty?)
|
52
52
|
|
53
|
-
|
53
|
+
allowed_object.any? do |item|
|
54
54
|
item = XAIML.const_get(item) if item.is_a?(String)
|
55
55
|
object.is_a?(item)
|
56
56
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module XAIML
|
2
2
|
module Element
|
3
3
|
class Category < Base
|
4
|
-
@allowed_object = [XAIML::Element::Pattern, XAIML::Element::Template]
|
4
|
+
@allowed_object = [XAIML::Element::Pattern, XAIML::Element::Template, XAIML::Element::That]
|
5
5
|
def initialize(attributes = {}, patterns = nil, template = nil)
|
6
6
|
super(attributes)
|
7
7
|
append_child patterns if patterns
|
data/lib/xaiml/element.rb
CHANGED
@@ -7,6 +7,7 @@ module XAIML
|
|
7
7
|
class Get < Base; end
|
8
8
|
class Loop < Base; end
|
9
9
|
class Li < Base; end
|
10
|
+
class Matcher < Base; end
|
10
11
|
class Map < Base; end
|
11
12
|
class Name < Base; end
|
12
13
|
class Pattern < Base; end
|
@@ -16,8 +17,12 @@ module XAIML
|
|
16
17
|
class Sraix < Base; end
|
17
18
|
class Star < Base; end
|
18
19
|
class Template < Base; end
|
20
|
+
class That < Base; end
|
19
21
|
class Think < Base; end
|
20
22
|
class Value < Base; end
|
23
|
+
class Ub < Base; end
|
24
|
+
class Ut < Base; end
|
25
|
+
class Utterance < Base; end
|
21
26
|
|
22
27
|
autoload :Category, "xaiml/element/category"
|
23
28
|
autoload :Condition, "xaiml/element/condition"
|
data/lib/xaiml/version.rb
CHANGED
data/lib/xaiml.rb
CHANGED
@@ -2,8 +2,16 @@ require "xaiml/version"
|
|
2
2
|
require "xaiml/exceptions"
|
3
3
|
require "ox"
|
4
4
|
|
5
|
-
module
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
module XAIML
|
6
|
+
require "xaiml/document"
|
7
|
+
require "xaiml/element"
|
8
|
+
require "xaiml/exceptions"
|
9
|
+
require "xaiml/version"
|
10
|
+
|
11
|
+
Ox.default_options = {
|
12
|
+
indent: -1,
|
13
|
+
mode: :generic,
|
14
|
+
effort: :tolerant,
|
15
|
+
smart: true
|
16
|
+
}
|
9
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xaiml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jagrament
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ox
|