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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d8d8d96368bc5b2f3580ada19c0fdee83958113ac397386dacc31403618cb5d
4
- data.tar.gz: 1c3cb22ac8a593a0338c8283c6ab285b33fc3fb8583aeb5df49d7b414f7b7e9c
3
+ metadata.gz: ebc987d33e8d51396d003669820a75e69babecbe4d8030c01e509e800e850adf
4
+ data.tar.gz: aa5a3e32a72532369b1405b6ceeea097b22d1804ac120a402659b5b7f619f8fb
5
5
  SHA512:
6
- metadata.gz: 6fbb81d24916ee1ed88ef787bc4af05285a6f91321f2c1d67a64f77e812129080a3c945c7279643b6bff9c0b38f31b5be9fa6800ea6982f7246a074cff6b166e
7
- data.tar.gz: e08634fe6dc8de4f096b6925ecc745b25dff0f9f615ff2f775567d2d5bbeb8b97942c3e4da7d63853799c3d8c81296875a9920168366fd19b4aabd7b77f76bd2
6
+ metadata.gz: 138e8aa875d705d876c5b363179857541626d4072147640f70ca6bc8700d095ec04661056295c3c30673e270a51805b21a7a99ab43bb0e5ad9b26b7873032ed2
7
+ data.tar.gz: 2e84d6896fa6c14e1e4209ee1d44ae7773a6646602ca24e7458cc2ec3dfc660eab40db087d14bcbc62464c78e8d5f8b3e56f1bd2476b1fbb2b3d5ba1bb156579
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /vender/
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "xaiml-ruby"
4
+ require "xaiml"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -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/XAIML.xsd"
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
- ao = self.class.allowed_object
51
- return true unless ao
50
+ allowed_object = self.class.allowed_object
51
+ return true if !allowed_object || (object.is_a?(String) && object.empty?)
52
52
 
53
- ao.any? do |item|
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
@@ -1,7 +1,7 @@
1
1
  module XAIML
2
2
  module Element
3
3
  class Condition < Base
4
- @allowed_object = [XAIML::Element::Li]
4
+ @allowed_object = [XAIML::Element::Li, XAIML::Element::Name, XAIML::Element::Value]
5
5
  end
6
6
  end
7
7
  end
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
@@ -1,3 +1,3 @@
1
1
  module XAIML
2
- VERSION = "0.1.1".freeze
2
+ VERSION = "0.1.2".freeze
3
3
  end
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 XXAIML
6
- Dir[File.expand_path("xaiml", __dir__) << "/*.rb"].each do |file|
7
- require file
8
- end
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.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: 2018-09-27 00:00:00.000000000 Z
11
+ date: 2019-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ox