(FILECREATED " 7-SEP-84 08:49:01" {ATSUGI}<JLISP>MIRAI0>CONVERTER.;11 9020 changes to: (FNS INFKANACONVERTER) previous date: "30-AUG-84 15:34:54" {ATSUGI}<JLISP>MIRAI0>CONVERTER.;10) (* Copyright (c) 1984 by Fuji Xerox Co. Ltd.) (PRETTYCOMPRINT CONVERTERCOMS) (RPAQQ CONVERTERCOMS ((FNS Complete#List CreateInfDict CreateGrammTable ExpandPOSMacro INFDICTCONVERTER INFDICTCONVERTER1 INFKANACONVERTER EVENTHLIST INFKANJICONVERTER JISPAIRLIST INFPOSCONVERTER MAKEUNUSEDPOS#LIST INFPRECONVERTER MAKEUNUSEDPRE#LIST INFFREQCONVERTER MAKESUFFIXTREE MAKESUFFIXTREE1 MAKESUFFIXTREE2 PutGrammTable1) (GLOBALVARS POS#LIST POSLIST PRE#LIST PRELIST FUZOKUGOLIST DICTENTRIES CONNECTIONS GRAMMTABLE))) (DEFINEQ (Complete#List [LAMBDA (LST) (* ryu "10-JUL-84 04:29") (for ELEM in LST bind (UNUSED#LIST ←(for I from 0 to 255 collect I)) collect (COND [(ATOM ELEM) (LIST ELEM (PROG1 (CAR UNUSED#LIST) (SETQ UNUSED#LIST (REMOVE (CAR UNUSED#LIST) UNUSED#LIST] [(NULL (CDR ELEM)) (LIST (CAR ELEM) (PROG1 (CAR UNUSED#LIST) (SETQ UNUSED#LIST (REMOVE (CAR UNUSED#LIST) UNUSED#LIST] ((AND (LISTP ELEM) (NUMBERP (CADR ELEM))) (SETQ UNUSED#LIST (REMOVE (CADR ELEM) UNUSED#LIST)) ELEM) (T (SHOULDNT]) (CreateInfDict [LAMBDA NIL (* J.Ikeo "29-AUG-84 14:35") (MAKEUNUSEDPOS#LIST) (MAKEUNUSEDPRE#LIST) (SETQ SUFFIXTREE (LIST NIL NIL)) (MAKESUFFIXTREE (INFDICTCONVERTER DICTENTRIES]) (CreateGrammTable [LAMBDA NIL (* ryu "12-AUG-84 12:53") (DECLARE (GROBALVARS CONNECTIONS PRELIST POSLIST PRE#LIST POS#LIST GRAMMTABLE)) (SETQ GRAMMTABLE (BITMAPCREATE 256 256 4)) (* for I from 0 to 255 do (for J from 0 to 255 do (BITMAPBIT GRAMMTABLE I J 0))) (* This bitmap is used to simulate a two-dimensional array) (SETQ PRE#LIST (Complete#List PRELIST)) (SETQ POS#LIST (Complete#List POSLIST)) (for TRIPLE in CONNECTIONS bind POSs PRE FREQ do (* CONNECTIONS ia a list each element of which is (PRE FREQ POS/PRE ...)) (SETQ FREQ (CADR TRIPLE)) [COND [(NUMBERP FREQ) (SETQ POSs (ExpandPOSMacro (CDDR TRIPLE] (T (SETQ FREQ 1) (SETQ POSs (ExpandPOSMacro (CDR TRIPLE] (COND ((SETQ PRE (FASSOC (CAR TRIPLE) PRE#LIST)) (PutGrammTable1 (CADR PRE) POSs FREQ)) (T (printout T "PRE " (CAR TRIPLE) " not found " T]) (ExpandPOSMacro [LAMBDA (LST) (* ryu "10-JUL-84 05:44") (DECLARE (GROBALVARS CONNECTIONS)) [COND ((ATOM LST) (SETQ LST (LIST LST] (for X in LST bind POSs join (COND ((SETQ POSs (FASSOC X CONNECTIONS)) (ExpandPOSMacro (CDDR POSs))) (T (LIST X]) (INFDICTCONVERTER [LAMBDA (SOURCELIST) (* ryu "10-JUL-84 06:17") (MAPCONC SOURCELIST (FUNCTION INFDICTCONVERTER1]) (INFDICTCONVERTER1 [LAMBDA (SOURCE) (* J.Ikeo "29-AUG-84 14:08") (PROG (CONVERTED) (COND ((EQ (CAR SOURCE) (QUOTE *)) (RETURN NIL))) [SETQ CONVERTED (CONS (INFKANACONVERTER (CAR SOURCE)) (create SUFFIXENTRY KANAKANJICODES ←(INFKANJICONVERTER (CADR SOURCE)) POS ←(INFPOSCONVERTER (CADDR SOURCE)) PRE ←(INFPRECONVERTER (CADDDR SOURCE)) FREQ ←(INFFREQCONVERTER (CADDDR (CDR SOURCE] (RETURN (COND ((NULL (fetch (SUFFIXENTRY POS) of (CDR CONVERTED))) (printout T (CAR SOURCE) "'s POS " (CADDR SOURCE) " invalid" T) NIL) ((NULL (fetch (SUFFIXENTRY PRE) of (CDR CONVERTED))) (printout T (CAR SOURCE) "'s PRE " (CADDDR SOURCE) " invalid" T) NIL) (T (LIST CONVERTED]) (INFKANACONVERTER [LAMBDA (WORD) (* J.Ikeo " 7-SEP-84 08:48") (MAPCAR (EVENTHLIST (MAPCAR (UNPACK WORD) (FUNCTION CHARCODE))) (FUNCTION (LAMBDA (KANACODE) (* J.Ikeo " 6-SEP-84 11:45") (SELECTC KANACODE (8482 (* for Tou-Ten) 89) (8483 (* for Ku-Ten) 90) (8509 (* for - of Kata-Kana) 109) (IDIFFERENCE (LOGAND KANACODE 127) 32]) (EVENTHLIST [LAMBDA (LST) (* J.Ikeo "25-JUN-84 15:20") (COND ((NULL LST) NIL) ((NULL (CDR LST)) NIL) (T (CONS (CADR LST) (EVENTHLIST (CDDR LST]) (INFKANJICONVERTER [LAMBDA (WORD) (* J.Ikeo "25-JUN-84 15:24") (MAPCAR (JISPAIRLIST (MAPCAR (UNPACK WORD) (FUNCTION CHARCODE))) (FUNCTION (LAMBDA (PAIR) (IPLUS (LLSH (CAR PAIR) 8) (CDR PAIR]) (JISPAIRLIST [LAMBDA (LST) (* J.Ikeo "25-JUN-84 15:26") (COND ((NULL LST) NIL) ((NULL (CDR LST)) NIL) (T (CONS (CONS (LOGAND (CAR LST) 127) (LOGAND (CADR LST) 127)) (JISPAIRLIST (CDDR LST]) (INFPOSCONVERTER [LAMBDA (POSATOM) (* ryu "10-JUL-84 06:06") (PROG (ELEMENT POS#) (DECLARE (GLOBALVARS POS#LIST)) (COND ((SETQ ELEMENT (FASSOC POSATOM POS#LIST)) (RETURN (CADR ELEMENT))) (T NIL]) (MAKEUNUSEDPOS#LIST [LAMBDA NIL (* ryu " 9-JUL-84 23:03") (PROG (UNUSEDPOS#LIST) (DECLARE (GLOBALVARS POS#LIST)) (SETQ UNUSEDPOS#LIST (for I from 0 to 255 collect I)) (MAPC POS#LIST (FUNCTION (LAMBDA (ENTRY) (SETQ UNUSEDPOS#LIST (REMOVE (CADR ENTRY) UNUSEDPOS#LIST]) (INFPRECONVERTER [LAMBDA (POSATOM) (* ryu "10-JUL-84 06:07") (PROG (ELEMENT PRE#) (DECLARE (GLOBALVARS PRE#LIST)) (COND ((SETQ ELEMENT (FASSOC POSATOM PRE#LIST)) (RETURN (CADR ELEMENT))) (T NIL]) (MAKEUNUSEDPRE#LIST [LAMBDA NIL (* J.Ikeo "25-JUN-84 15:47") (PROG NIL (DECLARE (GLOBALVARS UNUSEDPRE#LIST PRE#LIST)) (SETQ UNUSEDPRE#LIST (for I from 0 to 255 collect I)) (MAPC PRE#LIST (FUNCTION (LAMBDA (ENTRY) (SETQ UNUSEDPRE#LIST (REMOVE (CADR ENTRY) UNUSEDPRE#LIST]) (INFFREQCONVERTER [LAMBDA (FREQ) (* J.Ikeo "25-JUN-84 15:34") FREQ]) (MAKESUFFIXTREE [LAMBDA (INFDICTENTRIES) (* J.Ikeo "29-AUG-84 13:56") (MAPC INFDICTENTRIES (FUNCTION MAKESUFFIXTREE1]) (MAKESUFFIXTREE1 [LAMBDA (INFDICTENTRY) (* J.Ikeo "29-AUG-84 13:56") (DECLARE (GLOBALVARS SUFFIXTREE)) (MAKESUFFIXTREE2 (CAR INFDICTENTRY) INFDICTENTRY SUFFIXTREE]) (MAKESUFFIXTREE2 [LAMBDA (PHONICCODES INFDICTENTRY TREE) (* J.Ikeo "29-AUG-84 14:37") (COND [(NULL PHONICCODES) (COND [(CADR TREE) (RPLACD (CADR TREE) (CONS (CDR INFDICTENTRY) (CDADR TREE] (T (RPLACA (CDR TREE) (LIST (CAR INFDICTENTRY) (CDR INFDICTENTRY] [(FASSOC (CAR PHONICCODES) (CDDR TREE)) (MAKESUFFIXTREE2 (CDR PHONICCODES) INFDICTENTRY (FASSOC (CAR PHONICCODES) (CDDR TREE] (T (MAKESUFFIXTREE2 (CDR PHONICCODES) INFDICTENTRY (CADR (RPLACD (CDR TREE) (CONS (LIST (CAR PHONICCODES) NIL) (CDDR TREE]) (PutGrammTable1 [LAMBDA (PRE# POSs FREQ) (* ryu "14-AUG-84 09:16") (for POS in POSs bind POS# (MINUS ← NIL) do (COND ((EQ POS '-) (SETQ MINUS T)) (MINUS (COND ((SETQ POS# (FASSOC POS POS#LIST)) (BITMAPBIT GRAMMTABLE PRE# (CADR POS#) 0)) (T (printout T "POS " POS " not found " T))) (SETQ MINUS NIL)) ((SETQ POS# (FASSOC POS POS#LIST)) (BITMAPBIT GRAMMTABLE PRE# (CADR POS#) FREQ)) (T (printout T "POS " POS " not found " T]) ) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS POS#LIST POSLIST PRE#LIST PRELIST FUZOKUGOLIST DICTENTRIES CONNECTIONS GRAMMTABLE) ) (PUTPROPS CONVERTER COPYRIGHT ("Fuji Xerox Co. Ltd." 1984)) (DECLARE: DONTCOPY (FILEMAP (NIL (762 8793 (Complete#List 772 . 1437) (CreateInfDict 1439 . 1699) ( CreateGrammTable 1701 . 2901) (ExpandPOSMacro 2903 . 3267) (INFDICTCONVERTER 3269 . 3428) (INFDICTCONVERTER1 3430 . 4328) (INFKANACONVERTER 4330 . 4892) (EVENTHLIST 4894 . 5122) ( INFKANJICONVERTER 5124 . 5399) (JISPAIRLIST 5401 . 5697) (INFPOSCONVERTER 5699 . 5983) ( MAKEUNUSEDPOS#LIST 5985 . 6368) (INFPRECONVERTER 6370 . 6654) (MAKEUNUSEDPRE#LIST 6656 . 7044) (INFFREQCONVERTER 7046 . 7165) (MAKESUFFIXTREE 7167 . 7326) (MAKESUFFIXTREE1 7328 . 7554) (MAKESUFFIXTREE2 7556 . 8206) (PutGrammTable1 8208 . 8791))))) STOP