(FILECREATED "10-Aug-84 22:04:25" {ERIS}<SPEECH>LEXICON>PARSE-LEX.;12 4878
changes to: (VARS PARSE-LEXCOMS)
previous date: "10-Aug-84 19:39:21" {ERIS}<SPEECH>LEXICON>PARSE-LEX.;11)
(* Copyright (c) 1984 by XEROX. All rights reserved.)
(PRETTYCOMPRINT PARSE-LEXCOMS)
(RPAQQ PARSE-LEXCOMS [(FNS PARSE-LEX-ARRAY PARSE-WORD-RECORD LISTIFY.SYLLABIFICATION
REORDER-STRESS-INFO STRESS.TO.END)
(P (PROGN (LOAD (QUOTE {ERIS}<LISPUSERS>LOADFILES.DCOM))
(LOADFILES (QUOTE ({ERIS}<SPEECH>LEXICON>))
(QUOTE (PARSE-TEST NLOAD DFOOT))
(QUOTE (DCOM NIL])
(DEFINEQ
(PARSE-LEX-ARRAY
[LAMBDA (ARRAY) (* edited: " 7-Aug-84 21:47")
(* "Gumby" " 2-Aug-84 18:43")
(* CATEGORY is a filter on what words to parse)
(* This is the top level-function of the foot and syllable-parsing system. We first CATEGORIZE the word
(based on the presence of a string ".../CAT" at the end of the word); next, do a syllable parse
(NEW-SYLLABLE-PARSER); finally do a foot-parse (PARSE-TEST); the global variable DEBUG controls the printout of
information about the parse)
(for I WREC [BITTBL ← (MAKEBITTABLE (QUOTE (- < *]
TEMP from 1 to (ARRAYSIZE ARRAY)
do (SETQ TEMP (ELT ARRAY I))
(SETQ WREC (create WORD
INPUT ← (fetch (LEXENTRY ORTH) of TEMP)))
(replace (WORD STRUCTURE) of WREC with (LISTIFY.SYLLABIFICATION (fetch (LEXENTRY PRON)
of TEMP)
BITTBL))
(PARSE-WORD-RECORD WREC)
(printout FOOTOUTPUTFILE (fetch INPUT of WREC)
.TAB 22 (PACKWORD (fetch STRUCTURE of WREC))
T])
(PARSE-WORD-RECORD
[LAMBDA (WREC) (* pkh: "10-Aug-84 19:03")
(PROGN (* Takes word with syllables indicated by -, explodes
the strings and puts them in reverse order under the
property SYLLABLES)
(REORDER-STRESS-INFO WREC)
(replace STRUCTURE of WREC with (REVERSE (fetch STRUCTURE of WREC)))
(* Get the syllables in the correct order
(left-to-right))
(COND
((AND (NEQ (QUOTE NOBIND)
(EVALV (QUOTE DEBUG)))
DEBUG)
(printout NIL T WREC T)))
(FOOT-PARSER WREC])
(LISTIFY.SYLLABIFICATION
[LAMBDA (PRON BITTBL) (* pkh: " 7-Aug-84 15:02")
(* "Gumby" " 2-Aug-84 18:50")
(* Turns a string with syllable boundary indicators into a list of lists (one list for each syllable) with the
syllable separator as the last element of the list)
(PROG ((OLD-SEPR 0))
(RETURN (for (NEW-SEPR ← (STRPOSL BITTBL PRON 1))
SYLLLIST while NEW-SEPR by (STRPOSL BITTBL PRON (ADD1 NEW-SEPR))
do (push SYLLLIST (UNPACK (SUBSTRING PRON (ADD1 OLD-SEPR)
NEW-SEPR)))
(SETQ OLD-SEPR NEW-SEPR)
finally (RETURN (push SYLLLIST (UNPACK (SUBSTRING PRON (ADD1 OLD-SEPR])
(REORDER-STRESS-INFO
[LAMBDA (WREC) (* pkh: " 3-Aug-84 21:10" posted: "29-Mar-82 16:46")
(* Top-level function for stress-assignment. Takes a word (with the morphological information stripped off) and
assigns stress to the syllables of the word according to the stress-rules. Outputs the word on the terminal and
stores the stress-indication (PRINT-STRESSED-WORD))
(for SYLL in (fetch (WORD STRUCTURE) of WREC) do (STRESS.TO.END SYLL) finally (RETURN WREC])
(STRESS.TO.END
[LAMBDA (SYLLABLE.AS.LIST) (* pkh: " 7-Aug-84 16:57")
(* Takes a syllable, in the form of a list; if there is a stress indication, i.e. a number, then put it at the end
of the list)
[COND
((SETQ STRESS (for SOUND in SYLLABLE.AS.LIST thereis (NUMBERP SOUND)))
(DREMOVE STRESS SYLLABLE.AS.LIST)
(COND
[(IGREATERP (LENGTH (LAST.BUT.NOT.SEPR SYLLABLE.AS.LIST))
1)
(RPLACD (NTH SYLLABLE.AS.LIST (SUB1 (LENGTH SYLLABLE.AS.LIST)))
(CONS STRESS (LAST SYLLABLE.AS.LIST]
(T (NCONC SYLLABLE.AS.LIST (LIST STRESS]
SYLLABLE.AS.LIST])
)
[PROGN (LOAD (QUOTE {ERIS}<LISPUSERS>LOADFILES.DCOM))
(LOADFILES (QUOTE ({ERIS}<SPEECH>LEXICON>))
(QUOTE (PARSE-TEST NLOAD DFOOT))
(QUOTE (DCOM NIL]
(PUTPROPS PARSE-LEX COPYRIGHT ("XEROX" 1984))
(DECLARE: DONTCOPY
(FILEMAP (NIL (606 4646 (PARSE-LEX-ARRAY 616 . 1872) (PARSE-WORD-RECORD 1874 . 2625) (
LISTIFY.SYLLABIFICATION 2627 . 3410) (REORDER-STRESS-INFO 3412 . 3988) (STRESS.TO.END 3990 . 4644))))
)
STOP