!; ENGLISH.RUL  2-May-90
!; Tables generated by KGEN 2-May-91
!
!; Rules file for the English description.
!; To load this file, enter the command LOAD RULES ENGLISH.
!
!; This version of the English rules differs slightly from the version
!; supplied on the original PC-KIMMO release diskette.

; This description of English is based on the article "A two-level
; morphological analysis of English," by Lauri Karttunen and
; K. Wittenburg, Texas Linguistic Forum 22:217-228 (1983).
; See appendix A for an exposition of the rules in this file.

!
!; ' = apostrophe
!; - = hyphen
!; ` = stress
!; + = morpheme break
!
;ALPHABET
;  a b c d e f g h i j k l m n o p q r s t u v w x y z ' - ` +
;NULL 0
;ANY  @
;BOUNDARY #
SUBSET C    b c d f g h j k l m n p q r s t v w x y z    ; consonants
SUBSET Csib s x z       ; sibilants
SUBSET Cpal c g         ; soft palatals
SUBSET V    a e i o u   ; vowels
SUBSET Vbk  a o u       ; back vowels

; Consonant defaults
PAIRS  b c d f g h j k l m n p q r s t v w x y z
       b c d f g h j k l m n p q r s t v w x y z

; Vowels and other defaults
; ` and + default to 0
; - defaults to either - or 0
PAIRS  a e i o u ' - - ` +
       a e i o u ' - 0 0 0

; Special correspondences
PAIRS  y 0 s e i 0 0 0 0 0 0 0 0 0 0 0
       i e 0 0 y b d f g l m n p r s t

!; Epenthesis
; LR: fox+0s  kiss+0s  church+0s  spy+0s  hero+0s
; SR: fox0es  kiss0es  church0es  spi0es  hero0es

RULE 0:e <= [Csib|ch|sh|y:i] +:0_s [+:0|#]
RULE 0:e => [Csib|ch|sh|y:i|o] +:0_s [+:0|#]

!; y:i-spelling
; LR: spy+s  happy+ly  spot0+y+ness
; SR: spies  happi0ly  spott0i0ness

; original y:i rules:
;RULE "5 y:i-spelling, y:i <= :C__+:0 ~[i|']"  4 7
;RULE "6 y:i-spelling, y:i => :C__+:0 ~[i|']"  4 6
; Since the current version of KGEN can't handle the neg operator ~,
; I have simplified the y:i rules.
; These rules generate spys, happyly, spottyness but are OK for recognition.

RULE y:i => @:C (+:0)_+:0
RULE y:i /<= @:C (+:0)_+:0 [i|']


!; s-deletion
; LR: cat+s+'s  fox+s+'s  dallas+'s
; SR: cat0s0'0  foxes0'0  dallas0'0

RULE s:0 <= +:0 (0:e) s +:0 '_
RULE s:0 => s +:0 '_


!; Elision
; LR: `move+ed `move+ing `move+able `be+ing
; SR: 0mov0+ed 0mov00ing 0mov00able 0be0ing

; LR: `trace+ed `trace+ing `trace+able
; SR: 0trac00ed 0trac00ing 0trace0able

; added Cpal and Vbk columns by hand
!; except in Cpal___+:0 Vbk
!RULE "e:0 <= V C C*___+:0 V" 8 8
!   C Cpal e e + V Vbk @
!   C Cpal 0 @ 0 V Vbk @
!1: 1 1    1 2 1 2 2   1
!2: 3 6    1 2 1 2 2   1
!3: 3 6    1 4 1 2 2   1
!4: 1 1    1 2 5 2 2   1
!5: 1 1    1 0 1 0 0   1
!6: 1 1    1 7 1 2 2   1
!7: 1 1    1 2 8 2 2   1
!8: 1 1    1 0 1 0 1   1

!
!; Elision prohibited after Cpal and before back vowel
RULE e:0 /<= V C* Cpal___+:0 Vbk

; LR: a`gree+ed a`gree+ing a`gree+able `hoe+ed `hoe+ing `dye+ed `dye+ing
; SR: a0gre00ed a0gree0ing a0gree0able 0ho00ed 0hoe0ing 0dy00ed 0dye0ing
;
; BUT compare these:
; LR: `argue+ing `argue+able
; SR: 0argu00ing 0argu00able

!; Elision after CV or Cy
; added `:0 column by hand
!RULE "e:0 <= C [V|y]___+:0 e" 7 9
!      e  e  C  V  +  e  y  `  @
!      0  @  C  V  0  e  y  0  @
! 1:   1  1  2  1  1  1  2  1  1
! 2:   1  3  2  3  1  3  6  2  1
! 3:   1  4  2  1  1  4  2  3  1
! 4:   1  1  2  1  5  1  2  4  1
! 5:   1  0  2  1  1  0  2  5  1
! 6:   1  7  2  3  1  7  6  6  1
! 7:   1  4  2  1  5  4  2  7  1

!
!; Elision after Cu
RULE e:0 <= C u___+:0 V

;RULE e:0 => V C C*___+:0 V | C[V|y]___+:0 e | C u___+:0 V | i:y___+:0 i
; added `:0 column by hand
!; clean-up rule for three <= Elision rules above plus i:y-spelling below
!RULE "e:0 => VCC*___+:0 V | C[V|y]___+:0 e | Cu___+:0 V | i:y___+:0 i" 14 11
!      e  V  C  +  e  y  u  i  i  `  @
!      0  V  C  0  e  y  u  y  i  0  @
! 1:   0  2  6  1  2  6  2 12  2  1  1
! 2:   0  2  3  1  2  3  2 12  2  2  1
! 3:   4  7  3  1  7  3 11 12  7  3  1
! 4.   0  0  0  5  0  0  0  0  0  4  0
! 5.   0  2  0  0  2  0  2  0  2  5  0
! 6:   0  7  6  1  7 10 11 12  7  6  1
! 7:   8  2  3  1  2  3  2 12  2  7  1
! 8.   0  0  0  9  0  0  0  0  0  8  0
! 9.   0  0  0  0  2  0  0  0  0  9  0
!10:   8  7  6  1  7 10 11 12  7  10 1
!11:   4  2  3  1  2  3  2 12  2  11 1
!12:  13  2  6  1  2  6  2 12  2  12 1
!13.   0  0  0 14  0  0  0  0  0  13 0
!14.   0  0  0  0  0  0  0  0  2  14 0

!
!; i:y-spelling
; LR: tie+ed  tie+ing
; SR: ti00ed  ty00ing

!; e:@ instead of e:0 to force Elision to apply
RULE i:y <= ___e:@ +:0 i
RULE i:y => ___e:0 +:0 i


!; Gemination
; LR: re`fer0+ed `travel+ed `sleep+ing `slip0+ing `spot0+y
; SR: re0ferr0ed 0travel0ed 0sleep0ing 0slipp0ing 0spott0y

; this rule fails with compounds such as babysitting

RULE 0:{b,d,f,g,l,m,n,p,r,s,t} <= `:0 C* V {b,d,f,g,l,m,n,p,r,s,t}_+:0[V|y:@]
RULE 0:{b,d,f,g,l,m,n,p,r,s,t} => C* V {b,d,f,g,l,m,n,p,r,s,t}_+:0[V|y:@]

END
