RCP_Network 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/RCP_Network.rb +12 -7
- data/lib/RCP_Network/version.rb +1 -1
- 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: e6e854c9e6a00dd0a4c5092ef6b677ff7eb96e2b2a9780314c53221b2437f88a
|
4
|
+
data.tar.gz: f1ab4721643da9de087887c84657a4d139cd18731c286f42ef04759c711e6f48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57317d789a15d392ea415244ea346f677fe7c11c8933d3d4ce6068e0892b14e37072ed5c5c59e367407626daeb159a5bc4901b34470ffee51f05446849cff585
|
7
|
+
data.tar.gz: a16597a9392dd890d96dabcba2748ff90f1686704840b1c8097294914fe302d4831c788c9a6fda1c3dbc6ad697e3947450f0b084ef7d284fb3ecc05ee398d514
|
data/lib/RCP_Network.rb
CHANGED
@@ -8,6 +8,8 @@ module RCPNetwork
|
|
8
8
|
# Generate Dangling Modifiers
|
9
9
|
def self.make_choice
|
10
10
|
bot_name = File.read("bot_identity/bot_name.txt").strip
|
11
|
+
|
12
|
+
old_data = File.read("data/output/modifier_list.txt")
|
11
13
|
|
12
14
|
# Grammar A
|
13
15
|
present_action = File.readlines("dictionary/present_action.txt").sample.strip
|
@@ -33,6 +35,8 @@ module RCPNetwork
|
|
33
35
|
for_that = "For that matter,#{why_was} #{first_object} #{present_action.downcase} anything?"
|
34
36
|
|
35
37
|
open("data/output/modifier_list.txt", "w") { |f|
|
38
|
+
f.puts old_data
|
39
|
+
|
36
40
|
f.puts "#{bot_name}: #{grammar_a}#{grammar_b} #{inquire} #{for_that}"
|
37
41
|
}
|
38
42
|
end
|
@@ -43,19 +47,20 @@ module RCPNetwork
|
|
43
47
|
|
44
48
|
modifier_list = File.readlines("data/output/modifier_list.txt")
|
45
49
|
|
46
|
-
dangling_modifier = modifier_list.sample
|
50
|
+
dangling_modifier = modifier_list.sample
|
47
51
|
|
48
|
-
phrase =
|
52
|
+
phrase = dangling_modifier
|
49
53
|
|
50
|
-
|
51
|
-
speech.
|
54
|
+
puts phrase
|
55
|
+
# speech = ESpeak::Speech.new(phrase)
|
56
|
+
# speech.speak
|
52
57
|
end
|
53
58
|
|
54
59
|
# Main decision tree
|
55
60
|
def self.predict_from_data
|
56
61
|
require "decisiontree"
|
57
62
|
|
58
|
-
input = File.read("data/input/modifier_ratio.txt").
|
63
|
+
input = File.read("data/input/modifier_ratio.txt").to_f
|
59
64
|
|
60
65
|
attributes = ["Modifier"]
|
61
66
|
|
@@ -73,9 +78,9 @@ module RCPNetwork
|
|
73
78
|
decision = dec_tree.predict(test)
|
74
79
|
|
75
80
|
if decision == "Automatic" or 108.8
|
76
|
-
RCPNetwork::
|
81
|
+
RCPNetwork::DanglingModifiers.make_choice
|
77
82
|
else
|
78
|
-
RCPNetwork::
|
83
|
+
RCPNetwork::DanglingModifiers.random_modifier
|
79
84
|
end
|
80
85
|
|
81
86
|
new_input = input += 0.5
|
data/lib/RCP_Network/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: RCP_Network
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gitea
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|