EmergentInstructiveFramework 0.1.4 → 0.1.6
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 +4 -4
- data/README.md +36 -19
- data/lib/EmergentInstructiveFramework/version.rb +1 -1
- data/lib/EmergentInstructiveFramework.rb +18 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2731b95dbe553b6f2cca068017fa64a36451732c48a7de4ec2df339c9c1be79
|
4
|
+
data.tar.gz: b6fc65a11526a3a4c79332ceb617b3104f82aeefb72e4d6f864b3b5d60a25ddc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b200ead69b21323c0bf4ebfb6cf93bf011b60e69ae771f8e2d087c200c6479a7279f1cb4e1f3ea14580d88efe513fe349372da53511bd9dbdfaa36dab5d2641d
|
7
|
+
data.tar.gz: cc3882ac854d5b596b698f7d18b73c6e426cd2aef010d72d72cbddb6852a7e87bb21e223ea37ded1fc57931d259c5e27a1b81f67ca7878e4cef222dbd0569cb4
|
data/README.md
CHANGED
@@ -1,35 +1,52 @@
|
|
1
1
|
# EmergentInstructiveFramework
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
## Expanding Grammar
|
4
|
+
This repository expands on the grammar established by Emergent Semantic Dialogue Framework into Emergent Instructive Framework.
|
5
|
+
|
6
|
+
~~~
|
7
|
+
The direction north you walk, | but the direction south you avoid.
|
8
|
+
| | | | | | | | | | |
|
9
|
+
@word_class | | | @conjunction | | | |
|
10
|
+
| | | | | | | | @verb.
|
11
|
+
@noun | | | @noun | | |
|
12
|
+
@adjective | @noun | |
|
13
|
+
| | @verb |
|
14
|
+
@pronoun |
|
15
|
+
| @pronoun
|
16
|
+
@verb,
|
17
|
+
~~~
|
18
|
+
|
19
|
+
In this case only the conjunctive directional needs to be chosen by in game context: if you must avoid south, then you can visit North, West, and East.
|
6
20
|
|
7
21
|
## Installation
|
8
22
|
|
9
|
-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
10
|
-
|
11
|
-
Install the gem and add to the application's Gemfile by executing:
|
12
|
-
|
13
|
-
```bash
|
14
|
-
bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
|
15
23
|
```
|
16
|
-
|
17
|
-
If bundler is not being used to manage dependencies, install the gem by executing:
|
18
|
-
|
19
|
-
```bash
|
20
|
-
gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
|
24
|
+
sudo gem install EmergentInstructiveFramework
|
21
25
|
```
|
22
26
|
|
23
27
|
## Usage
|
24
28
|
|
25
|
-
|
29
|
+
~~~
|
30
|
+
require "EmergentInstructiveFramework"
|
31
|
+
|
32
|
+
def generate_instructions
|
33
|
+
EmergentInstructiveFramework::LanguageModel.craft_conjunctive
|
34
|
+
EmergentInstructiveFramework::LanguageModel.directional_verb
|
35
|
+
EmergentInstructiveFramework::LanguageModel.pronouns
|
36
|
+
EmergentInstructiveFramework::LanguageModel.follow_up_verb
|
37
|
+
EmergentInstructiveFramework::LanguageModel.from_conjuctive_gen_phrase
|
38
|
+
end
|
39
|
+
|
40
|
+
def self_reinforcer
|
41
|
+
EmergentInstructiveFramework::LanguageModel.self_reinforcer
|
42
|
+
end
|
43
|
+
|
44
|
+
generate_instructions
|
45
|
+
self_reinforcer
|
46
|
+
~~~
|
26
47
|
|
27
48
|
## Development
|
28
49
|
|
29
50
|
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
51
|
|
31
52
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
|
-
## Contributing
|
34
|
-
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/EmergentInstructiveFramework.
|
@@ -77,6 +77,7 @@ module EmergentInstructiveFramework
|
|
77
77
|
def self.from_conjuctive_gen_phrase
|
78
78
|
@conjunctive_phrase = "#{@conjunctive_intro} #{@chosen_verb} #{@chosen_pronoun} #{@chosen_followup}."
|
79
79
|
|
80
|
+
# Le direction tous les autre bien, mais le direction nord vous eviter.
|
80
81
|
if @conjunctive_phrase == ", mais le direction nord vous eviter."; @current_phrase = "Le direction tous les autre bien, mais le direction nord vous eviter."
|
81
82
|
elsif @conjunctive_phrase == ", mais le direction nord je eviter."; @current_phrase = "Le direction tous les autre bien, mais le direction nord je eviter."
|
82
83
|
elsif @conjunctive_phrase == ", mais le direction sud vous eviter."; @current_phrase = "Le direction tous les autre bien, mais le direction sud vous eviter."
|
@@ -163,6 +164,9 @@ module EmergentInstructiveFramework
|
|
163
164
|
chosen_vortex_value = nested_vortex[v_cur_row][v_cur_col][v_cur_arr]
|
164
165
|
chosen_charge_value = nested_charge[c_cur_row][c_cur_col][c_cur_arr]
|
165
166
|
|
167
|
+
puts chosen_vortex_value
|
168
|
+
puts chosen_charge_value
|
169
|
+
|
166
170
|
## Vortex Loop
|
167
171
|
chosen_vortex_value.times do
|
168
172
|
possible_lines = File.readlines("lib/npc/tourguide/possible_lines.txt")
|
@@ -175,15 +179,17 @@ module EmergentInstructiveFramework
|
|
175
179
|
current_line = possible_lines[index].to_s
|
176
180
|
|
177
181
|
if current_line == ideal_line
|
178
|
-
|
179
|
-
|
180
|
-
|
182
|
+
File.open("lib/npc/tourguide/learned_lines.txt", "a") { |f|
|
183
|
+
f.puts current_line
|
184
|
+
}
|
181
185
|
else
|
182
186
|
#puts "> Current line did not match the ideal dialogue line..."
|
183
187
|
end
|
184
188
|
|
185
189
|
index = index + 1
|
186
190
|
end
|
191
|
+
|
192
|
+
index = 0
|
187
193
|
end
|
188
194
|
|
189
195
|
## Charge Loop
|
@@ -195,19 +201,25 @@ module EmergentInstructiveFramework
|
|
195
201
|
ideal_line = learned_lines[chosen_vortex_value].to_s
|
196
202
|
|
197
203
|
size_limit.times do
|
204
|
+
#puts "> Match.."
|
205
|
+
|
198
206
|
current_line = learned_lines[index].to_s
|
199
207
|
|
200
208
|
if current_line == ideal_line
|
201
|
-
|
202
|
-
|
203
|
-
|
209
|
+
File.open("lib/npc/tourguide/reinforced_lines.txt", "a") { |f|
|
210
|
+
f.puts current_line
|
211
|
+
}
|
204
212
|
else
|
205
213
|
#puts "> Current line is not reinforced into longterm memory..."
|
206
214
|
end
|
207
215
|
|
208
216
|
index = index + 1
|
209
217
|
end
|
218
|
+
|
219
|
+
index = 0
|
210
220
|
end
|
221
|
+
|
211
222
|
end
|
223
|
+
|
212
224
|
end
|
213
225
|
end
|