File difference report generated by CSDiff by ComponentSoftware on 4/27/04 10:47 AM

Base file: C:\WINDOWS\Desktop\Jelske\nextens-win-bin-1.0-beta\lib\voices\dutch\net_nl_ib_mbrola\festvox\net_nl_accent.scm
Compared file: C:\WINDOWS\Desktop\Jelske\nextens-win-bin-1.0-beta\lib\voices\frisian\net_fy_ib_mbrola\festvox\net_fy_accent.scm

1c1,3
< ;;; $Id: net_nl_accent.scm,v 1.8 2003/04/01 14:38:04 emarsi Exp $
---
> ;;; $Id: net_fy_accent.scm, Jelske Dijkstra, 2004/02/03
> ;;; copy of betarelease nextens, net_nl_accent.scm,v 1.8 2003/04/01 14:38:04 
> ;;; emarsi Exp $
21c23,83
< (define (nl::basic_accent_placement utt)
---
> ;;; // JD only "clear accent" still in nl, but can be removed (see below)
> ;;; // accents with value '+' are continued in net_fy_tune.scm!
> 
> ;;; // fy::basic_accent_placement, called in net_fy_ib_mbrola.scm
> ;;; // fy::remove_accents defined below
> ;;; // pos en feats are local variables, a token is a word 
> ;;; // (separated by spaces), it's about the pos on token 
> ;;; // R:Token.parent.pos, e.g. this can be N, Adj or V
> ;;; // R:Token.parent.pos-attributes is e.g. sing or hulp (aux)
> 
> ;;; // If the word or (N or Adj is) or (V and not aux), then word gets 
> ;;; // accent +, or else just word.
> 
> ;(define (fy::basic_accent_placement utt)
> ;"
> ;\(fy::basic_accent_placement UTT\)
> 
> ;Apply a basic accent placement algorithm that accents all content
> ;words, leaving function words unaccented.
> ;"
> ;  ;; removing old accents is important when the function is called
> ;  ;; with an existing utterance, as in Nintens
> ;  (fy::remove_accents utt)
> ;  (mapcar 
> ;;; // 2003/10/14 all words get acc + for testing, because in the beginning 
> ;;; // no word got accent, because of lack of pos. 2003/10/14 (later): 
> ;;; // back to original situation. 
> ;   (lambda (word)
> ;     (set! pos (item.feat word "R:Token.parent.pos"))
> ;     (set! feats (item.feat word "R:Token.parent.pos-attributes"))
> ;     ;; a content word is defined a noun, adjective, or a verb that is
> ;     ;; not an auxiliary
> ;     (if (or
> ;	  (string-equal pos "N")
> ;	  (string-equal pos "Adj")
> ;	  (and (string-equal pos "V")
> ;	       (not (string-matches feats ".*hulp.*"))))
> ;	 (item.set_feat word 'acc '+)))
> ;   (utt.relation.items utt 'Word))
> ;  utt)
> 
> ;;; // -----
> ;;; // 2003/12/10: insert net_fy_accent_cart_tree to get 
> ;;; // net_fy_guess_pos (net_fy_token.scm) working, see an_diphone
> ;;; // error: EST ERROR {FND} Feature Syllable not defined, I think that method
> ;;; // general (net_fy_ib_mbrola.scm) calls this message, below 
> ;;; // net_fy_accent_car_tree my own experiment with nextens' 
> ;;; // net_nl_basic_accent_placement, after switching of the nextens' variant
> 
> (set! net_fy_accent_cart_tree
> '
>    (
>      (R:Syllable.parent.gpos is content)
>        ((stress is 1)
> 	 ((Accented))
> 	 ((NONE))
> 	 )
>    )
> )
> 
> (define (fy::basic_accent_placement utt)
23c85
< \(nl::basic_accent_placement UTT\)
---
> \(fy::basic_accent_placement UTT\)
30c92
<   (nl::remove_accents utt)
---
>   (fy::remove_accents utt)
33,42c95,117
<      (set! pos (item.feat word "R:Token.parent.pos"))
<      (set! feats (item.feat word "R:Token.parent.pos-attributes"))
<      ;; a content word is defined a noun, adjective, or a verb that is
<      ;; not an auxiliary
<      (if (or
< 	  (string-equal pos "N")
< 	  (string-equal pos "Adj")
< 	  (and (string-equal pos "V")
< 	       (not (string-matches feats ".*hulp.*"))))
< 	 (item.set_feat word 'acc '+)))
---
> ;;; // 2004/04/20: try and get word in lowercase letters, otherwise it would 
> ;;; // still get accent, even if it was a function word. Therefor: net_fy_
> ;;; // downcase and dword
> ;;; // JD23/01/2004:
> ;;; // this works:(if (not (member (item.name word) '("de" "op")))
> ;;; // 23/01/2004: maybe line above will work with define in token.scm 
> ;;; // (and member... and item.set_feat word 'pos 'FW) and over here in 
> ;;; // accent_placement: (fy::net_fy_gpos) and (if (not (string-egual 
> ;;; // (item.feat word 'pos) 'FW))( item.set_feat word 'acc '+))
>      (set! correct nil)
> 	   (net_fy_downcase word)
> 	   (net_fy_correct_downcase dword)
>      (if (string-equal correct "1")
> 	 (begin
> 	   (item.set_name word cword)
> 	   (set! dword cword)
> 	   ))
> ;     (if (not (member (item.name word) net_fy_gpos))
>      (if (not (member dword net_fy_gpos))
> 	 (item.set_feat word 'acc '+))
> 
> ;;; // 2004/02/03: net_fy_accentgroup defined below
>      (net_fy_accentgroup word));endlambda
45a121
> (define (net_fy_correct_downcase dword)
46a123,290
> ;;; // correct A into 
> (if (and (string-matches dword "[a][l][d][a-z]*")
> 	 (not (member dword '("alder-alderste" "alderbalderbst" "alderbalderminst" "alderbst" "alderdanichst" "alderearst" "aldergeloks" "alderivichst" "alderlei" "alderlst" "alderminst")))
> 	 (not (string-matches dword "[a][l][d][e][r][h][a-z]*")))
>     (begin
>       (set! curword (symbolexplode dword))
>       (set! seg (car curword))
>       (set! seg ') 
>       (set! cword nil)
>       (while (not (string-equal seg nil))
>        (if (string-equal cword nil)
> 	   (set! cword seg)
> 	   (set! cword (string-append cword seg)))
> 	     (set! curword (cdr curword))
> 	     (set! seg (car curword)))
> ;      (print cword)
>       (set! correct 1)
> ))
> 
> ;;; // correct O into 
> (if (and (string-matches dword "[o][f][a-z]*")
> 	 (not (member dword '("offinsyf" "offinsive" "offerbist" "offerbisten" "offerblok" "offerblokken" "offerdea" "offerdeaden" "offerdier" "offerdieren" "offerfeardich" "offerfeardige" "offerfeardichheid" "offerfeardichheden" "offerfeest" "offerfeesten" "offerfleis" "offerhichte" "offerhichten" "offerhout" "offerhouten" "offerhoutene" "offerje" "offerest" "offeresto" "offereste" "offeret" "offere" "offeren" "offerende" "offerend" "offerjefte" "offerjeften" "offerkiste" "offerlaam" "offerlamen" "offermiel" "offermielen" "offerreens" "offersin" "offerskaal" "offerskalen" "offerstien" "offerstiennen" "offerte" "offertes" "official" "officials" "offrearje" "offrearest" "offrearesto" "offreareste" "offrearet" "offreare" "offrearren" "offrearrend" "offrearende" "ofset" "ofsetdruk" "ofsetdrukken" "ofsetpapier" "ofsetpapieren" "ofsetpapierene" "oft" "oftewol")))
> 	 (not (string-matches dword "[o][f][f][i][s][a-z]*")))
>     (begin
>       (set! curword (symbolexplode dword))
>       (set! seg (car curword))
>       (set! seg ') 
>       (set! cword nil)
>       (while (not (string-equal seg nil))
>        (if (string-equal cword nil)
> 	   (set! cword seg)
> 	   (set! cword (string-append cword seg)))
> 	     (set! curword (cdr curword))
> 	     (set! seg (car curword)))
> ;      (print cword)
>       (set! correct 1)
> ))
> ;;; // correct u into  in ul-
> (if (and (string-matches dword "[u][l][a-z]*")
> 	 (not (member dword '("ulo" "ulper" "ultym" "ultime" "ultimatum" "ultimatums")))
> 	 (not (string-matches dword "[u][l][t][r][a][a-z]*")))
>     (begin
>       (set! curword (symbolexplode dword))
>       (set! seg (car curword))
>       (set! seg ') 
>       (set! cword nil)
>       (while (not (string-equal seg nil))
>        (if (string-equal cword nil)
> 	   (set! cword seg)
> 	   (set! cword (string-append cword seg)))
> 	     (set! curword (cdr curword))
> 	     (set! seg (car curword)))
> ;      (print cword)
>       (set! correct 1)
> ))
> ;;; // correct u into  in un-
> (if (and (string-matches dword "[u][n][a-z]*")
> 	 (not (member dword '("unanym" "uny" "unyk" "unyt")))
> 	 (not (string-matches dword "[u][n][i][f-z][a-z]*")))
>     (begin
>       (set! curword (symbolexplode dword))
>       (set! seg (car curword))
>       (set! seg ') 
>       (set! cword nil)
>       (while (not (string-equal seg nil))
>        (if (string-equal cword nil)
> 	   (set! cword seg)
> 	   (set! cword (string-append cword seg)))
> 	     (set! curword (cdr curword))
> 	     (set! seg (car curword)))
> ;      (print cword)
>       (set! correct 1)
> ))
> ;;; // correct u into  in us-
> (if (string-matches dword "[u][s][a-z]*")
>     (begin
>       (set! curword (symbolexplode dword))
>       (set! seg (car curword))
>       (set! seg ') 
>       (set! cword nil)
>       (while (not (string-equal seg nil))
>        (if (string-equal cword nil)
> 	   (set! cword seg)
> 	   (set! cword (string-append cword seg)))
> 	     (set! curword (cdr curword))
> 	     (set! seg (car curword)))
> ;      (print cword)
>       (set! correct 1)
> ))
> ;;; // correct u into  in ut-
> (if (and (string-matches dword "[u][t][a-z]*")
> 	 (not (string-matches dword "[u][t][e][a-z]*"))
> 	 (not (string-matches dword "[u][t][i][a-z]*"))
> 	 (not (string-matches dword "[u][t][o][a-z]*")))
>     (begin
>       (set! curword (symbolexplode dword))
>       (set! seg (car curword))
>       (set! seg ') 
>       (set! cword nil)
>       (while (not (string-equal seg nil))
>        (if (string-equal cword nil)
> 	   (set! cword seg)
> 	   (set! cword (string-append cword seg)))
> 	     (set! curword (cdr curword))
> 	     (set! seg (car curword)))
> ;      (print cword)
>       (set! correct 1)
> ))
> 
> )
> 
> (define (net_fy_downcase word)
> (set! curword (symbolexplode (item.name word)))
> (set! dword nil)
> (set! seg (car curword))
> (while (not (string-equal seg nil))
>        (cond
> 	((string-equal seg "A") (set! seg 'a))
> 	((string-equal seg "B") (set! seg 'b))
> 	((string-equal seg "C") (set! seg 'c))
> 	((string-equal seg "D") (set! seg 'd))
> 	((string-equal seg "E") (set! seg 'e))
> 	((string-equal seg "F") (set! seg 'f))
> 	((string-equal seg "G") (set! seg 'g))
> 	((string-equal seg "H") (set! seg 'h))
> 	((string-equal seg "I") (set! seg 'i))
> 	((string-equal seg "J") (set! seg 'j))
> 	((string-equal seg "K") (set! seg 'k))
> 	((string-equal seg "L") (set! seg 'l))
> 	((string-equal seg "M") (set! seg 'm))
> 	((string-equal seg "N") (set! seg 'n))
> 	((string-equal seg "O") (set! seg 'o))
> 	((string-equal seg "P") (set! seg 'p))
> 	((string-equal seg "Q") (set! seg 'q))
> 	((string-equal seg "R") (set! seg 'r))
> 	((string-equal seg "S") (set! seg 's))
> 	((string-equal seg "T") (set! seg 't))
> 	((string-equal seg "U") (set! seg 'u))
> 	((string-equal seg "V") (set! seg 'v))
> 	((string-equal seg "W") (set! seg 'w))
> 	((string-equal seg "X") (set! seg 'x))
> 	((string-equal seg "Y") (set! seg 'y))
> 	((string-equal seg "Z") (set! seg 'z))
> 	)
>        (if (string-equal dword nil)
> 	   (set! dword seg)
> 	   (set! dword (string-append dword seg)))
>        (set! curword (cdr curword))
>        (set! seg (car curword))
> );endwhile
> );enddefine
> ;;; // 2004/02/03: when there is an group of three accents in a row, the 
> ;;; // middle accent is removed.
> (define (net_fy_accentgroup word)
> (if (item.prev (item.prev word))
>     (begin
>       (set! pword (item.prev word))
>       (set! ppword (item.prev pword))
>       
> (if (and (string-equal (item.feat ppword "acc") "+")
> 	 (string-equal (item.feat pword "acc") "+")
> 	 (string-equal (item.feat word "acc") "+"))
>     (item.set_feat pword 'acc '-))
> )))
> 
> ;;; // -----
> ;;; // fy::remove_accents is called in fy::basic_accent_placement  
> ;;; // because you can change the accent in Nintens
48c292
< (define (nl::remove_accents utt)
---
> (define (fy::remove_accents utt)
50c294
< \(nl::remove_accents UTT\)
---
> \(fy::remove_accents UTT\)
57a302,303
> ;;; // -----
> ;;; // JDNL dit gegeven om misschien later functie te schrijven
59c305
< ;;;-----------------------------------------------------------------------------
---
> ;;;---------------------------------------------------------------------------
61c307,309
< ;;;-----------------------------------------------------------------------------
---
> ;;;---------------------------------------------------------------------------
> 
> ;;; // called in net_fy_lex.scm under fy::associate_int_to_syls
83,84c331,332
< 
< 
---
> ;;; // -----
> ;;; // double (zie fy::remove_accents), can be removed
95c343,344
< (provide 'net_nl_accent)
---
> (provide 'net_fy_accent)
> 


<---------------------  End of report  --------------------->

