aac-metrics 0.1.4 → 0.1.6

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
  SHA256:
3
- metadata.gz: 5a2c7146372a916bfc65d6d4d50dda6b2a7a27aaf16fc59f3786e7dc38d87f49
4
- data.tar.gz: ea1f5629b498e2f79e4bd9cd5d5d03085f4088da10f351fc1f52187b05744cda
3
+ metadata.gz: 6eb16ba6004490123feaa056a8f47b22e9f0bb2680d4d3d512666084062fb683
4
+ data.tar.gz: 38e012659e66d1117839f7b29c82dbc1dac797c6af2e67411eff93bacf069836
5
5
  SHA512:
6
- metadata.gz: 178c2851f81ecb92e0d97a77a9553ecabcc97baca6fc4d717e8ea2b081e7318cbeb5552a876af896618d979dd7ff4277b2a24c5e32cd6359345f8a760b36eee3
7
- data.tar.gz: 63d7a6cf112e6fc53f7630cf478a37d57374d4b52c934d2c215614b307555486bb34de34316b7255daa2884d51e887c0f380abfdeb85218035d5c4c34df2d68a
6
+ metadata.gz: b2d23f02943d8011727dc3979405111137b119cc254021f77916fa4a62df524ec9d84d078b29f8fa360d1b46a267d65e2ae10291c87c97b2457671e591665c7e
7
+ data.tar.gz: '087f78505783f40b5c6f5bfaedc421833881bee629e2db39292cf8b6b23a115c6b3e332ae325d8de4d1fcce9e76b83cc4b5a44fa35787bc1b17eeb3b2acc99b3'
@@ -269,7 +269,7 @@ module AACMetrics::Loader
269
269
  end
270
270
  if boards
271
271
  analysis = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'sets', fn.sub(/\.obfset$/, '.analysis')))
272
- res = AACMetrics::Metrics.analyze(boards)
272
+ res = AACMetrics::Metrics.analyze(boards, false)
273
273
  f = File.open(analysis, 'w')
274
274
  f.write(JSON.pretty_generate(res))
275
275
  f.close
@@ -1,6 +1,10 @@
1
1
  # TODO:
2
- # Scores for average effort level for word sets (spelling if that's th only way)
3
- # Effort scores for sentence corpus
2
+ # Qualitative evaluation criteria:
3
+ # - this set is easy to learn for communicators
4
+ # - this set is easy to learn for supporters
5
+ # - the vocabulary organization of this set makes sense
6
+ # - this set provides clear opportunities for user-specific words to be added
7
+ # - grammatical forms, growth over time
4
8
  # Effort algorithms for scanning/eyes
5
9
  # TODO: manual way to flag button as conceptually
6
10
  # related to the same-locaed button on the
@@ -20,7 +24,7 @@ module AACMetrics::Metrics
20
24
  # 3.5 When selecting a button with a semantic_id or clone_id,
21
25
  # if the same id was present on the previous board,
22
26
  # an additional discount to search and selection should be applied
23
- def self.analyze(obfset, output=true)
27
+ def self.analyze(obfset, output=true, include_obfset=false)
24
28
  locale = nil
25
29
  buttons = []
26
30
  refs = {}
@@ -50,6 +54,7 @@ module AACMetrics::Metrics
50
54
  cols_tally = 0.0
51
55
  root_rows = nil
52
56
  root_cols = nil
57
+ # Gather repeated words/concepts
53
58
  obfset.each do |board|
54
59
  root_rows ||= board['grid']['rows']
55
60
  root_cols ||= board['grid']['columns']
@@ -179,6 +184,7 @@ module AACMetrics::Metrics
179
184
  else
180
185
  word = button['label']
181
186
  existing = known_buttons[word]
187
+ button['effort'] = effort
182
188
  if !existing || existing[:effort] < effort #board[:level] < existing[:level]
183
189
  puts "LIKE #{effort}" if button['label'] == 'like'
184
190
  known_buttons[word] = {
@@ -201,7 +207,7 @@ module AACMetrics::Metrics
201
207
  clusters[btn[:level]] ||= []
202
208
  clusters[btn[:level]] << btn
203
209
  end
204
- {
210
+ res = {
205
211
  analysis_version: AACMetrics::VERSION,
206
212
  locale: locale,
207
213
  total_boards: total_boards,
@@ -214,6 +220,10 @@ module AACMetrics::Metrics
214
220
  buttons: buttons,
215
221
  levels: clusters
216
222
  }
223
+ if include_obfset
224
+ res[:obfset] = obfset
225
+ end
226
+ res
217
227
  end
218
228
 
219
229
  SQRT2 = Math.sqrt(2)
@@ -245,13 +255,14 @@ module AACMetrics::Metrics
245
255
  10 + (word.length * 2.5)
246
256
  end
247
257
 
248
- def self.analyze_and_compare(obfset, compset)
249
- target = AACMetrics::Metrics.analyze(obfset, false)
258
+ def self.analyze_and_compare(obfset, compset, include_obfset=false)
259
+ target = AACMetrics::Metrics.analyze(obfset, false, include_obfset)
250
260
  res = {}.merge(target)
251
261
 
252
262
  compare = AACMetrics::Metrics.analyze(compset, false)
253
263
  res[:comp_boards] = compare[:total_boards]
254
264
  res[:comp_buttons] = compare[:total_buttons]
265
+ res[:comp_grid] = compare[:grid]
255
266
 
256
267
  compare_words = []
257
268
  compare_buttons = {}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aac-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-05 00:00:00.000000000 Z
11
+ date: 2024-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json