home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Tools&Utilities / System Utilities / Speech Manager1.1.1 / Interfaces ƒ / Speech.r < prev   
Encoding:
Text File  |  1993-07-20  |  2.9 KB  |  93 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Speech.r
  3.  
  4.     Contains:    Rez definitions for App-defined Pronunciation Dictionaries
  5.  
  6.     Written by:    Tim Schaaff
  7.  
  8.     Copyright:    © 1992 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <1>     7/14/92    TIM        first checked in
  13.  
  14. */
  15.  
  16. #include "SysTypes.r"
  17.  
  18.  
  19. // 'dict' - User dictionary resource
  20.  
  21. type 'dict' {
  22.     longint = DictEnd >> 3;    // total byte length
  23.     longint = 'dict';        // Dictionary atom
  24.     longint = 1;            // format version
  25.     integer Script;            // script system (e.g. smRoman)
  26.     integer Language;        // language code (e.g. langEnglish)
  27.     integer Region;            // region code      (e.g. verUS)
  28.     unsigned longint;        // date last modified (seconds since Jan 1, 1904)
  29.     longint = 0;            // reserved 1
  30.     longint = 0;            // reserved 2
  31.     longint = 0;            // reserved 3
  32.     longint = 0;            // reserved 4
  33.     longint = $$CountOf(EntryArray);    // entry count
  34.     array EntryArray {
  35. EntryBegin:
  36.         integer = (EntryEnd[$$ArrayIndex(EntryArray)] -
  37.                    EntryBegin[$$ArrayIndex(EntryArray)])
  38.                   >> 3;                                // entry byte length
  39.         integer null,pron=0x21,abbr=0x22;            // entry type 
  40.         integer = $$CountOf(FieldList);                // field count
  41.         wide array FieldList {
  42. FieldBegin:
  43.             integer = (FieldEnd[$$ArrayIndex(EntryArray),$$ArrayIndex(FieldList)] -
  44.                        FieldBegin[$$ArrayIndex(EntryArray),$$ArrayIndex(FieldList)])
  45.                       >> 3;                            // field byte length (excluding padding)
  46.             integer null,tx=0x21,ph=0x22,pos=0x23;    // field type
  47.             string;                                    // field data
  48. FieldEnd:
  49.             align word;
  50.         };
  51. EntryEnd:
  52.     };
  53.     
  54. DictEnd:                    // end of dictionary resource
  55. };
  56.  
  57. // Note, the ThisSecond value in the following resource can be 
  58. // easily defined when Rez is invoked.  For example:
  59. //        rez -o Sample.rsrc -d "ThisSecond=`date -n`" DictSample.r
  60.  
  61. #ifndef ThisSecond
  62. #define    ThisSecond    0
  63. #endif
  64.  
  65. /* Here's a sample dictionary to demonstrate the proper format:
  66.  
  67. resource 'dict' (1, "TestDict") {
  68.     smRoman, langEnglish, verUS, ThisSecond,
  69.     {
  70.         pron, {tx, "SARAH",         ph, "_m2AY_s1IHst2AXr"},
  71.         pron, {tx, "ROOSEVELT",     ph, "_1EHf_d1IY_1AAr"},
  72.         pron, {tx, "SAMUEL",         ph, "_s1AEm_AY_2AEm"},
  73.         pron, {tx, "SHAKESPEARE",     ph, "_D2UX_b1AArd_2UXv_1AEv2AAn"},
  74.         pron, {tx, "OHIO",             ph, "_1OW%%h1AY%%1OW"},
  75.         pron, {tx, "ALEXANDER",     ph, "_1AEl_D2UX_p2AEl"},
  76.         pron, {tx, "CHICAGO",         ph, "_st1IHNk2IHN_1UXhny2IHn"},
  77.         pron, {tx, "BEARD",         ph, "_mUXstAES"},
  78.         pron, {tx, "DAVID",         ph, "_gAAl1AYAETs_f1OW"},
  79.         pron, {tx, "DEMOCRATS",     ph, "_r2IHp1UXblIHk2IHn"},
  80.         pron, {tx, "YANKEES",         ph, "_r1EHd_s1AAks"},
  81.         pron, {tx, "RACHEL",         ph, "_m2AY_n1IYs"},
  82.         pron, {tx, "NAKED",         ph, "_ny1UWd"},
  83.         pron, {tx, "OCTOBER",         ph, "_h1AAl2OW_w1IYn"},
  84.         pron, {tx, "MASSACHUSETTS", ph, "_t1AEks_2UX_C1UWsEHts"},
  85.         pron, {tx, "MISSISSIPPI",     ph, "_fl1UXd_k1UXnCr2IY"},
  86.         pron, {tx, "HANOVER",         ph, "_d1AArtmUXT_t1AWn"},
  87.         pron, {tx, "GREENWICH",     ph, "_h1OWm_2UXv_D2UX_r1IHC"},
  88.         pron, {tx, "FELIX",         ph, "_f1IYl2IHks_D2UX_k1AEt"},
  89.         pron, {tx, "WEDNESDAY",     ph, "_m1IHd_w1IYk"},
  90.     },
  91. };
  92.  
  93. */