megahal 1.0.0 → 1.0.1

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: 120f6e0a5f82deab1ccb4a2656e35885461f8085
4
- data.tar.gz: 6ae6ea07610d29c447f5abc0435ab784b03022a6
3
+ metadata.gz: a8ffa5e4ea83809cfcc0722d2a5ecce0c6676a5e
4
+ data.tar.gz: 3ae33c7502317923fe690f2462f18ecfd4f0a3a3
5
5
  SHA512:
6
- metadata.gz: 5f4d67ed6ad7473609326577f8e346c2cf56dfda189918151d3b0b244a9d58c522900036231353b911ad53e4a756fc7a78a3f31f594e7c7b8e0453601e656a01
7
- data.tar.gz: fbd96ec1e18a1420a8812d9b5beeae9b4febb474c18904bd08bc8031a885ad85c559f8070fe25312f31be421561d98b013b97b7d68fd738c1116e2689ec4d00f
6
+ metadata.gz: 4c741d87d5569b578930af3559b26e7b27d381db11adb349abed782a4f94d85b9cf2e2fd8aae6feba203b3650d8a6d82e6e03932e958d0ff27c2930a76d46ab5
7
+ data.tar.gz: 46540a6a18883c0592fdc8087f20ad36b855707d80d9c8ae253f8fd6dd7a39c1419b0a824da1150b6f74cf213c52115f5751a47d8e2c46ab712bfa8a15e38f34
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -52,6 +52,7 @@ class MegaHAL
52
52
  ["HOLMES", "WATSON"],
53
53
  ["FRIEND", "ENEMY"],
54
54
  ["ALIVE", "DEAD"],
55
+ ["LIFE", "DEATH"],
55
56
  ["QUESTION", "ANSWER"],
56
57
  ["BLACK", "WHITE"],
57
58
  ["COLD", "HOT"],
@@ -305,7 +305,7 @@ class MegaHAL
305
305
  end
306
306
  # Select one of the contexts at random
307
307
  context = contexts.compact.shuffle.first
308
- raise unless context
308
+ return nil unless context
309
309
  # Here we glue the generations of the @back and @fore models together
310
310
  glue = context.select { |symbol| symbol != 1 }
311
311
  _random_walk(@back, context.reverse, keyword_symbols).reverse + glue + _random_walk(@fore, context, keyword_symbols)
@@ -341,7 +341,7 @@ class MegaHAL
341
341
  break
342
342
  end
343
343
  end
344
- raise if symbol == 0
344
+ return [] if symbol == 0
345
345
  break if symbol == 1
346
346
  results << symbol
347
347
  context << symbol
@@ -441,7 +441,6 @@ class MegaHAL
441
441
  failed = (@punc.count(context) == 0)
442
442
  end
443
443
  if failed
444
- raise if i == 0
445
444
  retries += 1
446
445
  word_symbols.clear
447
446
  i = 0
@@ -362,23 +362,57 @@ Read it up--you really should. There is nothing new under the sun. It has all be
362
362
  There is nothing more to be learned.
363
363
  I have just made a discovery of the highest importance.
364
364
  What do you think of that?
365
- They say that genius is an infinite capacity for taking pains. It's a very bad
366
- definition, but it does apply to detective work.
365
+ They say that genius is an infinite capacity for taking pains. It's a very bad definition, but it does apply to detective work.
367
366
  You are doing so well now that it would be a pity for anyone to interfere.
368
367
  There is nothing like first hand evidence.
369
368
  There's no room for a mistake.
370
369
  Just let us hear it all in your own way as it occurred.
371
- Do you remember what Darwin says about music? He claims that the power of
372
- producing and appreciating it existed among the human race long before the power
373
- of speech was arrived at. Perhaps that is why we are so subtly influenced by it.
374
- There are vague memories in our souls of those misty centuries when the world
375
- was in its childhood.
370
+ Do you remember what Darwin says about music? He claims that the power of producing and appreciating it existed among the human race long before the power of speech was arrived at. Perhaps that is why we are so subtly influenced by it. There are vague memories in our souls of those misty centuries when the world was in its childhood.
376
371
  One's ideas must be as broad as Nature if they are to interpret Nature.
377
- I can understand. There is a mystery about this which stimulates the
378
- imagination; where there is no imagination there is no horror.
372
+ I can understand. There is a mystery about this which stimulates the imagination; where there is no imagination there is no horror.
379
373
  The plot thickens.
380
374
  My fiddle would be the better for new strings.
381
375
  You do me too much honour.
382
376
  To a great mind, nothing is little.
383
377
  Smart--very smart!
378
+ It's quite exciting. What happened next?
379
+ I have now in my hands all the threads which have formed such a tangle.
380
+ There are, of course, details to be filled in, but I am as certain of all the main facts.
381
+ Precisely so.
382
+ Patience, my friend, patience!
383
+ You will find in time that it has everything to do with it.
384
+ All this seems strange to you because you failed at the beginning of the inquiry to grasp the importance of the single real clue which was presented to you.
385
+ I had the good fortune to seize upon that, and everything which has occurred since then has served to confirm my original supposition, and, indeed, was the logical sequence of it.
386
+ Things which have perplexed you and made the case more obscure, have served to enlighten me and to strengthen my conclusions.
387
+ It is a mistake to confound strangeness with mystery.
388
+ The most commonplace crime is often the most mysterious because it presents no new or special features from which deductions may be drawn.
389
+ Very good, very good.
390
+ You are very welcome to put any questions that you like to me now, and there is no danger that I will refuse to answer them.
391
+ My dear Watson, I owe you a thousand apologies. I had no idea that you would be so affected.
392
+ Are you sure that you are really fit to discuss things?
393
+ I am glad to stretch myself, Watson.
394
+ You'll come with me to-night?
395
+ This is, indeed, like the old days.
396
+ My note to you was absolutely genuine.
397
+ I had little doubt that I had come to the end of my career when I perceived the somewhat sinister figure of the late Professor Moriarty standing upon the narrow pathway which led to safety.
398
+ I did not take long to think about it, Watson.
399
+ I owe you many apologies, my dear Watson, but it was all-important that it should be thought I was dead, and it is quite certain that you would not have written so convincing an account of my unhappy end had you not yourself thought that it was true.
400
+ Several times during the last three years I have taken up my pen to write to you, but always I feared lest your affectionate regard for me should tempt you to some indiscretion which would betray my secret.
401
+ Because it commands so excellent a view of that picturesque pile.
402
+ I trust that age doth not wither nor custom stale my infinite variety.
403
+ It really is rather like me, is it not?
404
+ Because, my dear Watson, I had the strongest possible reason for wishing certain people to think that I was there when I was really elsewhere.
405
+ I KNEW that they were watched.
406
+ By my old enemies, Watson.
407
+ I think you want a little unofficial help.
408
+ I confess that you had one small surprise for me.
409
+ Not entirely.
410
+ Quite so.
411
+ At last we have a clue! Thank heaven!
412
+ So far, so good.
413
+ I am familiar with forty-two different impressions left by tires.
414
+ No, no, my dear Watson.
415
+ It is a little difficult to know what to do, Watson.
416
+ My own inclinations are to push this inquiry on, for we have already lost so much time that we cannot afford to waste another hour.
417
+ On the other hand, we are bound to inform the police of the discovery, and to see that this poor fellow's body is looked after.
384
418
  EOP
@@ -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.0 ruby lib
5
+ # stub: megahal 1.0.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "megahal"
9
- s.version = "1.0.0"
9
+ s.version = "1.0.1"
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 = "2014-12-17"
14
+ s.date = "2014-12-22"
15
15
  s.description = "Have a weird conversation with a computer."
16
16
  s.email = "jasonhutchens@gmail.com"
17
17
  s.executables = ["megahal"]
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.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Hutchens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-17 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sooth