eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mkdictlist 1.1KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/python
  2. #
  3. # Copyright (C) 2011 Reece H. Dunn
  4. # Licence: GPLv3
  5. #
  6. # A script for generating the dictionary Makefile rules from the files in dictsource.
  7. import sys
  8. import os
  9. dictionaries = {}
  10. for filename in os.listdir('dictsource'):
  11. if filename.endswith('_rules') or filename.endswith('_list') or filename.endswith('_listx'):
  12. dic, cat = filename.split('_')
  13. if not dic in dictionaries.keys():
  14. dictionaries[dic] = []
  15. dictionaries[dic].append('dictsource/%s' % filename)
  16. print '##### dictionaries:'
  17. print
  18. print 'dictionaries: \\'
  19. for n, name in enumerate(sorted(dictionaries.keys())):
  20. if not name in ['bo']: # espeak fails to read these voices
  21. if n == len(dictionaries.keys()) - 1:
  22. print '\tespeak-data/%s_dict' % name
  23. else:
  24. print '\tespeak-data/%s_dict \\' % name
  25. for name, files in sorted(dictionaries.items()):
  26. print
  27. print '%s: espeak-data/%s_dict' % (name, name)
  28. print 'dictsource/%s_extra:' % name
  29. print '\ttouch dictsource/%s_extra' % name
  30. print 'espeak-data/%s_dict: src/espeak espeak-data/phontab %s dictsource/%s_extra' % (name, ' '.join(sorted(files)), name)
  31. print '\tcd dictsource && ../src/espeak --compile=%s && cd ..' % name