megahal 1.0.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 252805da87a415ea17e3b54cf32566b05f337377
4
- data.tar.gz: 259795c442f454cb8431dfd904929d6da05f7cc0
3
+ metadata.gz: 48fcb4631d15527c3db8699baeb01f8fd0a4e2c3
4
+ data.tar.gz: 5fe03f6b1a035bd3cdf56a8d6427ae63ac6d6f42
5
5
  SHA512:
6
- metadata.gz: 3dbb14e46d816afb9edd457656ba24b375ddc73d1e627073cbb194cf11845366c91e7bc7fad539fe163761d34bf1a8edaccb9d6b705cd5f21c88c4a2263f76ba
7
- data.tar.gz: ba30c35f58e8bd3d4621c80359fd08eacdb2fe0e4534ecae1444e8637771817d16c0b61b440aaafce2cd399a6739e2d15c1bca4d485b895b7ec79495799c51ef
6
+ metadata.gz: 7d21d82961058292a3791fe489ba6cc72a3ed290f6bb7f419f640248577aef62369698aff5c79c90474f4e989da216393ba37e4f517a30e2aaf500a55d47b2a2
7
+ data.tar.gz: 273a06ea5ffda6bed59344e33d12d2f294fda565fb4d88ca40b99c04c6b23f1cffe4c6a4720c9062264f673513957c4e6632acb46b5aa744c6174e2e92629fa3
@@ -1,11 +1,12 @@
1
1
  # Change Log
2
2
 
3
- ## [v1.0.3](https://github.com/jasonhutchens/megahal/tree/v1.0.3) (2015-05-26)
3
+ ## [v1.0.4](https://github.com/jasonhutchens/megahal/tree/v1.0.4) (2015-10-03)
4
+ [Full Changelog](https://github.com/jasonhutchens/megahal/compare/v1.0.3...v1.0.4)
4
5
 
6
+ ## [v1.0.3](https://github.com/jasonhutchens/megahal/tree/v1.0.3) (2015-05-26)
5
7
  [Full Changelog](https://github.com/jasonhutchens/megahal/compare/v1.0.2...v1.0.3)
6
8
 
7
9
  ## [v1.0.2](https://github.com/jasonhutchens/megahal/tree/v1.0.2) (2015-05-26)
8
-
9
10
  [Full Changelog](https://github.com/jasonhutchens/megahal/compare/v1.0.1...v1.0.2)
10
11
 
11
12
  **Closed issues:**
@@ -13,19 +14,15 @@
13
14
  - Test Issue [\#1](https://github.com/jasonhutchens/megahal/issues/1)
14
15
 
15
16
  ## [v1.0.1](https://github.com/jasonhutchens/megahal/tree/v1.0.1) (2014-12-22)
16
-
17
17
  [Full Changelog](https://github.com/jasonhutchens/megahal/compare/v1.0.0...v1.0.1)
18
18
 
19
19
  ## [v1.0.0](https://github.com/jasonhutchens/megahal/tree/v1.0.0) (2014-12-17)
20
-
21
20
  [Full Changelog](https://github.com/jasonhutchens/megahal/compare/v0.5.0...v1.0.0)
22
21
 
23
22
  ## [v0.5.0](https://github.com/jasonhutchens/megahal/tree/v0.5.0) (2014-12-17)
24
-
25
23
  [Full Changelog](https://github.com/jasonhutchens/megahal/compare/v0.4.0...v0.5.0)
26
24
 
27
25
  ## [v0.4.0](https://github.com/jasonhutchens/megahal/tree/v0.4.0) (2014-12-17)
28
26
 
29
27
 
30
-
31
28
  \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'sooth', '~> 1.0'
3
+ gem 'sooth', '~> 2.0'
4
4
  gem 'highline', '~> 1.7'
5
5
  gem 'ruby-progressbar', '~> 1.7'
6
6
  gem 'rubyzip', '~> 1.1'
@@ -13,6 +13,6 @@ group :development do
13
13
  gem 'bundler', '~> 1.7'
14
14
  gem 'jeweler', '~> 2.0'
15
15
  gem 'simplecov', '~> 0.10'
16
- gem 'byebug', '~> 6.0'
16
+ gem 'byebug', '~> 8.2'
17
17
  gem 'github_changelog_generator', '~> 1.4'
18
18
  end
@@ -1,9 +1,12 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- addressable (2.3.8)
4
+ addressable (2.4.0)
5
+ ast (2.2.0)
5
6
  builder (3.2.2)
6
- byebug (6.0.2)
7
+ byebug (8.2.2)
8
+ childprocess (0.5.9)
9
+ ffi (~> 1.0, >= 1.0.11)
7
10
  cld (0.7.0)
8
11
  ffi
9
12
  colorize (0.7.7)
@@ -11,24 +14,29 @@ GEM
11
14
  thread_safe (~> 0.3, >= 0.3.1)
12
15
  diff-lcs (1.2.5)
13
16
  docile (1.1.5)
14
- faraday (0.9.1)
17
+ faraday (0.9.2)
15
18
  multipart-post (>= 1.2, < 3)
16
19
  ffi (1.9.10)
17
- git (1.2.9.1)
18
- github_api (0.12.4)
19
- addressable (~> 2.3)
20
+ git (1.3.0)
21
+ github_api (0.13.1)
22
+ addressable (~> 2.4.0)
20
23
  descendants_tracker (~> 0.0.4)
21
24
  faraday (~> 0.8, < 0.10)
22
25
  hashie (>= 3.4)
23
26
  multi_json (>= 1.7.5, < 2.0)
24
- nokogiri (~> 1.6.6)
25
27
  oauth2
26
- github_changelog_generator (1.9.0)
28
+ github_changelog_generator (1.12.0)
29
+ bundler (>= 1.7)
27
30
  colorize (~> 0.7)
28
31
  github_api (~> 0.12)
29
- hashie (3.4.2)
30
- highline (1.7.7)
31
- jeweler (2.0.1)
32
+ overcommit (>= 0.31)
33
+ rake (>= 10.0)
34
+ rspec (>= 3.2)
35
+ rubocop (>= 0.31)
36
+ hashie (3.4.3)
37
+ highline (1.7.8)
38
+ iniparse (1.4.2)
39
+ jeweler (2.1.1)
32
40
  builder
33
41
  bundler (>= 1.0)
34
42
  git (>= 1.2.5)
@@ -37,45 +45,62 @@ GEM
37
45
  nokogiri (>= 1.5.10)
38
46
  rake
39
47
  rdoc
48
+ semver
40
49
  json (1.8.3)
41
50
  jwt (1.5.1)
42
- mini_portile (0.6.2)
51
+ mini_portile2 (2.0.0)
43
52
  multi_json (1.11.2)
44
53
  multi_xml (0.5.5)
45
54
  multipart-post (2.0.0)
46
- nokogiri (1.6.6.2)
47
- mini_portile (~> 0.6.0)
48
- oauth2 (1.0.0)
55
+ nokogiri (1.6.7.2)
56
+ mini_portile2 (~> 2.0.0.rc2)
57
+ oauth2 (1.1.0)
49
58
  faraday (>= 0.8, < 0.10)
50
- jwt (~> 1.0)
59
+ jwt (~> 1.0, < 1.5.2)
51
60
  multi_json (~> 1.3)
52
61
  multi_xml (~> 0.5)
53
- rack (~> 1.2)
62
+ rack (>= 1.2, < 3)
63
+ overcommit (0.33.0)
64
+ childprocess (~> 0.5.8)
65
+ iniparse (~> 1.4)
66
+ parser (2.3.0.7)
67
+ ast (~> 2.2)
68
+ powerpack (0.1.1)
54
69
  rack (1.6.4)
55
- rake (10.4.2)
56
- rdoc (4.2.0)
57
- rspec (3.3.0)
58
- rspec-core (~> 3.3.0)
59
- rspec-expectations (~> 3.3.0)
60
- rspec-mocks (~> 3.3.0)
61
- rspec-core (3.3.2)
62
- rspec-support (~> 3.3.0)
63
- rspec-expectations (3.3.1)
70
+ rainbow (2.1.0)
71
+ rake (11.1.2)
72
+ rdoc (4.2.2)
73
+ json (~> 1.4)
74
+ rspec (3.4.0)
75
+ rspec-core (~> 3.4.0)
76
+ rspec-expectations (~> 3.4.0)
77
+ rspec-mocks (~> 3.4.0)
78
+ rspec-core (3.4.4)
79
+ rspec-support (~> 3.4.0)
80
+ rspec-expectations (3.4.0)
64
81
  diff-lcs (>= 1.2.0, < 2.0)
65
- rspec-support (~> 3.3.0)
66
- rspec-mocks (3.3.2)
82
+ rspec-support (~> 3.4.0)
83
+ rspec-mocks (3.4.1)
67
84
  diff-lcs (>= 1.2.0, < 2.0)
68
- rspec-support (~> 3.3.0)
69
- rspec-support (3.3.0)
85
+ rspec-support (~> 3.4.0)
86
+ rspec-support (3.4.1)
87
+ rubocop (0.39.0)
88
+ parser (>= 2.3.0.7, < 3.0)
89
+ powerpack (~> 0.1)
90
+ rainbow (>= 1.99.1, < 3.0)
91
+ ruby-progressbar (~> 1.7)
92
+ unicode-display_width (~> 1.0, >= 1.0.1)
70
93
  ruby-progressbar (1.7.5)
71
- rubyzip (1.1.7)
72
- simplecov (0.10.0)
94
+ rubyzip (1.2.0)
95
+ semver (1.0.1)
96
+ simplecov (0.11.2)
73
97
  docile (~> 1.1.0)
74
98
  json (~> 1.8)
75
99
  simplecov-html (~> 0.10.0)
76
100
  simplecov-html (0.10.0)
77
- sooth (1.0.3)
101
+ sooth (2.0.0)
78
102
  thread_safe (0.3.5)
103
+ unicode-display_width (1.0.3)
79
104
  yard (0.8.7.6)
80
105
 
81
106
  PLATFORMS
@@ -83,7 +108,7 @@ PLATFORMS
83
108
 
84
109
  DEPENDENCIES
85
110
  bundler (~> 1.7)
86
- byebug (~> 6.0)
111
+ byebug (~> 8.2)
87
112
  cld (~> 0.7)
88
113
  github_changelog_generator (~> 1.4)
89
114
  highline (~> 1.7)
@@ -93,8 +118,8 @@ DEPENDENCIES
93
118
  ruby-progressbar (~> 1.7)
94
119
  rubyzip (~> 1.1)
95
120
  simplecov (~> 0.10)
96
- sooth (~> 1.0)
121
+ sooth (~> 2.0)
97
122
  yard (~> 0.8)
98
123
 
99
124
  BUNDLED WITH
100
- 1.10.5
125
+ 1.11.2
data/README.md CHANGED
@@ -184,4 +184,4 @@ Have fun!
184
184
  Copyright
185
185
  ---------
186
186
 
187
- Copyright (c) 2014 Jason Hutchens. See UNLICENSE for further details.
187
+ Copyright (c) 2016 Jason Hutchens. See UNLICENSE for further details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.4
1
+ 2.0.0
@@ -31,6 +31,7 @@ class MegaHAL
31
31
  @case.clear
32
32
  @punc.clear
33
33
  @dictionary = { "<error>" => 0, "<fence>" => 1, "<blank>" => 2 }
34
+ @brain = {}
34
35
  nil
35
36
  end
36
37
 
@@ -112,11 +113,13 @@ class MegaHAL
112
113
  bar.total = 6 unless bar.nil?
113
114
  Zip::File.open(filename, Zip::File::CREATE) do |zipfile|
114
115
  zipfile.get_output_stream("dictionary") do |file|
115
- file.write({
116
- version: 'MH10',
116
+ data = {
117
+ version: 'MH11',
117
118
  learning: @learning,
119
+ brain: @brain,
118
120
  dictionary: @dictionary
119
- }.to_json)
121
+ }
122
+ file.write(Marshal::dump(data))
120
123
  end
121
124
  bar.increment unless bar.nil?
122
125
  [:seed, :fore, :back, :case, :punc].each do |name|
@@ -135,10 +138,11 @@ class MegaHAL
135
138
  def load(filename, bar = nil)
136
139
  bar.total = 6 unless bar.nil?
137
140
  Zip::File.open(filename) do |zipfile|
138
- data = JSON.parse(zipfile.find_entry("dictionary").get_input_stream.read)
139
- raise "bad version" unless data['version'] == "MH10"
140
- @learning = data['learning']
141
- @dictionary = data['dictionary']
141
+ data = Marshal::load(zipfile.find_entry("dictionary").get_input_stream.read)
142
+ raise "bad version" unless data[:version] == "MH11"
143
+ @learning = data[:learning]
144
+ @brain = data[:brain]
145
+ @dictionary = data[:dictionary]
142
146
  bar.increment unless bar.nil?
143
147
  [:seed, :fore, :back, :case, :punc].each do |name|
144
148
  tmp = _get_tmp_filename(name)
@@ -195,9 +199,11 @@ class MegaHAL
195
199
  prev = 1
196
200
  (norm_symbols + [1]).each do |norm|
197
201
  context = [prev, 2]
198
- @seed.observe(context, norm)
202
+ id = @brain[context.dup] ||= @brain.length
203
+ @seed.observe(id, norm)
199
204
  context = [2, norm]
200
- @seed.observe(context, prev)
205
+ id = @brain[context.dup] ||= @brain.length
206
+ @seed.observe(id, prev)
201
207
  prev = norm
202
208
  end
203
209
 
@@ -207,11 +213,13 @@ class MegaHAL
207
213
  # special <fence> symbol (which has ID 1) is used to delimit the utterance.
208
214
  context = [1, 1]
209
215
  norm_symbols.each do |norm|
210
- @fore.observe(context, norm)
216
+ id = @brain[context.dup] ||= @brain.length
217
+ @fore.observe(id, norm)
211
218
  context << norm
212
219
  context.shift
213
220
  end
214
- @fore.observe(context, 1)
221
+ id = @brain[context.dup] ||= @brain.length
222
+ @fore.observe(id, 1)
215
223
 
216
224
  # The @back model is similar to the @fore model; it simply operates in the
217
225
  # opposite direction. This is how the original MegaHAL was able to generate
@@ -220,11 +228,13 @@ class MegaHAL
220
228
  # the gaps towards the beginning of the sentence.
221
229
  context = [1, 1]
222
230
  norm_symbols.reverse.each do |norm|
223
- @back.observe(context, norm)
231
+ id = @brain[context.dup] ||= @brain.length
232
+ @back.observe(id, norm)
224
233
  context << norm
225
234
  context.shift
226
235
  end
227
- @back.observe(context, 1)
236
+ id = @brain[context.dup] ||= @brain.length
237
+ @back.observe(id, 1)
228
238
 
229
239
  # The previous three models were all learning the sequence of norms, which
230
240
  # are capitalised words. When we generate a reply, we want to rewrite it so
@@ -233,7 +243,8 @@ class MegaHAL
233
243
  context = [1, 1]
234
244
  word_symbols.zip(norm_symbols).each do |word, norm|
235
245
  context[1] = norm
236
- @case.observe(context, word)
246
+ id = @brain[context.dup] ||= @brain.length
247
+ @case.observe(id, word)
237
248
  context[0] = word
238
249
  end
239
250
 
@@ -245,7 +256,8 @@ class MegaHAL
245
256
  punc_symbols.zip(word_symbols + [1]).each do |punc, word|
246
257
  context << word
247
258
  context.shift
248
- @punc.observe(context, punc)
259
+ id = @brain[context.dup] ||= @brain.length
260
+ @punc.observe(id, punc)
249
261
  end
250
262
  end
251
263
 
@@ -294,10 +306,12 @@ class MegaHAL
294
306
  # Use the @seed model to find two contexts that contain the keyword.
295
307
  contexts = [[2, keyword], [keyword, 2]]
296
308
  contexts.map! do |context|
297
- count = @seed.count(context)
309
+ id = @brain[context.dup] ||= @brain.length
310
+ count = @seed.count(id)
298
311
  if count > 0
299
- limit = @seed.count(context)
300
- context[context.index(2)] = @seed.select(context, limit)
312
+ id = @brain[context.dup] ||= @brain.length
313
+ limit = @seed.count(id)
314
+ context[context.index(2)] = @seed.select(id, limit)
301
315
  context
302
316
  else
303
317
  nil
@@ -329,13 +343,15 @@ class MegaHAL
329
343
  def _random_walk(model, static_context, keyword_symbols)
330
344
  context = static_context.dup
331
345
  results = []
332
- return [] if model.count(context) == 0
346
+ id = @brain[context.dup] ||= @brain.length
347
+ return [] if model.count(id) == 0
333
348
  local_keywords = keyword_symbols.dup
334
349
  loop do
335
350
  symbol = 0
336
351
  10.times do
337
- limit = rand(model.count(context)) + 1
338
- symbol = model.select(context, limit)
352
+ id = @brain[context.dup] ||= @brain.length
353
+ limit = rand(model.count(id)) + 1
354
+ symbol = model.select(id, limit)
339
355
  if local_keywords.include?(symbol)
340
356
  local_keywords.delete(symbol)
341
357
  break
@@ -373,7 +389,8 @@ class MegaHAL
373
389
  context = [1, 1]
374
390
  utterance.each do |norm|
375
391
  if keyword_symbols.include?(norm)
376
- surprise = @fore.surprise(context, norm)
392
+ id = @brain[context.dup] ||= @brain.length
393
+ surprise = @fore.surprise(id, norm)
377
394
  score += surprise unless surprise.nil?
378
395
  end
379
396
  context << norm
@@ -383,7 +400,8 @@ class MegaHAL
383
400
  context = [1, 1]
384
401
  utterance.reverse.each do |norm|
385
402
  if keyword_symbols.include?(norm)
386
- surprise = @back.surprise(context, norm)
403
+ id = @brain[context.dup] ||= @brain.length
404
+ surprise = @back.surprise(id, norm)
387
405
  score += surprise unless surprise.nil?
388
406
  end
389
407
  context << norm
@@ -429,16 +447,18 @@ class MegaHAL
429
447
  # what was observed previously.
430
448
  context[0] = (i == 0) ? 1 : word_symbols[i-1]
431
449
  context[1] = norm_symbols[i]
432
- count = @case.count(context)
450
+ id = @brain[context.dup] ||= @brain.length
451
+ count = @case.count(id)
433
452
  unless failed = (count == 0)
434
453
  limit = rand(count) + 1
435
- word_symbols << @case.select(context, limit)
454
+ word_symbols << @case.select(id, limit)
436
455
  end
437
456
  if (word_symbols.length == norm_symbols.length)
438
457
  # We need to check that the final word has been previously observed.
439
458
  context[0] = word_symbols.last
440
459
  context[1] = 1
441
- failed = (@punc.count(context) == 0)
460
+ id = @brain[context.dup] ||= @brain.length
461
+ failed = (@punc.count(id) == 0)
442
462
  end
443
463
  if failed
444
464
  retries += 1
@@ -458,8 +478,9 @@ class MegaHAL
458
478
  (word_symbols + [1]).each do |word|
459
479
  context << word
460
480
  context.shift
461
- limit = rand(@punc.count(context)) + 1
462
- punc_symbols << @punc.select(context, limit)
481
+ id = @brain[context.dup] ||= @brain.length
482
+ limit = rand(@punc.count(id)) + 1
483
+ punc_symbols << @punc.select(id, limit)
463
484
  end
464
485
 
465
486
  # Finally we zip the word-separators and the words together, decode the
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: megahal 1.0.4 ruby lib
5
+ # stub: megahal 2.0.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "megahal"
9
- s.version = "1.0.4"
9
+ s.version = "2.0.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Jason Hutchens"]
14
- s.date = "2015-10-03"
14
+ s.date = "2016-04-06"
15
15
  s.description = "Have a weird conversation with a computer."
16
16
  s.email = "jasonhutchens@gmail.com"
17
17
  s.executables = ["megahal"]
@@ -58,7 +58,7 @@ Gem::Specification.new do |s|
58
58
  s.specification_version = 4
59
59
 
60
60
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
61
- s.add_runtime_dependency(%q<sooth>, ["~> 1.0"])
61
+ s.add_runtime_dependency(%q<sooth>, ["~> 2.0"])
62
62
  s.add_runtime_dependency(%q<highline>, ["~> 1.7"])
63
63
  s.add_runtime_dependency(%q<ruby-progressbar>, ["~> 1.7"])
64
64
  s.add_runtime_dependency(%q<rubyzip>, ["~> 1.1"])
@@ -69,10 +69,10 @@ Gem::Specification.new do |s|
69
69
  s.add_development_dependency(%q<bundler>, ["~> 1.7"])
70
70
  s.add_development_dependency(%q<jeweler>, ["~> 2.0"])
71
71
  s.add_development_dependency(%q<simplecov>, ["~> 0.10"])
72
- s.add_development_dependency(%q<byebug>, ["~> 6.0"])
72
+ s.add_development_dependency(%q<byebug>, ["~> 8.2"])
73
73
  s.add_development_dependency(%q<github_changelog_generator>, ["~> 1.4"])
74
74
  else
75
- s.add_dependency(%q<sooth>, ["~> 1.0"])
75
+ s.add_dependency(%q<sooth>, ["~> 2.0"])
76
76
  s.add_dependency(%q<highline>, ["~> 1.7"])
77
77
  s.add_dependency(%q<ruby-progressbar>, ["~> 1.7"])
78
78
  s.add_dependency(%q<rubyzip>, ["~> 1.1"])
@@ -83,11 +83,11 @@ Gem::Specification.new do |s|
83
83
  s.add_dependency(%q<bundler>, ["~> 1.7"])
84
84
  s.add_dependency(%q<jeweler>, ["~> 2.0"])
85
85
  s.add_dependency(%q<simplecov>, ["~> 0.10"])
86
- s.add_dependency(%q<byebug>, ["~> 6.0"])
86
+ s.add_dependency(%q<byebug>, ["~> 8.2"])
87
87
  s.add_dependency(%q<github_changelog_generator>, ["~> 1.4"])
88
88
  end
89
89
  else
90
- s.add_dependency(%q<sooth>, ["~> 1.0"])
90
+ s.add_dependency(%q<sooth>, ["~> 2.0"])
91
91
  s.add_dependency(%q<highline>, ["~> 1.7"])
92
92
  s.add_dependency(%q<ruby-progressbar>, ["~> 1.7"])
93
93
  s.add_dependency(%q<rubyzip>, ["~> 1.1"])
@@ -98,7 +98,7 @@ Gem::Specification.new do |s|
98
98
  s.add_dependency(%q<bundler>, ["~> 1.7"])
99
99
  s.add_dependency(%q<jeweler>, ["~> 2.0"])
100
100
  s.add_dependency(%q<simplecov>, ["~> 0.10"])
101
- s.add_dependency(%q<byebug>, ["~> 6.0"])
101
+ s.add_dependency(%q<byebug>, ["~> 8.2"])
102
102
  s.add_dependency(%q<github_changelog_generator>, ["~> 1.4"])
103
103
  end
104
104
  end
@@ -20,22 +20,24 @@ describe MegaHAL do
20
20
 
21
21
  describe "#clear" do
22
22
  it "clears all internal state" do
23
- expect(megahal.instance_variables.length).to eq(7)
23
+ expect(megahal.instance_variables.length).to eq(8)
24
24
  megahal.clear
25
25
  megahal.reply("one two three four five")
26
26
  expect(megahal.instance_variable_get(:@dictionary).length).to eq(15)
27
- expect(megahal.instance_variable_get(:@seed).count([1, 2])).to be > 0
28
- expect(megahal.instance_variable_get(:@fore).count([1, 1])).to be > 0
29
- expect(megahal.instance_variable_get(:@back).count([1, 1])).to be > 0
30
- expect(megahal.instance_variable_get(:@case).count([1, 5])).to be > 0
31
- expect(megahal.instance_variable_get(:@punc).count([1, 10])).to be > 0
27
+ expect(megahal.instance_variable_get(:@brain).length).to eq(33)
28
+ expect(megahal.instance_variable_get(:@seed).count(1)).to be > 0
29
+ expect(megahal.instance_variable_get(:@fore).count(0)).to be > 0
30
+ expect(megahal.instance_variable_get(:@back).count(0)).to be > 0
31
+ expect(megahal.instance_variable_get(:@case).count(13)).to be > 0
32
+ expect(megahal.instance_variable_get(:@punc).count(27)).to be > 0
32
33
  megahal.clear
33
34
  expect(megahal.instance_variable_get(:@dictionary).length).to eq(3)
34
- expect(megahal.instance_variable_get(:@seed).count([0, 0])).to eq(0)
35
- expect(megahal.instance_variable_get(:@fore).count([1, 1])).to eq(0)
36
- expect(megahal.instance_variable_get(:@back).count([1, 1])).to eq(0)
37
- expect(megahal.instance_variable_get(:@case).count([1, 5])).to eq(0)
38
- expect(megahal.instance_variable_get(:@punc).count([1, 10])).to eq(0)
35
+ expect(megahal.instance_variable_get(:@brain).length).to eq(0)
36
+ expect(megahal.instance_variable_get(:@seed).count(1)).to eq(0)
37
+ expect(megahal.instance_variable_get(:@fore).count(0)).to eq(0)
38
+ expect(megahal.instance_variable_get(:@back).count(0)).to eq(0)
39
+ expect(megahal.instance_variable_get(:@case).count(13)).to eq(0)
40
+ expect(megahal.instance_variable_get(:@punc).count(27)).to eq(0)
39
41
  end
40
42
  end
41
43
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: megahal
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Hutchens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-03 00:00:00.000000000 Z
11
+ date: 2016-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sooth
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: highline
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '6.0'
173
+ version: '8.2'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '6.0'
180
+ version: '8.2'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: github_changelog_generator
183
183
  requirement: !ruby/object:Gem::Requirement