| 1 |
;;; Copyright (C) 2009-2011 Sergio Oller |
| 2 |
;;; License: LGPL-2.1 |
| 3 |
;;; This script is free software; you can redistribute it and/or |
| 4 |
;;; modify it under the terms of the GNU Lesser General Public |
| 5 |
;;; License as published by the Free Software Foundation, |
| 6 |
;;; version 2.1 of the License. |
| 7 |
;;; |
| 8 |
;;; This script is distributed in the hope that it will be useful, |
| 9 |
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
;;; Lesser General Public License for more details. |
| 12 |
;;; |
| 13 |
;;; You should have received a copy of the GNU Lesser General Public |
| 14 |
;;; License along with this library; if not, write to the Free Software |
| 15 |
;;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 16 |
;; |
| 17 |
;; Catalan language description |
| 18 |
;; |
| 19 |
;; |
| 20 |
|
| 21 |
(define (set_voice_default voices) |
| 22 |
"set_voice_default VOICES sets as voice_default the first voice available from VOICES list" |
| 23 |
(let ( (finish nil) |
| 24 |
(voice nil) |
| 25 |
) |
| 26 |
(while (and voices (not finish)) |
| 27 |
(set! voice (car voices)) |
| 28 |
(if (assoc voice voice-locations) |
| 29 |
(begin |
| 30 |
(set! voice_default (intern (string-append "voice_" voice))) |
| 31 |
(set! finish t) |
| 32 |
) |
| 33 |
) |
| 34 |
(set! voices (cdr voices)) |
| 35 |
) |
| 36 |
(if (eq finish nil) |
| 37 |
(begin |
| 38 |
(print "Could not find any of these voices") |
| 39 |
(print voices) |
| 40 |
) |
| 41 |
) |
| 42 |
finish |
| 43 |
) |
| 44 |
) |
| 45 |
|
| 46 |
(defvar catalan-default-voices (list 'upc_ca_ona_hts 'upc_ca_pau_hts) |
| 47 |
"catalan-default-voices |
| 48 |
This variable's value contains the list of catalan voices ordered |
| 49 |
by a default preference. When choosing Catalan as a language, |
| 50 |
the first available voice of this list will be used.") |
| 51 |
|
| 52 |
(define (language_catalan) |
| 53 |
"(language_catalan) |
| 54 |
Inicialitza les veus catalanes per defecte." |
| 55 |
;;; Add the directory that contains catalan stuff (normalization, tagger, etc.) to load-path |
| 56 |
(defvar catalan-path (path-append (if (boundp 'datadir) datadir libdir) "upc_catalan/")) |
| 57 |
(if (not (member_string catalan-path load-path)) |
| 58 |
(set! load-path (cons catalan-path load-path))) |
| 59 |
(set! female1 (lambda () (voice_upc_ca_ona_hts))) |
| 60 |
(set! male1 (lambda () (voice_upc_ca_pau_hts))) |
| 61 |
(Param.set 'Language 'catalan) |
| 62 |
|
| 63 |
(set_voice_default catalan-default-voices) |
| 64 |
(eval (list voice_default)) |
| 65 |
) |
| 66 |
|
| 67 |
(language.names.add 'catalan (list 'catala)) |
| 68 |
|