Debian Codegraph @

src/data/festival/lib/dicts/upc/upclex_postlex.scm

raw
1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ;;; Lexicon, LTS and Postlexical rules for upc_catalan
3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4 ;;; Adapted for Catalan by the UPC team
5 ;;;
6 ;;; (c) Antonio Bonafonte
7 ;;; Universitat Politècnica de Catalunya, Barcelona, Spain
8 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9
10 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
11 ;;;
12 ;;; Postlexical Rules
13 ;;;
14 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15
16 (define (upc_catalan::postlex_rule1 utt)
17 "(upc_ca::postlex_rule1 utt)
18 A postlexical rule form adding the phoneme /r/ to an infinitive verb followed
19 with a dashed weak pronoun (pronoms febles amb guio)"
20 (mapcar
21 (lambda (w)
22 ;; do something
23 (cond ((and (string-matches (item.name w) "-.*")
24 ;; item starts with a dash "-"
25
26 (string-matches (item.feat w "p.name") ".*r$")
27 ;; previous word ends with the character "r"
28
29 (not (string-matches (item.feat w "R:SylStructure.daughtern.daughtern.name" ) "r"))
30 ;; last phoneme of previous word is NOT "r"
31 )
32
33 ; (format t "upc_catalan::postlex_rule1 - add r to previous word (%s) %s\n" (item.feat w "p.name") (item.name w))
34
35 (set! last_pho (item.relation (item.daughtern (item.relation.daughtern (item.prev w) 'SylStructure)) 'Segment))
36
37 (item.relation.insert last_pho 'Segment (list "r") 'after)
38 (item.relation.insert last_pho 'SylStructure (item.next last_pho) 'after)))
39 )
40 (utt.relation.items utt 'Word))
41 utt)
42
43 (define (upc_catalan::postlex_rule2 utt)
44 "(upc_ca::postlex_rule1 utt)
45 A postlexical rule form correcting phenomena over word boundaries."
46 (mapcar
47 (lambda (s)
48 ;; do something
49 )
50 (utt.relation.items utt 'Segment))
51 utt)
52
53
54 (provide 'upclex_postlex)