Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Ortiz <rafael@activitycentral.com>2011-07-12 19:42:35 (GMT)
committer Rafael Ortiz <rafael@activitycentral.com>2011-07-12 19:42:35 (GMT)
commiteca2f53b7d01072876e954b62c0d96435672dfa5 (patch)
treeaa537257c78d40a68bab82c7fa9a66469805eef6
parentc58fe3fa2d05ce86656d6d259a0881e89f69ca15 (diff)
adding friendlynames to combo
-rw-r--r--voice.py28
1 files changed, 5 insertions, 23 deletions
diff --git a/voice.py b/voice.py
index 14e3756..0268ec6 100644
--- a/voice.py
+++ b/voice.py
@@ -70,7 +70,6 @@ expectedVoiceNames = [
]
_allVoices = {}
-#_allVoicesRP = {}
_defaultVoice = None
class Voice:
@@ -85,40 +84,34 @@ class Voice:
friendlyname = friendlyname.replace('english-us', 'us')
- friendlynameRP = name #friendlyname for RP
+ friendlynameRP = name # friendlyname for RP
friendlynameRP = friendlynameRP.replace('english_rp', 'rp')
friendlynameRP = friendlynameRP.replace('english_wmids', 'wmids')
parts = re.split('[ _-]', friendlyname)
partsRP = re.split('[ _]', friendlynameRP) #RE for english_RP
- #print friendlynameRP
self.short_name = _(parts[0].capitalize())
self.friendlyname = ' '.join([self.short_name] + parts[1:])
friendlynameRP1 = None
if friendlynameRP == 'rp':
- #self.short_nameRP = _(partsRP[0].capitalize())
- #self.friendlynameRP1 = ''.join([self.short_nameRP] + ['Required'])
friendlynameRP1 = 'English (Required Pronunciation)'
- print friendlynameRP1
+ self.friendlyname = 'English (Required Pronunciation)'
friendlynameUS = None
if friendlyname == 'us':
friendlynameUS = 'English (USA)'
- print friendlynameUS
+ self.friendlyname = 'English (USA)'
friendlynameWMIDS = None
if friendlynameRP == 'wmids':
friendlynameWMIDS = 'English (West Midlands)'
- print friendlynameWMIDS
-
+ self.friendlyname = 'English (West Midlands)'
def __cmp__(self, other):
return cmp(self.friendlyname, other.friendlyname if other else '')
- # def __cmpRP__(self, other):
- # return cmpf(self.friendlynameRP1, other.friendlynameRP if other else '')
def allVoices():
@@ -128,24 +121,14 @@ def allVoices():
for language, name in espeak.voices():
voice = Voice(language, name)
_allVoices[voice.friendlyname] = voice
+
return _allVoices
-#def allVoicesRP():
-# if _allVoicesRP:
-# return _allVoicesRP
-
-# for language, name in espeak.voices():
-# voiceRP = VoiceRP(language, name)
-# _allVoicesRP[voiceRP.friendlynameRP1] = voiceRP
-# return _allVoicesRP
def by_name(name):
return allVoices().get(name, defaultVoice())
-#def by_nameRP(name):
-# return allVoicesRP().get(name, defaultVoice())
-
def defaultVoice():
"""Try to figure ofuft the default voice, from the current locale ($LANG).
Fall back to espeak's voice called Default."""
@@ -156,7 +139,6 @@ def defaultVoice():
return _defaultVoice
voices = allVoices()
-# voicesRP = allVoicesRP()
def fit(a,b):
"Compare two language ids to see if they are similar."