@@ -27,6 +27,7 @@ A comprehensive **TypeScript library** for processing AAC (Augmentative and Alte
2727- 🌍 ** Translation workflows** - Built-in i18n support with ` processTexts() `
2828- 🎨 ** Comprehensive styling support** - Preserve visual appearance across formats
2929- 🧪 ** Property-based testing** - Robust validation with 140+ tests
30+ - ✅ ** Format validation** - Spec-based validation for all supported formats
3031- ⚡ ** Performance optimized** - Memory-efficient processing of large files
3132- 🛡️ ** Error recovery** - Graceful handling of corrupted data
3233- 🔒 ** Thread-safe** - Concurrent processing support
@@ -191,6 +192,78 @@ const translatedBuffer = processor.processTexts(
191192console .log (" Translation complete!" );
192193```
193194
195+ ### Format Validation
196+
197+ Validate AAC files against format specifications to ensure data integrity:
198+
199+ ``` typescript
200+ import { ObfProcessor , GridsetProcessor } from " aac-processors" ;
201+
202+ // Validate OBF/OBZ files
203+ const obfProcessor = new ObfProcessor ();
204+ const result = await obfProcessor .validate (" board.obf" );
205+
206+ console .log (` Valid: ${result .valid } ` );
207+ console .log (` Errors: ${result .errors } ` );
208+ console .log (` Warnings: ${result .warnings } ` );
209+
210+ // Detailed validation results
211+ if (! result .valid ) {
212+ result .results
213+ .filter ((check ) => ! check .valid )
214+ .forEach ((check ) => {
215+ console .log (` ✗ ${check .description }: ${check .error } ` );
216+ });
217+ }
218+
219+ // Validate Gridset files (with optional password for encrypted files)
220+ const gridsetProcessor = new GridsetProcessor ({
221+ gridsetPassword: " optional-password" ,
222+ });
223+ const gridsetResult = await gridsetProcessor .validate (" vocab.gridsetx" );
224+ ```
225+
226+ #### Using the CLI
227+
228+ ``` bash
229+ # Validate a file
230+ aacprocessors validate board.obf
231+
232+ # JSON output
233+ aacprocessors validate board.obf --json
234+
235+ # Quiet mode (just valid/invalid)
236+ aacprocessors validate board.gridset --quiet
237+
238+ # Validate encrypted Gridset file
239+ aacprocessors validate board.gridsetx --gridset-password < password>
240+ ```
241+
242+ #### What Gets Validated?
243+
244+ - ** OBF/OBZ** : Spec compliance (Open Board Format)
245+ - Required fields (format, id, locale, buttons, grid, images, sounds)
246+ - Grid structure (rows, columns, order)
247+ - Button references (image_id, sound_id, load_board paths)
248+ - Color formats (RGB/RGBA)
249+ - Cross-reference validation
250+
251+ - ** Gridset** : XML structure
252+ - Required elements (gridset, pages, cells)
253+ - FixedCellSize configuration
254+ - Page and cell attributes
255+ - Image references
256+
257+ - ** Snap** : Package structure
258+ - ZIP package validity
259+ - Settings file format
260+ - Page/button configurations
261+
262+ - ** TouchChat** : XML structure
263+ - PageSet hierarchy
264+ - Button definitions
265+ - Navigation links
266+
194267### Cross-Format Conversion
195268
196269Convert between any supported AAC formats:
@@ -506,6 +579,7 @@ npx aac-processors analyze examples/example.gridset --pretty
506579- ` --pretty ` - Human-readable output (analyze command)
507580- ` --verbose ` - Detailed output (extract command)
508581- ` --quiet ` - Minimal output (extract command)
582+ - ` --gridset-password <password> ` - Password for encrypted Grid 3 archives (` .gridsetx ` )
509583
510584** Button Filtering Options:**
511585
@@ -594,17 +668,17 @@ interface AACButton {
594668
595669### Supported Processors
596670
597- | Processor | File Extensions | Description |
598- | ----------------------- | --------------- | ----------------------------- |
599- | ` DotProcessor ` | ` .dot ` | Graphviz DOT format |
600- | ` OpmlProcessor ` | ` .opml ` | OPML hierarchical format |
601- | ` ObfProcessor ` | ` .obf ` , ` .obz ` | Open Board Format (JSON/ZIP) |
602- | ` SnapProcessor ` | ` .sps ` , ` .spb ` | Tobii Dynavox Snap format |
603- | ` GridsetProcessor ` | ` .gridset ` | Smartbox Grid 3 format |
604- | ` TouchChatProcessor ` | ` .ce ` | PRC-Saltillo TouchChat format |
605- | ` ApplePanelsProcessor ` | ` .plist ` | iOS Apple Panels format |
606- | ` AstericsGridProcessor ` | ` .grd ` | Asterics Grid native format |
607- | ` ExcelProcessor ` | ` .xlsx ` | Microsoft Excel format |
671+ | Processor | File Extensions | Description |
672+ | ----------------------- | ----------------------- | ----------------------------- |
673+ | ` DotProcessor ` | ` .dot ` | Graphviz DOT format |
674+ | ` OpmlProcessor ` | ` .opml ` | OPML hierarchical format |
675+ | ` ObfProcessor ` | ` .obf ` , ` .obz ` | Open Board Format (JSON/ZIP) |
676+ | ` SnapProcessor ` | ` .sps ` , ` .spb ` | Tobii Dynavox Snap format |
677+ | ` GridsetProcessor ` | ` .gridset ` , ` .gridsetx ` | Smartbox Grid 3 format |
678+ | ` TouchChatProcessor ` | ` .ce ` | PRC-Saltillo TouchChat format |
679+ | ` ApplePanelsProcessor ` | ` .plist ` | iOS Apple Panels format |
680+ | ` AstericsGridProcessor ` | ` .grd ` | Asterics Grid native format |
681+ | ` ExcelProcessor ` | ` .xlsx ` | Microsoft Excel format |
608682
609683---
610684
0 commit comments