:INPUT

! phonemes 
         'S'         
         'a'   'a:'  'q'   'A'   'A:'  '~a'  '~a:' '~A'  '~A:' 'V'   '6'   '^6'
         'a_i' 'a_I' 'a_u' 'a_U' 'b'  'b_b' 'B'  'C'  'd'  'd_d' 'd_d_Z' 'd_d_z'
         'd_Z' 'd_z' 'D'   'D_+' '3'   '3:'  'e'   'e:'  'E'   'E:'  '~E'  '~E:'
         'e_I' 'e_@' '@'   '@_U' 'c'   'f'   'f_f' 'F'   'g'   'G'   'g_g' 'h'
         'i'   'i:'  'I'   '^i'  'i_@' 'I_@' 'j'   'j_j' 'J'   'J_J' 'k'
         'k_k' 'k_h' 'l'   '=l'  'L'   'L_L' 'l_l' 'm'   '=m'  'm_m' 'n'   'n_n' 
         '=n'  'N'   'o'   'o:'  'O'   'O:'  '^o'  '~o'  '~o:'  '~O'  '~O:'  
         'o_U' 'O_I' 'O_y' 'Q'  '2'   '2:'  '9'   '9:'  '~9'  '~9:' 
         'p'   'p_p' 'p_f' 'p_h' 'r'   'R'   'r_r'
         's'   'S_S' 's_s' 't'   't_t' 't_t_S'     't_t_s'     'T'
         't_h' 't_s' 't_S' 'u'   'u:'  'U'   '^u'  'U_@' 'v'   'v_v' 'w'
         'x'   'y'   'y:'  'Y'   '^y'  'y_@' 'H'   'z'   'Z'   '?'
         'a_I_@'  'O_I_@'  'a_U_@'  '@_U_@'
         
         ! italian diphthongs:
         
         '^i_a'  '^i_e'  '^i_o'  '^i_u' 
                 '^i_E'  '^i_O'  
         '^i_a:' '^i_E:' '^i_O:' '^i_u:'
         
         '^u_a'  '^u_e'  '^u_o'  '^u_i'
                 '^u_E'  '^u_O'
         '^u_a:' '^u_E:' '^u_O:' '^u_i:'

! optional phonemes
         '(@)'  '(h)'  '(k)'  '(r)'  '(t)'  '(p)'   '(U)'

! preplosive pauses 
         ! '>'  
         ! problems with  phrase tag end delimiter
         !'>b'  '>d'  '>g'  '>k'  '>p'  '>t'  '>t_S'  
 
! graphemes
         ! "trigger" and special symbols
         '+' '-' '#' '|' '/' '(/)' "'" ',' ' ' '$'   ;
*

%Cons_G   = 'b'   'C'   'd'   'd_Z' 'f'   'g'   'g_g' 'h'   'j'   'k'   'k_h'
            'l'   'm'   'n'   'N'   'p'   'p_f' 'p_h' 'r'   'r_r' 's'   'S'
	          't'   't_S' 't_s' 't_h' 'v'   'w'   'x'   'z'   'Z'   '?';

%Vow_G    = 'a'   'a:'  '6'   '^6'  'a_i' 'a_u' 'e'   'e:'  'E'   'E:'  'e_I'
            '@'   'i'   'i:'  'I'   '^i'  'i_@' '=l'  '=m'  '=n'  'o'   'o:'
	          'O'   'O_y' '^o'  '2'   '2:'  '9'   'u'   'u:'  'U'   '^u'  'U_@'
	          'y'   'y:'  'Y'   '^y'  'y_@';


&Cons      = %Cons_G ; 

&Vow       = %Vow_G ; 

%Phonems = 'a'   'a:'  'q'   'A'   'A:'  '~a'  'V'   '6'   '^6'  'a_i' 'a_I'
         'a_u' 'a_U' 'b'   'b_b' 'B'   'C'   'd'   'D'   'd_d' 'd_d_Z'
         'd_d_z'     'd_Z' 'd_z' '3'   '3:'  'e'   'e:'  'E'   'E:'  '~E'
         'e_I' 'e_@' '@'   '@_U' 'c'   'f'   'f_f' 'F'   'g'   'G'   'g_g' 'h'
         'i'   'i:'  'I'   '^i'  'i_@' 'I_@' 'j'   'J'   'J_J' 'k'   'k_k' 
         'k_h' 'l'   '=l'  'L'   'L_L' 'l_l' 'm'   '=m'  'm_m' 'n'   'n_n' 
         '=n'  'N'   'o'   'o:'  'O'   'O:'  '^o'  '~o'  'O_I' 'O_y' 'Q'
         '2'   '2:'  '9'   '~9'  'p'   'p_p' 'p_f' 'p_h' 'r'   'R'   'r_r'
         's'   'S_S' 's_s' 't'   't_t' 't_t_S'     't_t_s'     'T'
         't_h' 't_s' 't_S' 'u'   'u:'  'U'   '^u'  'U_@' 'v'   'v_v' 'w'
         'x'   'y'   'y:'  'Y'   '^y'  'y_@' 'H'   'z'   'Z'   '?'  ;


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
!          German Morpho-phonological Rules 
!
!          Editors:   HR    
!                     SH    adapted for lecture 
!                         
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


[consonant pairs for Auslautverhaertung]
&AVCons_G = 'b' | 'C' | 'd' | 'f' | 'g' | 'h' | 'j' | 'k' | 'l' | 'm' | 'n' 
          | 'N' | 'p' | 'p_f' | 'r' | 's' | 'S' | 't' | 't_s' | 't_S' | 'v' 
          | 'x' | 'z' | 'Z' | 'd_Z' | '?'
          | 'b'/'p' | 'd'/'t' | 'g'/'k' | 'v'/'f' | 'z'/'s' ;

[all ignored pairs when finding vowel or consonant to the right]
&IgnSurf_G = '+' | '$' | 's'/@ | 't'/@ | '@'/@ 
           | "'" | ',' | '-';


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! German morphophonemic rules
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

'$' / @ <=> _ ;

>>

! "Auslautverhaertung" completely new by CT, 05-03-91 
! New rule: devoicing occurs before '+/@ if next surface phoneme is a 
! consonant (including glottal stop) or '#, and always before '# or '$ #
!
[Identical right context for all rules]

&RCons_G = ('+' {&IgnSurf_G} (&AVCons_G |'#'));

'b'/'p' <=> _ &RCons_G;

'd'/'t' <=> _ &RCons_G,
            [special changes corresponding to t-deletion (e.g. zandÎ+t@#)]
             _ '+' 't'/@ '@' <'n' | <'s'> 't'> '#';    

'g'/'k' <=> _ &RCons_G;

'v'/'f' <=> _ &RCons_G;

'z'/'s' <=> _ &RCons_G;

'Z'/'S' <=> _ &RCons_G;   ! HR: added 03-06-19

'd_z'/'t_s' <=> _ &RCons_G;   ! HR: added 03-06-19

'd_Z'/'t_S' <=> _ &RCons_G;   ! HR: added 03-06-19


>>

'+'/@ <=> _ ;

>>

[syllabification]


[consonants except glottal stop and 'h', incl. non-syllabic vowels]
%CoNHG =
  '^6' 'b'  'C' 'd' 'f'  'g' '^i' 'j'  'k'  'l' 'm' 'n' 'N'
  '^o' 'p' 'p_f' 'r' 's' 'S' 't' 't_s' 't_S' '^u' 
  'v' 'x' '^y' 'z' 'Z' 'd_Z';

[syllabic nuclei]
%Nuc   = 'a'   'a:'  '6'   'a_i' 'a_u' 'e'   'e:'  'E'   'E:'  'e_I'
         '@'   'i'   'i:'  'I'   'i_@' '=l'  '=m'  '=n'  'o'   'o:'
         'O'   'O_y' '2'   '2:'  '9'   'u'   'u:'  'U'   'U_@' 'y'
         'y:'  'Y'   'y_@';


[accent symbols]
%Acc   = "'" ',';

! There must at most be one accent mark
! between two nuclei in order for the rules to work. It is assumed
! here that if an accent mark is set before a consonant, this
! also indicates the syllable boundary position. If the accent
! mark occurs directly before the nucleus, the accent mark is
! not taken as syllable boundary position indicator.

! Nuclei with no syll bounds in between require the insertion of
! exactly one syllable boundary: 
! - a boundary is placed before a 'h' or a '?'
! - a boundary is placed depending on the nr of consonants between nuc


&AccNuc = <%Acc> %Nuc;  [nucleus optionally preceded by accent]


@/'-' <=>

  ! syllable boundary when 'h' or '?' present: either before accent
  ! or before first 'h' or '?', whatever comes first

  %Nuc {%CoNHG} _ ('h' | '?') {%CoNHG | %Acc | 'h' | '?'} %Nuc,
  %Nuc {%CoNHG} _ %Acc {%CoNHG} ('h' | '?') {%CoNHG} %Nuc,

  ! syllable boundary for different nr of consonants if no accents present
  ! or only an accent before nucleus

  %Nuc                      _ <%CoNHG> &AccNuc,       [0 or 1 cons]
  %Nuc %CoNHG               _ %CoNHG <%CoNHG> &AccNuc, [2 or 3 cons]
  %Nuc %CoNHG %CoNHG        _ %CoNHG %CoNHG <%CoNHG> &AccNuc, [4 or 5 cons]

  ! syllable boundary placed before accent mark if at least one consonant
  ! follows the accent mark

  %Nuc {%CoNHG} _ %Acc %CoNHG {%CoNHG} %Nuc;


>>

[removal of spurious syllable boundaries]

&Phone_G = %Cons_G | %Vow_G;


[syll sep remains if directly right of a phone and a phone follows
 after some optional deleted separators; in all other cases,
 separators are deleted; accent marks are ignored]

'-'/@ => _ ;  [just to introduce pair '-'/@ as a default]

'-' <=>   &Phone_G {%Acc} _ {'-'/@ | %Acc} &Phone_G;
                       

>>

[word accentuation]

[accent is reduced if at least one non-reduced accent to the left]

"'"/"," <=>  "'" {%Phonems | '-'} _ ;

>>

'#'/@ <=> _ ;

