- Timestamp:
- 05/26/08 14:11:03 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/Scripts/Audio_scripts/AudioSegmentation/AudioBook/Dictionary.pm
r2590 r2593 1 1 #! /usr/bin/perl 2 #################################################################### 3 ### 4 ### script name : Dictionary.pm 5 ### version: 0.1 6 ### created by: Ken MacLean 7 ### mail: contact@voxforge.org 8 ### Date: 2008.05.05 9 ### Command: perl ./Dictionary.pm 10 ### 11 ### Copyright (C) 2008 Ken MacLean 12 ### 13 ### This program is free software; you can redistribute it and/or 14 ### modify it under the terms of the GNU General Public License 15 ### as published by the Free Software Foundation; either version 2 16 ### of the License, or (at your option) any later version. 17 ### 18 ### This program is distributed in the hope that it will be useful, 19 ### but WITHOUT ANY WARRANTY; without even the implied warranty of 20 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 ### GNU General Public License for more details. 22 ### 23 #################################################################### 2 $VERSION = 0.1; 3 4 =head1 NAME 5 6 AudioBook::Dictionary - Pronunciation Dictionary processing 7 8 =cut 9 24 10 package AudioBook::Dictionary; 25 11 use strict; … … 30 16 31 17 my $command; 32 #################################################################### 33 ### Constructor 34 #################################################################### 18 19 =head1 METHODS (not user accessible) 20 21 =cut 22 23 =head2 new 24 25 Constructor - creates a dictionary object 26 27 =cut 28 35 29 sub new { 36 30 my ($class,$super) = @_; … … 42 36 return \%self; 43 37 } 44 #################################################################### 45 ### Methods 46 #################################################################### 38 39 =head2 findOutOfVocabularyWords 40 41 Using the HTK HDMan command to lookup words in the pronunication dictionary , and flag out-of-vocabulary words 42 43 =cut 44 47 45 sub findOutOfVocabularyWords { # public 48 46 my ($self,$voxforgeDict, $missing_words)= @_; … … 82 80 return $missingwordsfound; 83 81 } 82 83 =head2 getPronunciations 84 85 Use the Sequitor g2p script (Python) to generate pronunications for out-of-vocabulary words 86 87 =cut 84 88 85 89 sub getPronunciations { # public … … 130 134 } 131 135 136 =head2 updatePronDict 137 138 If the dictionary switch is set to yes, then update the pronunciation dictionary with the word pronunications 139 generated by g2p 140 141 =head3 Note 142 143 The pronunciations generated by the Sequitor G2P scripts need to be manually reviewed before any new pronunciations 144 are added to the pronunciation dictionary. 145 146 =cut 147 132 148 sub updatePronDict { # public 133 149 my ($self)= @_; … … 163 179 return 1; 164 180 } 181 =head1 Change Log 182 183 2008.05.05 - 0.1 - created 184 185 =head1 AUTHOR 186 187 Ken MacLean 188 contact@voxforge.org 189 190 =head1 COPYRIGHT AND LICENSE 191 192 Copyright (C) 2008 Ken MacLean 193 194 This program is free software; you can redistribute it and/or 195 modify it under the terms of the GNU General Public License 196 as published by the Free Software Foundation; either version 2 197 of the License, or (at your option) any later version. 198 199 This program is distributed in the hope that it will be useful, 200 but WITHOUT ANY WARRANTY; without even the implied warranty of 201 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 202 GNU General Public License for more details. 203 204 =cut 165 205 1;