home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Online / InetDial / translator42.lha / Translator / Docs / translator.man < prev    next >
Text File  |  1995-05-16  |  17KB  |  511 lines

  1.  
  2.  
  3.  
  4.                translator.library - Version 42.1
  5.  
  6.  
  7.  
  8.               Copyright (c) 1995 Francesco Devitt
  9.  
  10.  
  11.                       April 10, 1995
  12.  
  13.       29a Kinghorne St
  14.       Strathmore                      Telephone: +64 4 388 3215
  15.       Wellington                  Internet: ffranc@comp.vuw.ac.nz
  16.       New Zealand
  17.  
  18. 1    Status
  19.  
  20.  
  21. Version 42.1 of the translator library is not in the public domain. Source
  22. is not available.  The library and accent files are freely distributable
  23. provided no profit is made from them. Accent files may have additional
  24. or separate restrictions placed on them by their authors. Note that the
  25. American and English files have been derived from work by the Naval
  26. Research Laboratory, USA - these may not be used commercially.
  27.  
  28.  
  29.  
  30. 2    Introduction
  31.  
  32.  
  33. With versions of the Amiga OS before 2.1 Commodore supplied text-
  34. to-speech software on the Workbench discs.  This library replaces the
  35. Commodore supplied translator library. The original translates text to
  36. phonemes for use with the narrator device. It is used by programs that
  37. produce speech output such as `Say' and `Term'. Unfortunately for non-
  38. American users the original library translates all text as if it were
  39. American English. It does not handle other languages or dialects well.
  40.    Version 42.1 of the translator library is a drop-in replacement and
  41. works with all software that currently uses the Commodore speech sys-
  42. tem. With this version of translator library the user can specify which
  43. language the translator should use.  The library translates text faster
  44. than the original and, when provided with an accent file extracted from
  45. the original library, to the same quality. It is not difficult to write
  46. translation files for most languages - with the exception of languages
  47. like English and French which have more exceptions than most. I hope that
  48. users of this system will be motivated to create accent description files
  49. for the language(s) they speak.
  50.  
  51.    The accent may be selected with the use of the Translator preferences
  52. program, or alternatively by the use of accent hints within the text to
  53. be translated. See the section on the `scope' directive.
  54.  
  55. The translator is implemented as a shared library, so what is shared?
  56.  
  57.    o A sempahore to control access to shed data
  58.  
  59.    o A list of loaded accent files
  60.  
  61.    o The loaded accent files themselves
  62.  
  63.    o The library code
  64.  
  65.    o ENV:Sys/Translator.prefs specifying the default accent
  66.  
  67.  
  68. The following items are not shared, each time the library is opened
  69. new copies are made.
  70.  
  71.    o The currently selected accent
  72.  
  73.    o A stack of selected-accent scopes
  74.  
  75.    o Other open library pointers that are needed
  76.  
  77.    o The library base
  78.  
  79.  
  80.  
  81. 3    Requirements
  82.  
  83.  
  84.    o For the translator library to be of any use the narrator device is
  85.      also necessary. This was supplied with the Amiga operating system
  86.      up to version 2.04. All versions of the device still appear to
  87.      work with 3.0 systems.  Unfortunately the narrator device pronounces
  88.      everything in an American accent and does not support some phonemes
  89.      needed to pronounce some languages (including English). But at least
  90.      using the new translator library the pronunciation will be closer to
  91.      what it should like.
  92.  
  93.    o This library works with any Amiga system with at least version
  94.      1.3 of the OS. There are three versions supplied, one that runs on
  95.      any system, one for systems with OS versions 2.04 or better, and
  96.      one for such systems with a 68020 or better processor.
  97.  
  98.    o The locale library is used if available but is not required.
  99.  
  100.    o The installation script requires Commodore's `Installer' pro-
  101.      gram, supplied with KS 2.1 and above, and available from Aminet.
  102.  
  103.    o Note that the `Say' command provided with the Amiga OS 2.04
  104.      appears to have a bug in the GUI when used with KingCON. This
  105.      cause strange window update behaviour. I say this because with
  106.      the release of this library it may be the first time you use the Say
  107.      command.
  108.  
  109.  
  110.  
  111. 4    Installation
  112.  
  113.  
  114. Click on the Install icon and follow directions. This will install the library
  115. and associated files on to your Workbench disc named `SYS:'. This may
  116. be a hard disc.
  117.  
  118.  
  119.    If you do not have the Installer program you are on your own. Basi-
  120. cally this is what you need to do:
  121.  
  122. Copy "XXX_translator.library" to Libs:translator.library
  123. Copy #?.accent to LOCALE:Accents/
  124.  
  125.    The version of library to install depends on your system. The `Libs/'
  126. directory contains 3 library files.  The library with a `v33' prefix
  127. is designed for systems with any CPU and an OS version before 2.04
  128. although it will work on any Amiga system.  Prefix `v37' is for
  129. systems with an OS version 2.04 or better and any CPU. `020' is
  130. for systems with a 68020 or better and Amiga OS 2.04 or better.
  131.  
  132. For some reason the 020 version is larger that the v37 version.
  133. It *is* very *slightly* faster though.
  134.  
  135. The `Translator' preferences program and the `translate' and `flushlib'
  136. utilities do not work with versions of the Amiga OS before 2.04.
  137.  
  138.  
  139.  
  140. 5    Translator preferences program
  141.  
  142.  
  143. The Translator prefs program does not work with pre-2.04 OS versions.
  144. It is run by double clicking on its icon. In addition to allowing the user
  145. to select the accent to be used, it will allow the user to have a test string
  146. translated by the library and spoken by the narrator device. The translator
  147. preferences program was made using GadToolsBox and is not localised.
  148.  
  149.    This command also controls how a new accent may be selected in the
  150. text to be spoken. By default braces are used to begin new scopes and
  151. backslash and space used to delimit the names of accents. For example:
  152.  
  153.     \english
  154.     Hello there my name is {\maori Hone Ropata}
  155.     and I am \maori{Maori.}
  156.  
  157.    In this example the text is pronounced as English except for the
  158. Maori words. Changing the accent is effective until the scope defined by
  159. the braces is closed. If the scope starts immediately after the accent is
  160. changed that change is as if it were within that scope and ends when
  161. the scope ends as in the second `\maori{Maori.}' case above. Changing
  162. the accent outside any scope is effective until the application using the
  163. library quits. Note that these changes are per open library.
  164.    Note that the after-accent-name character may be specified as null
  165. (ie: "") which means any non-alphanumeric character terminates the ac-
  166. cent name. This is the default. To deactivate the change-accent feature
  167. set all characters to the empty string.
  168.  
  169.  
  170.  
  171. 6    Utilities
  172.  
  173.   NAME
  174.            accent
  175.   USAGE
  176.            accent [ SET _ LOAD ] <language-file>
  177.  
  178.  
  179.    Systems with OS 2.04 or better should NOT use this command
  180. as it does not allow the scope/accent codes to be specified.  Use the
  181. translator preferences instead.This command loads and/or sets the cur-
  182. rent language.  Loading a language brings it into the libraries inter-
  183. nal cache.  This is also useful when debugging a language file; the
  184. language in the cache that contains the same name will be replaced.
  185. Setting a language indicates which language should be used and modi-
  186. fies `ENV:Sys/Translator.prefs'. For pre-2.04 systems this utility and
  187. setting `ENV:Sys/Translator.prefs' are the only ways of selecting the
  188. accent.
  189.  
  190.  
  191.   NAME
  192.            extract
  193.   USAGE
  194.            extract [ <pre-V42-translator.library-file> ]
  195.  
  196.  
  197.    This command reads in the specified pre-V42 translator library (or
  198. libs:translator.library) and extracts from it a language file that produces
  199. the same output as the origional translator library. The result is output
  200. to standard output and may be redirected to "LOCALE:Accents/american.accent".
  201. This command also works with libraries produced by `TLpatch'.
  202.  
  203.   NAME
  204.            flushlib
  205.   USAGE
  206.            flushlib <library-name> [ REMOVE ]
  207.  
  208.  
  209.    Flushes the specified library from memory if currently un-opened.
  210. If a process currently has the library open, it will be flushed when all
  211. processes have closed it. The REMOVE keyword specifies that the library
  212. should not be flushed, only removed from the Exec library list.  This
  213. should only be used if a library has crashed. This command does not
  214. work with pre-2.04 systems.
  215.  
  216.  
  217.   NAME
  218.            translate
  219.   USAGE
  220.            translate [ LIB <library-name> ] text ...
  221.  
  222.  
  223.    Translates the text into phoneme form using the `translator.library'
  224. (of whatever version). An alternative library may be specified. Note that
  225. this must be renamed; both its filename and the name found within the
  226. file using AZap or a similar utility. In other words the system does not
  227. allow two libraries with the same internal name to be loaded at the same
  228. time. This command does not work with pre-2.04 systems.
  229.  
  230. 7    Accent file format
  231.  
  232.  
  233. The files are to be kept in `LOCALE:Accents/' and have a `.accent' ex-
  234. tension. They are named `XXX.accent' where the `XXX' is replaced with
  235. `american', `italiano', `cymraeg', `english', `deutsch', `latinus', `jive',
  236. etc. That is, it should be the written name of the language in the lan-
  237. guage. At a later date they may be accompanied by `.voice' files which
  238. will contain information for a new implementation of the narrator device
  239. that someone (else) might write. Each line of the file may be one of four
  240. things:
  241.  
  242.  
  243.    1.blank lines are ignored
  244.  
  245.    2.comment lines beginning with `#' are ignored
  246.  
  247.    3.directives begin with `%'
  248.  
  249.    4.all other lines are pronuciation rules
  250.  
  251.    Spaces are ignored except where they separate arguments to `com-
  252. mands. Spaces are only significant if enclosed in double quotes (") or
  253. escaped with a backslash (\).  Characters that would otherwise have
  254. special meaning may be used anywhere if they are preceded with a back-
  255. slash.
  256.  
  257.  
  258.  
  259. 7.1   Directives
  260.  
  261. Directives in an accent file are introduced by a percent character (%)
  262. followed by the name of the directive and its arguments.
  263.  
  264.  
  265.   DIRECTIVE
  266.                stress
  267.   SYNTAX
  268.                %stress <N>
  269.  
  270.  
  271.    Syllabic stress can be automatically added to words that do not al-
  272. ready contain stress marks (digits).  This command controls whether
  273. stress is added and which syllable should be stressed. Stressed syllables
  274. have the stress value of 4 added unless this is changed by the `emphasis'
  275. directive.
  276.    For example, the English accent file contains a `%stress 1' command
  277. which indicates that the 1st syllable is to have stress added.  Unfor-
  278. tunately this is only occasionally the right thing to do in the English
  279. language! Other languages are more regular. Italian and Welsh nearly
  280. always put the stress on the penultimate syllable.
  281.    Negative values for N indicate a count of syllables backward from the
  282. end of a word. For example, -2 indicates that the penultimate syllable
  283. should have stress added. Here are some examples:
  284.  
  285.  
  286. %stress 1      # Stress the first syllable as in English
  287. %stress -2     # Stress the penultimate syllable as in Welsh
  288. %stress 0      # Do not automatically add stress
  289.  
  290.  
  291.  
  292.    Words already containing stress indicating digits, and words con-
  293. taining a back-quote (`) will not have stress added. The symbol `#' has
  294. special meaning in that is separates groups of phonemes into "words"
  295. in so far as the syllable count is concerned but does not appear in the
  296. resulting phoneme string.
  297.  
  298.   DIRECTIVE
  299.                emphasis
  300.   SYNTAX
  301.                %emphasis <N>
  302.  
  303.  
  304.    Specifies the level that the `stress' directive applies to words.
  305.  
  306.  
  307.   DIRECTIVE
  308.                class
  309.   SYNTAX
  310.                %class <member> [ <member> ... ]
  311.  
  312.  
  313.    Classes are sets of lists of characters which may be tested against
  314. in a pattern. The members may contain more than one character. For
  315. example Vowels may be declared as:
  316.  
  317. %class vowel a e i o u y
  318. %class suffix e ely er ent
  319.  
  320.  
  321.  
  322.   DIRECTIVE
  323.                complain
  324.   SYNTAX
  325.                %complain <level>
  326.  
  327.  
  328.    Specifies what should be done if the right-hand-side of a rule is an
  329. invalid phoneme string: 1 = do not check, 2 = give a warning for each
  330. errorneous phoneme, and 3 = stop processing the language, consider
  331. it an error. This command is implemented so that if a new translator
  332. device is made, with extra phonemes this library will still work.
  333.  
  334.  
  335.   DIRECTIVE
  336.                separator
  337.   SYNTAX
  338.                %separator <string>
  339.  
  340.  
  341.    This commands lists the *characters* used to separate words. The
  342. default consists of space, end of line, tab, full stop, comma, question
  343. mark, exlamation mark, colon, left/right parentheses and semicolon.
  344. These may be redefined. For example:
  345.  
  346. %separator " \n\t,.()-"
  347.  
  348.    Note that `\n' represents a new line character and `\t' a tab. Note
  349. also that the whole string is in double quotes bacause it contains a space.
  350.  
  351. 7.2   Context Rules
  352.  
  353. Rules are of the form:
  354.  
  355.  
  356. <left-context> [ <match-string> ] <right-context> = <phonemes> OR { <text> }
  357.  
  358.  
  359.    When processing a character of a word, each rule for which the match
  360. string matches has its left and right contexts compared with the left and
  361. right context strings. If they match the phonemes on the right hand side
  362. are output OR the text enclosed in braces is then translated.
  363. The match string must not contain pattern codes, only text.
  364.  
  365. THE ORDER OF CONTEXT RULES IN THE FILE IS SIGNIFICANT.
  366.  
  367.  
  368.    The rules are searched in the order they appear in the file.  This
  369. means that a general rule should appear after a more specific rule. It
  370. also means that the language file may contain rules which can never be
  371. used. These are called bugs!
  372.    The left and right contexts are strings which may contain pattern
  373. codes. These include:
  374.  
  375.     (<class>)   Must match one member of class
  376.     (<class>+)  Must match one or more members of class
  377.     (<class>*)  Must match zero or more members of class
  378.     (<class>~)  Must not be a member of class
  379.     $           Must be a number of word separator
  380.  
  381.  
  382.    Other characters must match exactly. Case is ignored; so `a' and `A' are
  383. the same, as are `ë' and `Ë'. For example a right context consisting of
  384. `(vowel+)(suffix)$' will match one or more vowels followed by a suffix
  385. and then an end of word separator. If no rule is found for a particular
  386. accented character the the character will be de-accented and the system
  387. will try again.
  388.    A backslash may be used to include characters such as `$' and `('
  389. that would otherwise have special meaning. Note that the left context
  390. is searched from the matched string backwards.  This means that the
  391. pattern `a(vowel+)' can never match as a left context. The `(vowel+)'
  392. will have consumed all the a's possible.
  393.  
  394. The right context may be recursive. If it starts with `{'
  395. and ends with '}' the contents are not treated as phonemes. Instead
  396. they are translated as text. Spaces within the braces are significant,
  397. for example:
  398.  
  399. [1] = { one }
  400. [2] = { two }
  401.  
  402. There may be language changing directives within the braces,
  403. for example in the Italiano accent file the following might be
  404. found:
  405.  
  406. [computer] = {\english computer}
  407.  
  408.  
  409.  
  410. 7.3   Phonemes
  411.  
  412. The problem with me reproducing the list of what the phonemes sound
  413. like, is that the examples are in English. eg: IY as in `beet'.
  414.    To tell what they really sound like type:
  415.    `echo > SPEAK:opt/a1 <phonemes>'
  416.    The phonemes used by Translator and Narrator systems are docu-
  417. mented in the Devices RKM. The list is reproduced here. Take special
  418.  
  419. note of the QX, Q and DX phonemes which are especially useful for
  420. non-english languages.
  421.    There are some phonemes which are not supported by the device,
  422. including the non-dipthongal U and aIR sounds. It also has problems
  423. pronouncing the T in thirty properly. Both THER4TIY and THER4DIY
  424. are pronounced as the latter. Doubling the T as in THER4TTIY sounds
  425. fine.
  426.  
  427.  
  428. Vowels
  429. IY           bEEt, EAt
  430. IH           bIt, In
  431. EH           bEt, End
  432. AE           bAt, Ad
  433. AA           bArgain, tArget
  434. AH           tUg, bUg, bUt, Up
  435. AO           shORE, wAR
  436. UH           bOOk, sOOt
  437. ER           bIRd, EArly
  438. OH           bOrder (sounds like the letter 'O' when used by itself)
  439. AX           About (never stressed)
  440. IX           solId (never stressed)
  441.  
  442.  
  443. Dipthongs
  444. EY           bAY, AId
  445. AY           bIde, I
  446. OY           bOY, OIl
  447. AW           bOUnd, OWl
  448. OW           bOAt, OWn
  449. UW           brEW, bOOlean, pOO, crEW (except that it is a dipthong)
  450.  
  451.  
  452. Consonants
  453. R            Red
  454. RX           Red (This is not mentioned in RKRM:Devs)
  455. W            Wag
  456. M            Men
  457. NX           siNG
  458. S            Soon
  459. F            Fed
  460. Z            haS, Zoo
  461. V            Very
  462. CH           CHeck
  463. /H           Hole
  464. B            But
  465. D            Dog
  466. K            Keg, Copy
  467.  
  468. L            Long
  469. LX           Long (This is not mentioned in RKRM:Devs)
  470. Y            Yellow
  471. N            No
  472. SH           SHy
  473. TH           THin
  474. ZH           pleaSure
  475. DH           THen
  476. WH           WHen
  477. J            JuDGE
  478. /C           supposedly loCH, or (german) baCH, but really like CHurCH
  479. P            Put
  480. T            Toy (except before IY when it is pronounced D)
  481. G            Guest
  482.  
  483.  
  484. Others
  485. DX           piTY (tongue flap)
  486. Q            kitt(Q)en (glottal stop)
  487. QX           (Silent vowel - can lenghten the previous vowel)
  488.  
  489.  
  490. Contractions
  491. UL           AXL
  492. IL           IXL
  493. UM           AXM
  494. IM           IXM
  495. UN           AXN
  496. IN           IXN
  497.  
  498.  
  499. Symbols
  500. Digits 1-9    Syllabic stress
  501. .            Sentence final character
  502. ?            Question sentence final character
  503. -            Phrase delimiter
  504. ,            Clause delimiter
  505. ()           Put parentheses about noun phrases
  506.  
  507.  
  508. Translator
  509. `            Do not add stress marks to this word
  510. #            Word boundard for the purposes of adding stress marks
  511.