@willwade/aac-processors 0.0.3

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.
Files changed (89) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +787 -0
  3. package/dist/cli/index.d.ts +2 -0
  4. package/dist/cli/index.js +189 -0
  5. package/dist/cli/prettyPrint.d.ts +2 -0
  6. package/dist/cli/prettyPrint.js +28 -0
  7. package/dist/core/analyze.d.ts +6 -0
  8. package/dist/core/analyze.js +49 -0
  9. package/dist/core/baseProcessor.d.ts +94 -0
  10. package/dist/core/baseProcessor.js +208 -0
  11. package/dist/core/fileProcessor.d.ts +7 -0
  12. package/dist/core/fileProcessor.js +51 -0
  13. package/dist/core/stringCasing.d.ts +37 -0
  14. package/dist/core/stringCasing.js +174 -0
  15. package/dist/core/treeStructure.d.ts +190 -0
  16. package/dist/core/treeStructure.js +223 -0
  17. package/dist/index.d.ts +23 -0
  18. package/dist/index.js +96 -0
  19. package/dist/optional/symbolTools.d.ts +28 -0
  20. package/dist/optional/symbolTools.js +126 -0
  21. package/dist/processors/applePanelsProcessor.d.ts +23 -0
  22. package/dist/processors/applePanelsProcessor.js +521 -0
  23. package/dist/processors/astericsGridProcessor.d.ts +49 -0
  24. package/dist/processors/astericsGridProcessor.js +1427 -0
  25. package/dist/processors/dotProcessor.d.ts +21 -0
  26. package/dist/processors/dotProcessor.js +191 -0
  27. package/dist/processors/excelProcessor.d.ts +145 -0
  28. package/dist/processors/excelProcessor.js +556 -0
  29. package/dist/processors/gridset/helpers.d.ts +4 -0
  30. package/dist/processors/gridset/helpers.js +48 -0
  31. package/dist/processors/gridset/resolver.d.ts +8 -0
  32. package/dist/processors/gridset/resolver.js +100 -0
  33. package/dist/processors/gridsetProcessor.d.ts +28 -0
  34. package/dist/processors/gridsetProcessor.js +1339 -0
  35. package/dist/processors/index.d.ts +14 -0
  36. package/dist/processors/index.js +42 -0
  37. package/dist/processors/obfProcessor.d.ts +21 -0
  38. package/dist/processors/obfProcessor.js +278 -0
  39. package/dist/processors/opmlProcessor.d.ts +21 -0
  40. package/dist/processors/opmlProcessor.js +235 -0
  41. package/dist/processors/snap/helpers.d.ts +4 -0
  42. package/dist/processors/snap/helpers.js +27 -0
  43. package/dist/processors/snapProcessor.d.ts +44 -0
  44. package/dist/processors/snapProcessor.js +586 -0
  45. package/dist/processors/touchchat/helpers.d.ts +4 -0
  46. package/dist/processors/touchchat/helpers.js +27 -0
  47. package/dist/processors/touchchatProcessor.d.ts +27 -0
  48. package/dist/processors/touchchatProcessor.js +768 -0
  49. package/dist/types/aac.d.ts +47 -0
  50. package/dist/types/aac.js +2 -0
  51. package/docs/.keep +1 -0
  52. package/docs/ApplePanels.md +309 -0
  53. package/docs/Grid3-XML-Format.md +1788 -0
  54. package/docs/TobiiDynavox-Snap-Details.md +394 -0
  55. package/docs/asterics-Grid-fileformat-details.md +443 -0
  56. package/docs/obf_.obz Open Board File Formats.md +432 -0
  57. package/docs/touchchat.md +520 -0
  58. package/examples/.coverage +0 -0
  59. package/examples/.keep +1 -0
  60. package/examples/README.md +31 -0
  61. package/examples/communikate.dot +2637 -0
  62. package/examples/demo.js +143 -0
  63. package/examples/example-images.gridset +0 -0
  64. package/examples/example.ce +0 -0
  65. package/examples/example.dot +14 -0
  66. package/examples/example.grd +1 -0
  67. package/examples/example.gridset +0 -0
  68. package/examples/example.obf +27 -0
  69. package/examples/example.obz +0 -0
  70. package/examples/example.opml +18 -0
  71. package/examples/example.spb +0 -0
  72. package/examples/example.sps +0 -0
  73. package/examples/example2.grd +1 -0
  74. package/examples/gemini_response.txt +845 -0
  75. package/examples/image-map.js +45 -0
  76. package/examples/package-lock.json +1326 -0
  77. package/examples/package.json +10 -0
  78. package/examples/styled-output/converted-snap-to-touchchat.ce +0 -0
  79. package/examples/styled-output/styled-example.ce +0 -0
  80. package/examples/styled-output/styled-example.gridset +0 -0
  81. package/examples/styled-output/styled-example.obf +37 -0
  82. package/examples/styled-output/styled-example.spb +0 -0
  83. package/examples/styling-example.ts +316 -0
  84. package/examples/translate.js +39 -0
  85. package/examples/translate_demo.js +254 -0
  86. package/examples/translation_cache.json +44894 -0
  87. package/examples/typescript-demo.ts +251 -0
  88. package/examples/unified-interface-demo.ts +183 -0
  89. package/package.json +106 -0
@@ -0,0 +1,520 @@
1
+ # TouchChat
2
+
3
+ ## Vocabs
4
+
5
+
6
+
7
+ - Export vocabs FileName.ce eg "MyVocabFile.ce" - where we write "FileName" below you can replace with "MyVocabFile" or whatever it is called
8
+ - Is just a zip with contents:
9
+
10
+
11
+ - Images.c4s (SQLite)
12
+ - Manifest.c4i (SQLite)
13
+ - version.txt (Just one int eg 4)
14
+ - FileName.c4v (SQLite)
15
+
16
+
17
+ ## Images.c4s
18
+
19
+ ```sql
20
+ BEGIN TRANSACTION;
21
+ CREATE TABLE IF NOT EXISTS "variables" (
22
+ "id" INTEGER NOT NULL,
23
+ "name" TEXT NOT NULL,
24
+ "value" VARCHAR NOT NULL,
25
+ PRIMARY KEY("id" AUTOINCREMENT)
26
+ );
27
+ CREATE TABLE IF NOT EXISTS "locales" (
28
+ "id" INTEGER NOT NULL,
29
+ "language" TEXT NOT NULL,
30
+ "country" TEXT NOT NULL,
31
+ "variant" TEXT NOT NULL,
32
+ PRIMARY KEY("id" AUTOINCREMENT)
33
+ );
34
+ CREATE TABLE IF NOT EXISTS "translations" (
35
+ "id" INTEGER NOT NULL,
36
+ "locale_id" INTEGER NOT NULL,
37
+ "name" TEXT NOT NULL,
38
+ PRIMARY KEY("id" AUTOINCREMENT)
39
+ );
40
+ CREATE TABLE IF NOT EXISTS "symbol_translations" (
41
+ "id" INTEGER NOT NULL,
42
+ "symbol_id" INTEGER NOT NULL,
43
+ "translation_id" INTEGER NOT NULL UNIQUE,
44
+ PRIMARY KEY("id" AUTOINCREMENT)
45
+ );
46
+ CREATE VIRTUAL TABLE [fts_translations] USING [fts3]([name], tokenize=porter);
47
+ CREATE TABLE IF NOT EXISTS "fts_translations_content" (
48
+ "docid" INTEGER,
49
+ "c0name" ,
50
+ PRIMARY KEY("docid")
51
+ );
52
+ CREATE TABLE IF NOT EXISTS "fts_translations_segments" (
53
+ "blockid" INTEGER,
54
+ "block" BLOB,
55
+ PRIMARY KEY("blockid")
56
+ );
57
+ CREATE TABLE IF NOT EXISTS "fts_translations_segdir" (
58
+ "level" INTEGER,
59
+ "idx" INTEGER,
60
+ "start_block" INTEGER,
61
+ "leaves_end_block" INTEGER,
62
+ "end_block" INTEGER,
63
+ "root" BLOB,
64
+ PRIMARY KEY("level","idx")
65
+ );
66
+ CREATE TABLE IF NOT EXISTS "categories" (
67
+ "id" INTEGER NOT NULL,
68
+ "parent_id" INTEGER NOT NULL,
69
+ PRIMARY KEY("id" AUTOINCREMENT)
70
+ );
71
+ CREATE TABLE IF NOT EXISTS "category_symbols" (
72
+ "id" INTEGER NOT NULL,
73
+ "category_id" INTEGER NOT NULL,
74
+ "symbol_id" INTEGER NOT NULL,
75
+ PRIMARY KEY("id" AUTOINCREMENT)
76
+ );
77
+ CREATE TABLE IF NOT EXISTS "category_translations" (
78
+ "id" INTEGER NOT NULL,
79
+ "category_id" INTEGER NOT NULL,
80
+ "translation_id" INTEGER NOT NULL UNIQUE,
81
+ PRIMARY KEY("id" AUTOINCREMENT)
82
+ );
83
+ CREATE TABLE IF NOT EXISTS "symbols" (
84
+ "id" INTEGER NOT NULL,
85
+ "rid" TEXT NOT NULL UNIQUE,
86
+ "compressed" INTEGER NOT NULL,
87
+ "type" INTEGER NOT NULL,
88
+ "width" INTEGER NOT NULL,
89
+ "height" INTEGER NOT NULL,
90
+ "data" BLOB NOT NULL,
91
+ PRIMARY KEY("id" AUTOINCREMENT)
92
+ );
93
+ INSERT INTO "variables" ("id","name","value") VALUES (1,'FeatureID','145'),
94
+ (2,'ReadOnly','false'),
95
+ (3,'Name','Export Symbols Symbols');
96
+ CREATE UNIQUE INDEX IF NOT EXISTS "IDX_VARIABLES_NAME" ON "variables" (
97
+ "name"
98
+ );
99
+ CREATE UNIQUE INDEX IF NOT EXISTS "IDX_LOCALES_LANGUAGE_COUNTRY_VARIANT" ON "locales" (
100
+ "language",
101
+ "country",
102
+ "variant"
103
+ );
104
+ CREATE INDEX IF NOT EXISTS "IDX_TRANSLATIONS_LOCALE_ID" ON "translations" (
105
+ "locale_id"
106
+ );
107
+ CREATE INDEX IF NOT EXISTS "IDX_SYMBOL_TRANSLATIONS_SYMBOL_ID" ON "symbol_translations" (
108
+ "symbol_id"
109
+ );
110
+ CREATE INDEX IF NOT EXISTS "IDX_CATEGORIES_PARENT_ID" ON "categories" (
111
+ "parent_id"
112
+ );
113
+ CREATE INDEX IF NOT EXISTS "IDX_CATEGORY_SYMBOLS_CATEGORY_ID" ON "category_symbols" (
114
+ "category_id"
115
+ );
116
+ CREATE UNIQUE INDEX IF NOT EXISTS "IDX_CATEGORY_SYMBOLS_CATEGORY_ID_SYMBOL_ID" ON "category_symbols" (
117
+ "category_id",
118
+ "symbol_id"
119
+ );
120
+ CREATE TRIGGER [translations_bu] BEFORE UPDATE ON [translations] BEGIN DELETE FROM [fts_translations] WHERE [docid] = [old].[id]; END;
121
+ CREATE TRIGGER [translations_bd] BEFORE DELETE ON [translations] BEGIN DELETE FROM [fts_translations] WHERE [docid] = [old].[id]; END;
122
+ CREATE TRIGGER [translations_au] AFTER UPDATE ON [translations] BEGIN INSERT INTO [fts_translations]([docid], [name]) VALUES([new].[id], [new].[name]); END;
123
+ CREATE TRIGGER [translations_ai] AFTER INSERT ON [translations] BEGIN INSERT INTO [fts_translations]([docid], [name]) VALUES([new].[id], [new].[name]); END;
124
+ COMMIT;
125
+ ```
126
+
127
+ ## Manifest.c4i
128
+
129
+ ```sql
130
+ BEGIN TRANSACTION;
131
+ CREATE TABLE IF NOT EXISTS "variables" (
132
+ "id" INTEGER NOT NULL,
133
+ "name" TEXT NOT NULL,
134
+ "value" VARCHAR NOT NULL,
135
+ PRIMARY KEY("id" AUTOINCREMENT)
136
+ );
137
+ INSERT INTO "variables" ("id","name","value") VALUES (1,'Origin','ChatEditor');
138
+ COMMIT;
139
+ ```
140
+
141
+ ### Filename.c4v
142
+
143
+ ```sql
144
+
145
+ BEGIN TRANSACTION;
146
+ CREATE TABLE IF NOT EXISTS "variables" (
147
+ "id" INTEGER NOT NULL,
148
+ "name" TEXT NOT NULL,
149
+ "value" VARCHAR NOT NULL,
150
+ PRIMARY KEY("id" AUTOINCREMENT)
151
+ );
152
+ CREATE TABLE IF NOT EXISTS "resources" (
153
+ "id" INTEGER NOT NULL,
154
+ "rid" TEXT NOT NULL UNIQUE,
155
+ "name" TEXT NOT NULL,
156
+ "type" INTEGER NOT NULL,
157
+ PRIMARY KEY("id" AUTOINCREMENT)
158
+ );
159
+ CREATE TABLE IF NOT EXISTS "sounds" (
160
+ "id" INTEGER NOT NULL,
161
+ "resource_id" INTEGER NOT NULL,
162
+ "data" BLOB,
163
+ PRIMARY KEY("id" AUTOINCREMENT)
164
+ );
165
+ CREATE TABLE IF NOT EXISTS "button_styles" (
166
+ "id" INTEGER NOT NULL,
167
+ "label_on_top" INTEGER,
168
+ "force_label_on_top" INTEGER,
169
+ "transparent" INTEGER,
170
+ "force_transparent" INTEGER,
171
+ "font_color" INTEGER,
172
+ "force_font_color" INTEGER,
173
+ "body_color" INTEGER,
174
+ "force_body_color" INTEGER,
175
+ "border_color" INTEGER,
176
+ "force_border_color" INTEGER,
177
+ "border_width" INTEGER,
178
+ "force_border_width" INTEGER,
179
+ "font_name" TEXT,
180
+ "font_bold" INTEGER,
181
+ "font_underline" INTEGER,
182
+ "font_italic" INTEGER,
183
+ "font_height" INTEGER,
184
+ "force_font" INTEGER,
185
+ PRIMARY KEY("id" AUTOINCREMENT)
186
+ );
187
+ CREATE TABLE IF NOT EXISTS "action_data" (
188
+ "id" INTEGER NOT NULL,
189
+ "action_id" INTEGER NOT NULL,
190
+ "key" INTEGER NOT NULL,
191
+ "value" VARCHAR NOT NULL,
192
+ PRIMARY KEY("id" AUTOINCREMENT)
193
+ );
194
+ CREATE TABLE IF NOT EXISTS "button_sets" (
195
+ "id" INTEGER NOT NULL,
196
+ "resource_id" INTEGER NOT NULL,
197
+ PRIMARY KEY("id" AUTOINCREMENT)
198
+ );
199
+ CREATE TABLE IF NOT EXISTS "button_boxes" (
200
+ "id" INTEGER NOT NULL,
201
+ "resource_id" INTEGER NOT NULL,
202
+ "layout_x" INTEGER,
203
+ "layout_y" INTEGER,
204
+ "init_size_x" INTEGER,
205
+ "init_size_y" INTEGER,
206
+ "scan_pattern_id" INTEGER NOT NULL DEFAULT 0,
207
+ PRIMARY KEY("id" AUTOINCREMENT)
208
+ );
209
+ CREATE TABLE IF NOT EXISTS "page_styles" (
210
+ "id" INTEGER NOT NULL,
211
+ "bg_color" INTEGER,
212
+ "force_bg_color" INTEGER,
213
+ "bg_alignment" INTEGER,
214
+ "force_bg_alignment" INTEGER,
215
+ PRIMARY KEY("id" AUTOINCREMENT)
216
+ );
217
+ CREATE TABLE IF NOT EXISTS "button_box_instances" (
218
+ "id" INTEGER NOT NULL,
219
+ "page_id" INTEGER NOT NULL,
220
+ "button_box_id" INTEGER NOT NULL,
221
+ "position_x" INTEGER,
222
+ "position_y" INTEGER,
223
+ "size_x" INTEGER,
224
+ "size_y" INTEGER,
225
+ PRIMARY KEY("id" AUTOINCREMENT)
226
+ );
227
+ CREATE TABLE IF NOT EXISTS "button_box_cells" (
228
+ "id" INTEGER NOT NULL,
229
+ "button_box_id" INTEGER NOT NULL,
230
+ "resource_id" INTEGER NOT NULL,
231
+ "location" INTEGER NOT NULL,
232
+ "span_x" INTEGER NOT NULL,
233
+ "span_y" INTEGER NOT NULL,
234
+ PRIMARY KEY("id" AUTOINCREMENT)
235
+ );
236
+ CREATE TABLE IF NOT EXISTS "symbol_links" (
237
+ "id" INTEGER NOT NULL,
238
+ "rid" TEXT NOT NULL,
239
+ "feature" Integer NOT NULL,
240
+ PRIMARY KEY("id" AUTOINCREMENT)
241
+ );
242
+ CREATE TABLE IF NOT EXISTS "button_set_modifiers" (
243
+ "id" INTEGER NOT NULL,
244
+ "button_set_id" INTEGER NOT NULL,
245
+ "button_id" INTEGER NOT NULL,
246
+ "modifier" INTEGER NOT NULL,
247
+ PRIMARY KEY("id" AUTOINCREMENT)
248
+ );
249
+ CREATE TABLE IF NOT EXISTS "buttons" (
250
+ "id" INTEGER NOT NULL,
251
+ "resource_id" INTEGER NOT NULL,
252
+ "label" TEXT,
253
+ "message" TEXT,
254
+ "symbol_link_id" INTEGER,
255
+ "visible" INTEGER,
256
+ "button_style_id" INTEGER NOT NULL,
257
+ "pronunciation" TEXT DEFAULT NULL,
258
+ "skin_tone_override" INTEGER DEFAULT NULL,
259
+ PRIMARY KEY("id" AUTOINCREMENT)
260
+ );
261
+ CREATE TABLE IF NOT EXISTS "actions" (
262
+ "id" INTEGER NOT NULL,
263
+ "resource_id" INTEGER NOT NULL,
264
+ "rank" INTEGER NOT NULL,
265
+ "code" INTEGER NOT NULL,
266
+ PRIMARY KEY("id" AUTOINCREMENT)
267
+ );
268
+ CREATE TABLE IF NOT EXISTS "gestures" (
269
+ "id" INTEGER NOT NULL,
270
+ "resource_id" INTEGER NOT NULL UNIQUE,
271
+ "label" TEXT,
272
+ "message" TEXT,
273
+ "code" INTEGER NOT NULL,
274
+ "type" INTEGER NOT NULL,
275
+ PRIMARY KEY("id" AUTOINCREMENT)
276
+ );
277
+ CREATE TABLE IF NOT EXISTS "page_gestures" (
278
+ "id" INTEGER NOT NULL,
279
+ "gesture_id" INTEGER NOT NULL UNIQUE,
280
+ "page_id" INTEGER NOT NULL,
281
+ PRIMARY KEY("id" AUTOINCREMENT)
282
+ );
283
+ CREATE TABLE IF NOT EXISTS "vocabulary_gestures" (
284
+ "id" INTEGER NOT NULL,
285
+ "gesture_id" INTEGER NOT NULL UNIQUE,
286
+ PRIMARY KEY("id" AUTOINCREMENT)
287
+ );
288
+ CREATE TABLE IF NOT EXISTS "vocabulary_lists" (
289
+ "id" INTEGER NOT NULL,
290
+ "name" TEXT NOT NULL UNIQUE,
291
+ PRIMARY KEY("id" AUTOINCREMENT)
292
+ );
293
+ CREATE TABLE IF NOT EXISTS "vocabulary_list_buttons" (
294
+ "id" INTEGER NOT NULL,
295
+ "vocabulary_list_id" INTEGER NOT NULL,
296
+ "button_id" INTEGER NOT NULL,
297
+ PRIMARY KEY("id" AUTOINCREMENT)
298
+ );
299
+ CREATE TABLE IF NOT EXISTS "pages" (
300
+ "id" INTEGER NOT NULL,
301
+ "resource_id" INTEGER NOT NULL UNIQUE,
302
+ "symbol_link_id" INTEGER,
303
+ "page_style_id" INTEGER NOT NULL,
304
+ "button_style_id" INTEGER NOT NULL,
305
+ "feature" INTEGER,
306
+ PRIMARY KEY("id" AUTOINCREMENT)
307
+ );
308
+ CREATE TABLE IF NOT EXISTS "scan_groups" (
309
+ "id" INTEGER NOT NULL,
310
+ "parent_id" INTEGER NOT NULL,
311
+ "rank" INTEGER NOT NULL,
312
+ "name" TEXT,
313
+ "node_type" INTEGER NOT NULL,
314
+ "pattern" INTEGER NOT NULL,
315
+ "rows" INTEGER NOT NULL,
316
+ "columns" INTEGER NOT NULL,
317
+ PRIMARY KEY("id" AUTOINCREMENT)
318
+ );
319
+ CREATE TABLE IF NOT EXISTS "scan_patterns" (
320
+ "id" INTEGER NOT NULL,
321
+ "layout_x" INTEGER NOT NULL,
322
+ "layout_y" INTEGER NOT NULL,
323
+ "scan_group_id" INTEGER NOT NULL,
324
+ PRIMARY KEY("id" AUTOINCREMENT)
325
+ );
326
+ CREATE TABLE IF NOT EXISTS "default_scan_patterns" (
327
+ "id" INTEGER NOT NULL,
328
+ "layout_x" INTEGER NOT NULL,
329
+ "layout_y" INTEGER NOT NULL,
330
+ "scan_pattern_id" INTEGER NOT NULL,
331
+ PRIMARY KEY("id" AUTOINCREMENT)
332
+ );
333
+ CREATE TABLE IF NOT EXISTS "scan_cells" (
334
+ "id" INTEGER NOT NULL,
335
+ "scan_group_id" INTEGER NOT NULL,
336
+ "index" INTEGER NOT NULL,
337
+ PRIMARY KEY("id" AUTOINCREMENT)
338
+ );
339
+ CREATE TABLE IF NOT EXISTS "sqlite_stat4" (
340
+ "tbl" ,
341
+ "idx" ,
342
+ "neq" ,
343
+ "nlt" ,
344
+ "ndlt" ,
345
+ "sample"
346
+ );
347
+ CREATE TABLE IF NOT EXISTS "special_pages" (
348
+ "id" INTEGER NOT NULL,
349
+ "name" TEXT NOT NULL UNIQUE,
350
+ "page_id" INTEGER NOT NULL,
351
+ PRIMARY KEY("id" AUTOINCREMENT)
352
+ );
353
+ CREATE INDEX IF NOT EXISTS "IDX_SYMBOL_LINKS_RID" ON "symbol_links" (
354
+ "rid"
355
+ );
356
+ CREATE INDEX IF NOT EXISTS "IDX_RESOURCES_NAME_TYPE" ON "resources" (
357
+ "name",
358
+ "type"
359
+ );
360
+ CREATE INDEX IF NOT EXISTS "IDX_BUTTON_SET_MODIFIERS_BUTTON_SET_ID" ON "button_set_modifiers" (
361
+ "button_set_id"
362
+ );
363
+ CREATE INDEX IF NOT EXISTS "IDX_BUTTON_BOX_CELLS_RESOURCE_ID" ON "button_box_cells" (
364
+ "resource_id"
365
+ );
366
+ CREATE INDEX IF NOT EXISTS "IDX_BUTTON_BOX_INSTANCES_PAGE_ID" ON "button_box_instances" (
367
+ "page_id"
368
+ );
369
+ CREATE INDEX IF NOT EXISTS "IDX_BUTTON_BOX_CELLS_BUTTON_BOX_ID" ON "button_box_cells" (
370
+ "button_box_id"
371
+ );
372
+ CREATE INDEX IF NOT EXISTS "IDX_ACTION_DATA_ACTION_ID" ON "action_data" (
373
+ "action_id"
374
+ );
375
+ CREATE INDEX IF NOT EXISTS "IDX_ACTIONS_RESOURCE_ID" ON "actions" (
376
+ "resource_id"
377
+ );
378
+ CREATE INDEX IF NOT EXISTS "IDX_ACTIONS_CODE" ON "actions" (
379
+ "code"
380
+ );
381
+ CREATE INDEX IF NOT EXISTS "IDX_PAGE_GESTURES_PAGE_ID" ON "page_gestures" (
382
+ "page_id"
383
+ );
384
+ CREATE INDEX IF NOT EXISTS "IDX_SCAN_GROUPS_PARENT_ID" ON "scan_groups" (
385
+ "parent_id"
386
+ );
387
+ CREATE INDEX IF NOT EXISTS "IDX_SCAN_CELLS_SCAN_GROUP_ID" ON "scan_cells" (
388
+ "scan_group_id"
389
+ );
390
+ CREATE UNIQUE INDEX IF NOT EXISTS "IDX_SOUNDS_RESOURCE_ID" ON "sounds" (
391
+ "resource_id"
392
+ );
393
+ CREATE UNIQUE INDEX IF NOT EXISTS "IDX_BUTTON_SETS_RESOURCE_ID" ON "button_sets" (
394
+ "resource_id"
395
+ );
396
+ CREATE UNIQUE INDEX IF NOT EXISTS "IDX_BUTTON_BOXES_RESOURCE_ID" ON "button_boxes" (
397
+ "resource_id"
398
+ );
399
+ CREATE UNIQUE INDEX IF NOT EXISTS "IDX_VARIABLES_NAME" ON "variables" (
400
+ "name"
401
+ );
402
+ CREATE UNIQUE INDEX IF NOT EXISTS "IDX_BUTTONS_RESOURCE_ID" ON "buttons" (
403
+ "resource_id"
404
+ );
405
+ CREATE UNIQUE INDEX IF NOT EXISTS "IDX_VOCABULARY_LIST_BUTTONS_VOCABULARY_LIST_ID_BUTTON_ID" ON "vocabulary_list_buttons" (
406
+ "vocabulary_list_id",
407
+ "button_id"
408
+ );
409
+ CREATE UNIQUE INDEX IF NOT EXISTS "IDX_DEFAULT_SCAN_PATTERNS_LAYOUT_X_LAYOUT_Y" ON "default_scan_patterns" (
410
+ "layout_x",
411
+ "layout_y"
412
+ );
413
+ COMMIT;
414
+ ```
415
+
416
+
417
+ ### Notes
418
+
419
+ - In many packages you find Images and Manifest very thin - I think particularly if you just stick to inbuild symbols
420
+ - Most raw language data is in buttons and labels
421
+
422
+ eg
423
+ ``sql
424
+ SELECT id, label, message
425
+ FROM buttons
426
+ WHERE label IS NOT NULL OR message IS NOT NULL;
427
+ ``
428
+
429
+ will get you most of the lang data
430
+
431
+ ## Symbols
432
+
433
+ Symbols in TouchChat are referenced indirectly in `.c4v` vocabulary files and resolved via external symbol library files located in:
434
+
435
+ ```
436
+ C:\Program Files (x86)\Chat Editor\Symbols\
437
+ ```
438
+
439
+ ### Symbol Library Files
440
+
441
+ These are SQLite databases containing symbol image data in the form of binary blobs. Example files include:
442
+
443
+ ```
444
+ AntiquatedLink.db
445
+ Imagine.c4s
446
+ Metacom.c4s
447
+ MinSpeak.c4s
448
+ PCS.c45
449
+ Pixon.c4s
450
+ PRC.c4s
451
+ Saltillo.c4s
452
+ Sample.c4s
453
+ SymbolStix.c4s
454
+ Tawasol.c4s
455
+ ```
456
+
457
+ Each file typically includes a `Symbols` table, where:
458
+ - `id` is the internal symbol identifier.
459
+ - `rid` is a UUID (RID) used to reference the symbol from vocabularies.
460
+ - `data` is a BLOB that stores the image (usually PNG or WMF).
461
+
462
+
463
+ ### How Symbols Link to Buttons
464
+
465
+ In a `.c4v` vocabulary (also a SQLite file), symbols are referenced using two tables:
466
+
467
+ #### `Buttons` table
468
+ Each button can include a `symbol_link_id` column:
469
+
470
+ ```csv
471
+ id resource_id label message symbol_link_id
472
+ 1 3 building building 1
473
+ ```
474
+
475
+ #### `symbol_links` table
476
+ This table provides the mapping from `symbol_link_id` to a symbol RID (UUID):
477
+
478
+ ```csv
479
+ id rid feature
480
+ 1 {32BA0E22-7FE1F748-AA1C879C-BF24066D} 14
481
+ ```
482
+
483
+ - `rid` is a globally unique identifier for the symbol.
484
+ - `feature` may control symbol variants (e.g. color, rotation, skin tone).
485
+
486
+
487
+ ### How the Symbol Library is Resolved
488
+
489
+ The `.c4v` file does **not** explicitly record which symbol library a RID comes from. Instead, Chat Editor or TouchChat:
490
+
491
+ 1. Scans all installed symbol libraries (e.g., `PCS.c45`, `SymbolStix.c4s`).
492
+ 2. Finds the first matching RID.
493
+ 3. Loads the corresponding symbol from that file.
494
+
495
+ This means:
496
+ - RIDs must be unique across all symbol libraries.
497
+ - If the matching `.c4s` file is missing, the symbol won't display.
498
+
499
+
500
+ ### Suggested Usage for Developers
501
+
502
+ To resolve symbols programmatically:
503
+
504
+ 1. Extract `symbol_link_id` from the `Buttons` table.
505
+ 2. Join with `symbol_links` to get the `rid` (UUID).
506
+ 3. Search across all `.c4s`/`.c45` symbol databases for that RID.
507
+ 4. Extract the `data` BLOB for the matching symbol (image).
508
+
509
+ You can use SQLite queries such as:
510
+
511
+ ```sql
512
+ SELECT data FROM Symbols WHERE rid = '{UUID}';
513
+ ```
514
+
515
+ Then write the BLOB as a `.png` or `.wmf` file, depending on the symbol system.
516
+
517
+ ---
518
+
519
+ By building an index of RIDs across all available libraries, you can create a full symbol mapping layer for any `.c4v` vocabulary file.
520
+
Binary file
package/examples/.keep ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,31 @@
1
+ # AAC Processors Examples
2
+
3
+ This directory contains example scripts demonstrating various uses of the AAC Processors library.
4
+
5
+ ## Translation Demo
6
+
7
+ Demonstrates how to translate AAC files between languages using various translation services.
8
+
9
+ ### Setup
10
+
11
+ ```bash
12
+ # Install example-specific dependencies
13
+ cd examples
14
+ npm install
15
+
16
+ # Set up environment variables
17
+ export AZURE_TRANSLATOR_KEY="your-key"
18
+ export GOOGLE_TRANSLATE_KEY="your-key"
19
+ ```
20
+
21
+ ### Usage
22
+
23
+ ```bash
24
+ # Basic usage
25
+ node translate_demo.js ../path/to/input.gridset --endlang fr
26
+
27
+ # With confidence checking
28
+ node translate_demo.js ../path/to/input.gridset --endlang fr --enable-confidence-check
29
+ ```
30
+
31
+ Note: These examples are for demonstration purposes only and have their own dependencies separate from the main package.