Using Lexicon in DAISY Pipeline
In DAISY Pipeline several scripts provide the option of using text-to-speech (TTS) to record text. Few examples of such script are- DTBook to DAISY 3 (TTS Enhanced) and DTBook to EPUB 3 (TTS Enhanced). Such scripts allow users to attach a Lexicon file to change pronunciation of words
The Lexicon option can be used to change the pronunciation of names, unique words, abbreviations and acronyms. Often the TTS voice does not pronounce words the way native language speakers do. This issue can be fixed to a great extent using this Lexicon feature.
Steps to use the Lexicon feature in DAISY Pipeline
You need to do the following:
- Create or modify a Lexicon xml file and include alternative pronunciations of words which you think are not read properly by TTS. A sample of the Lexicon file is given below.
- Select desired script in DAISY Pipeline and attach the Lexicon file. There are two ways to attach the Lexicon file to the conversion process:
- Method 1: In the script configuration screen, browse and select the Lexicon file. For example, in the DTBook to DAISY 3 (TTS Enhanced) script, after selecting the DTBook and clicking next, the Lexicon selection appears on second screen.
-
Method 2: Attach the Lexicon file to the content file by including the following line in its head element.
<link rel=”pronunciation” type=”application/pls+xml” href=”lexicon.xml”/>
Keep the lexicon.xml file in the same folder where the content file is located.
- Proceed with the conversion as usual. When conversion is complete, you will see the difference in pronunciation of those chosen words in the audio files in the output folder.
Configuring the Lexicon file
You can download this sample lexicon file and modify it.
Basically in this lexicon file you need to add the <lexeme> element for each word for which pronunciation is to be changed. The syntax of <lexeme> is as follows.
<lexeme>
<grapheme>Word</grapheme>
<phoneme>modified pronunciation</phoneme>
</lexeme>
In <grapheme> keep the word in the content for which you want to make pronunciation changes.
In <phoneme> insert the ‘IPA’ phoneme for the word in the content. You can search on the internet for the ‘IPA’ phoneme for your desired word. AI services like ChatGPT can also be used for it.
For example, see the lexicon file entry for the word “Yénkya” for which the desired pronunciation is “jeːncɑ”.
<lexeme>
<grapheme>Yénkya</grapheme>
<phoneme>ˈjeːncɑ</phoneme>
</lexeme>
Note that there are other ways to create lexicon file and use it in DAISY Pipeline. The process described should however help you get started with this useful feature.
See also
- DTBook XML to DAISY 3 Conversion Guide
- Using Text To Speech in DAISY Pipeline
- DAISY Pipeline: Word document to DTBook XML
- DAISY Pipeline Desktop Application Quick Start Guide
