home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Online / InetDial / translator42.lha / Translator / Docs / translator.autodoc next >
Text File  |  1995-04-07  |  4KB  |  129 lines

  1.  
  2.  
  3. TABLE OF CONTENTS
  4.  
  5. translator.library/--background--
  6. translator.library/Translate
  7. translator.library/SetAccent
  8. translator.library/LoadAccent
  9.  
  10. translator.library/--background--           translator.library/--background--
  11.  
  12.     OVERVIEW
  13.     Version 42 of the translator library supports multi-lingual
  14.     text to phoneme translation. It maintains a list of loaded
  15.     accent files. The user can select the accent with the Translator
  16.     preferences program.
  17.  
  18.     COMPATIBILITY
  19.     Great care has been taken to ensure the new library works in
  20.     all situations where the old one did. Because the new library
  21.     has more to do, it is more likely somthing will go wrong.
  22.     The old Translate() interface did not provide sufficient
  23.     room for expansion. In this version errors are reported
  24.     to the user by means of a requester. This includes reporting
  25.     syntax errors in the Accent files.
  26.     Functions in this library may be called from tasks even
  27.     if they might cause DOS I/O.
  28.     
  29.     The library creates a new base for each call to OpenLibrary.    
  30.     However the list of loaded accents is global to all library bases.
  31.  
  32. translator.library/Translate                       translator.library/Translate
  33.  
  34.     NAME
  35.     Translate -- Convert an text string into narrator device phonemes.
  36.  
  37.     SYNOPSIS
  38.     rtnCode = Translate(inString, inLength, outBuffer, outLength)
  39.     D0                  A0        D0        A1         D1
  40.  
  41.     LONG Translate( STRPTR inString, LONG inLength, STRPTR outBuffer,
  42.         LONG outlen );
  43.  
  44.     FUNCTION
  45.     The translate function converts a text string into
  46.     a string of phonetic codes suitable as input to the
  47.     narrator device. The V42 version may need to call the DOS
  48.     library. If called by a task it will start a process to do
  49.     the I/O. The origional version allocated no external resources
  50.     including memory or other shared libraries. The new version
  51.     allocate memory and may call Exec and DOS functions. Thus
  52.     there is the possibility of these calls failing. However the
  53.     privious version was documented so:
  54.     
  55.         The only error that can occur is overflowing the outBuffer.
  56.     
  57.     For this reason no error code can be returned. If an error
  58.     occurs a message is displayed in a requester or to the console
  59.     and 0 is returned. The output buffer set to an empty string.
  60.     
  61.     INPUTS
  62.     inString - pointer to English string
  63.     inLength - length of English string
  64.     outBuffer - a char array which will hold the phonetic codes
  65.     outLength - the length of the output array
  66.  
  67.     RESULTS
  68.     rtnCode - zero if no error has occured.
  69.     The only error that can occur (as far as the calling process
  70.         need be concerned) is overflowing the outBuffer.
  71.     
  72.     If Translate() determines that an overflow will occur, it
  73.     will stop the translation at a word boundary before the
  74.     overflow happens.  If this occurs, rtnCode will be a
  75.     negative number whose absolute value indicates where in
  76.     inString Translate() stopped.  The user can then use the
  77.     offset-rtnCode from the beginning of inString in a
  78.     subsequent Translate() call to continue the translation.
  79.  
  80.     SEE ALSO
  81.     narrator.device/CMD_WRITE
  82.  
  83. translator.library/SetAccent                    translator.library/SetAccent
  84.  
  85.     NAME
  86.     Translate -- Set the accent to be used with Translate(). (V42)
  87.     
  88.     SYNOPSIS
  89.     rtnCode = SetAccent(STRPTR accent)
  90.     D0                  A0
  91.  
  92.     BOOL SetAccent(accent)
  93.  
  94.     FUNCTION
  95.     Specify the default Accent file to be used by the Translate()
  96.     function. Either the pathname or just the accent name may be
  97.     specified. In the latter case LOCALE:Accents/ is searched.
  98.     This only affects the current instance of the OpenLibrary. To affect
  99.     further instances ENV:Sys/Translator.prefs needs to be changed.
  100.     
  101.     INPUTS
  102.     accent - name or path of a accent file
  103.     
  104.     RESULTS
  105.     Boolean success of failure.
  106.  
  107. translator.library/LoadAccent                 translator.library/LoadAccent
  108.  
  109.     NAME
  110.     LoadAccent -- (Re)load an accent file into the cache. (V42)
  111.     
  112.     SYNOPSIS
  113.     rtnCode = LoadAccent(accent)
  114.     D0                   A0
  115.  
  116.     BOOL LoadAccent(STRPTR accent)
  117.  
  118.     FUNCTION
  119.     The narrator library maintains a cache of loaded accent files.
  120.     This cache is flushed on low memory situations. This function
  121.     loads (and possible replaces an existing entry) an accent file.
  122.     
  123.     INPUTS
  124.     accent - name or path of a accent file
  125.     
  126.     RESULTS
  127.     Boolean success of failure.
  128.  
  129.