home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Multimed / Multimed.zip / fest-141.zip / festival / lib / engmorph.scm < prev    next >
Text File  |  1999-05-30  |  6KB  |  150 lines

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;;                                                                       ;;
  3. ;;;                Centre for Speech Technology Research                  ;;
  4. ;;;                     University of Edinburgh, UK                       ;;
  5. ;;;                         Copyright (c) 1997                            ;;
  6. ;;;                        All Rights Reserved.                           ;;
  7. ;;;                                                                       ;;
  8. ;;;  Permission is hereby granted, free of charge, to use and distribute  ;;
  9. ;;;  this software and its documentation without restriction, including   ;;
  10. ;;;  without limitation the rights to use, copy, modify, merge, publish,  ;;
  11. ;;;  distribute, sublicense, and/or sell copies of this work, and to      ;;
  12. ;;;  permit persons to whom this work is furnished to do so, subject to   ;;
  13. ;;;  the following conditions:                                            ;;
  14. ;;;   1. The code must retain the above copyright notice, this list of    ;;
  15. ;;;      conditions and the following disclaimer.                         ;;
  16. ;;;   2. Any modifications must be clearly marked as such.                ;;
  17. ;;;   3. Original authors' names are not deleted.                         ;;
  18. ;;;   4. The authors' names are not used to endorse or promote products   ;;
  19. ;;;      derived from this software without specific prior written        ;;
  20. ;;;      permission.                                                      ;;
  21. ;;;                                                                       ;;
  22. ;;;  THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK        ;;
  23. ;;;  DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING      ;;
  24. ;;;  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT   ;;
  25. ;;;  SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE     ;;
  26. ;;;  FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES    ;;
  27. ;;;  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN   ;;
  28. ;;;  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,          ;;
  29. ;;;  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF       ;;
  30. ;;;  THIS SOFTWARE.                                                       ;;
  31. ;;;                                                                       ;;
  32. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  33. ;;;                         Author: Alan W Black
  34. ;;;                         Date:   December 1997
  35. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  36. ;;;  
  37. ;;;  Koskenniemi-style context rewrite rules for English Morphographemics
  38. ;;;  Basically splits words into their (potential) morphemes.
  39. ;;;
  40. ;;;  Based (roughly) on the rules in "Computational Morphology"
  41. ;;;  Ritchie et al. MIT Press 1992.
  42. ;;;
  43. ;;;  This is not a Scheme file and can't be loaded and evaluated
  44. ;;;  It is designed for use with the wfst tools in the speech tools
  45. ;;;  e.g. wfst_build -type kk -o engmorph.wfst -detmin engmorph.scm
  46. ;;;
  47.  
  48. (KKrules
  49.  engmorph
  50.  (Alphabets
  51.   ;; Input Alphabet
  52.   (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 #) 
  53.   ;; Output Alphabet
  54.   (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 + #) 
  55.  )
  56.  (Sets
  57.   (LET 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)
  58.  )
  59.  (Rules
  60.  ;; The basic rules
  61.  ( a => nil --- nil) 
  62.  ( b => nil --- nil) 
  63.  ( c => nil --- nil) 
  64.  ( d => nil --- nil) 
  65.  ( e => nil --- nil) 
  66.  ( f => nil --- nil) 
  67.  ( g => nil --- nil) 
  68.  ( h => nil --- nil) 
  69.  ( i => nil --- nil) 
  70.  ( j => nil --- nil) 
  71.  ( k => nil --- nil) 
  72.  ( l => nil --- nil) 
  73.  ( m => nil --- nil) 
  74.  ( n => nil --- nil) 
  75.  ( o => nil --- nil) 
  76.  ( p => nil --- nil) 
  77.  ( q => nil --- nil) 
  78.  ( r => nil --- nil) 
  79.  ( s => nil --- nil) 
  80.  ( t => nil --- nil) 
  81.  ( u => nil --- nil) 
  82.  ( v => nil --- nil) 
  83.  ( w => nil --- nil) 
  84.  ( x => nil --- nil) 
  85.  ( y => nil --- nil) 
  86.  ( z => nil --- nil) 
  87.  ( # => nil --- nil)
  88. ; ( _epsilon_/+ => (or LET _epsilon_/e ) --- (LET))
  89.  ( _epsilon_/+ => (or LET _epsilon_/e) --- nil)
  90.  
  91.  ;; The rules that do interesting things
  92.  
  93.  ;; Epenthesis
  94.  ;;   churches -> church+s
  95.  ;;   boxes -> box+s
  96.  (e/+ <=> (or (s h) (or s x z) (i/y) (c h))
  97.         ---
  98.         (s))
  99.  ;; Gemination
  100.  (b/+ <=> ( (or b c d f g h j k l m n p q r s t v w z) (or a e i o u y) b )
  101.        ---
  102.        ((or a e i o u)))
  103.  (d/+ <=> ((or b c d f g h j k l m n p q r s t v w z) (or a e i o u y) d )
  104.           ---
  105.       ((or a e i o u)))
  106.  (f/+ <=> ((or b c d f g h j k l m n p q r s t v w z) (or a e i o u y) f )
  107.           ---
  108.       ((or a e i o u)))
  109.  (g/+ <=> ((or b c d f g h j k l m n p q r s t v w z) (or a e i o u y) g )
  110.           ---
  111.       ((or a e i o u)))
  112.  (m/+ <=> ((or b c d f g h j k l m n p q r s t v w z) (or a e i o u y) m )
  113.           ---
  114.       ((or a e i o u)))
  115.  (p/+ <=> ((or b c d f g h j k l m n p q r s t v w z) (or a e i o u y) p )
  116.           ---
  117.       ((or a e i o u)))
  118.  (s/+ <=> ((or b c d f g h j k l m n p q r s t v w z) (or a e i o u y) s )
  119.           ---
  120.       ((or a e i o u)))
  121.  (t/+ <=> ((or b c d f g h j k l m n p q r s t v w z) (or a e i o u y) t )
  122.           ---
  123.       ((or a e i o u)))
  124.  (z/+ <=> ((or b c d f g h j k l m n p q r s t v w z) (or a e i o u y) z )
  125.           ---
  126.       ((or a e i o u)))
  127.  (n/+ <=> ((or b c d f g h j k l m n p q r s t v w z) (or a e i o u y) n )
  128.           ---
  129.       ((or a e i o u)))
  130.  (l/+ <=> ((or b c d f g h j k l m n p q r s t v w z) (or a e i o u y) l )
  131.           ---
  132.       ((or a e i o u)))
  133.  (r/+ <=> ((or b c d f g h j k l m n p q r s t v w z) (or a e i o u y) r )
  134.           ---
  135.       ((or a e i o u)))
  136.  ;; tries->try+s
  137.  ( i/y <=>  ((or b c d f g h j k l m n p q r s t v w x z))
  138.             ---
  139.         ((or ( e/+ s )
  140.          ( _epsilon_/+ (or a d e f h i l m n o p s w y)))))
  141.  ;; Elision
  142.  ;;   moved -> move+ed
  143.  (_epsilon_/e <=> 
  144.           ((or a e i o u ) (or b c d f g j k l m n p q r s t v x z))
  145.           ---
  146.           ( _epsilon_/+ (or a e i o u )))
  147.  
  148.  )
  149. )
  150.