kotodama 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/kotodama.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'kaiseki'
2
2
 
3
3
  module Kotodama
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  file_path = File.dirname __FILE__
6
6
 
7
7
  #load base class mods
@@ -15,4 +15,4 @@ module Kotodama
15
15
 
16
16
  #load parser
17
17
  require file_path + '/kotodama_grammar'
18
- end
18
+ end
@@ -13,7 +13,7 @@ module Kotodama
13
13
  end
14
14
 
15
15
  rule :option do
16
- parses :LITERAL & '=>'.skip & :ATOM & ';'.skip
16
+ parses :LITERAL & '=>'.skip & (:ATOM | :INT) & ';'.skip
17
17
  node [:key, :value]
18
18
  action do
19
19
  @language.options[@key] = @value
data/lib/rule.rb CHANGED
@@ -10,7 +10,7 @@ module Kotodama
10
10
 
11
11
  def add expression, weight
12
12
  @expressions << expression
13
- @weights << (weight || 1)
13
+ @weights << (weight || @language.options['$rule_weight'] || 1)
14
14
  end
15
15
 
16
16
  def generate
data/lib/type.rb CHANGED
@@ -10,7 +10,7 @@ module Kotodama
10
10
 
11
11
  def add symbol, weight
12
12
  @symbols << symbol
13
- @weights << (weight || 1)
13
+ @weights << (weight || @language.options['$type_weight'] || 1)
14
14
  end
15
15
 
16
16
  def member? symbol
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 1
9
- version: 1.0.1
8
+ - 2
9
+ version: 1.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - William Hamilton-Levi
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-26 00:00:00 -05:00
17
+ date: 2011-02-02 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -48,7 +48,6 @@ files:
48
48
  - lib/mod_array.rb
49
49
  - lib/language.rb
50
50
  - lib/kotodama.rb
51
- - lib/kotodama.rb~
52
51
  - lib/kotodama_grammar.rb
53
52
  - README
54
53
  - bin/wordgen
data/lib/kotodama.rb~ DELETED
@@ -1,18 +0,0 @@
1
- require 'kaiseki'
2
-
3
- module Kotodama
4
- VERSION = '0.0.7'
5
- file_path = File.dirname __FILE__
6
-
7
- #load base class mods
8
- require file_path + '/mod_array'
9
-
10
- #load basic kotodama classes
11
- require file_path + '/language'
12
- require file_path + '/type'
13
- require file_path + '/rule'
14
- require file_path + '/change'
15
-
16
- #load parser
17
- require file_path + '/kotodama_grammar'
18
- end