(FILECREATED "28-Jun-84 19:57:57" {PHYLUM}<JLISP>JGP.;7 50567  

      changes to:  (VARS JGPCOMS)
		   (FNS OPENDICT)

      previous date: "13-JUN-83 00:49:22" {PHYLUM}<JLISP>JGP.;5)


(* Copyright (c) 1982, 1983, 1984 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT JGPCOMS)

(RPAQQ JGPCOMS ((COMS * CUFONTCOMS)
	(FNS ALPHACHARP BLTDEFAULTKEY CENTERX CENTERY CONVERTTOPHONIC CTENTRIES CVROMA DEALWITHHC 
	     DICTWORD DISKPAGE FLASHAREA FLASHVKBDW FREQUENCY GREATERFREQ HCMEMBER IFWECUT 
	     IFWESTRETCH INWD JKANJILOOKUP JLISPINIT JRESETLINE JROMACHAR JSHOWSTATE KANAFOR KANAP 
	     KEYFORCHAR LOOKUPCHARS MAKEFOLLOWON MAKESOFTY MAKEVKBDW NKANJI NODETOKANJICODELIST 
	     NPROCESS OPENDICT PARTOFSPEECH PHONIC PICKHC PICKHCKEYS PRUNESOFTIES REALLYADDKANJI 
	     RELADDR RESETLOOKUP ROMAP SCANTABLE SCANTABLE1 SCORE SETJMODE SHOWHC SHOWVKBD 
	     TERMTABLETOHCLIST TRAVERSETABLE TREELOOK TYPEJAPANESE UNIQUIFY)
	(VARS BLANKBOTTOM BLANKMIDDLE BLANKTOP CENTERDOT EMODEKEYS ENGKEYLOC JAPANESEFONTS 
	      BIGJFONTNAMES JMODEKEYS KANJILOOKUPKEY KATKEYLOC LONGBAR (JLISPINIT)
	      REALGRAMMAR ROMALIST)
	(VARS (DICTFILESOURCE (QUOTE MAINDICT426.JLISPLOOKUP))
	      (DICTFILEDIRS (QUOTE ({DSK} {PHYLUM}<JLISP>)))
	      (INFDICTSOURCE (QUOTE INFDICT)))
	(BITMAPS JMODECBITMAP)
	[VARS (JMODECARET (CONS JMODECBITMAP (QUOTE (0 . 4]
	(CONSTANTS KANJIBITWIDTH)
	(RECORDS CHARSTATE DICTADDR DICTENT HC PARSENODE)
	(MACROS CHKIN GPSUCCESSIONP INCRTABLE)
	(GLOBALVARS AMERVKBD BELLRATE BIGJFONTNAMES BIGJFONTS BLACKSHADE BLANKBOTTOM BLANKMIDDLE 
		    BLANKTOP DEFAULTKEYBM DICTFILE EMODEKEYS FONTDIRECTORIES HCVKBD JAPANESEFONTS 
		    JAPANESEFONTS JDISPLAYFONTS JLISPINIT JMODEFLAG JMODEKEYS KANA10 KANA12 KANJI10 
		    KANJI12 KANJIBITWIDTH KANJILOOKUPKEY INFDICT MAINDICT REALGRAMARRAY REALGRAMMAR 
		    ROMALIST SPECIALKEYS TOPLEVELPARSETREE VKBDW VKBDW)))

(RPAQQ CUFONTCOMS ((VARS MAXCSNCODES)
		   (FNS READBIGJFONTS)
		   (VARS BIGJFONTNAMES)))

(RPAQQ MAXCSNCODES 128)
(DEFINEQ

(READBIGJFONTS
  [LAMBDA NIL                                                (* lmm "16-APR-82 15:59")
    (SETQ BIGJFONTS (for FNTS in BIGJFONTNAMES collect (CONS (CAR FNTS)
							     (for BIGJFONT in (CDR FNTS)
								join (\READCUFONTFILE
								       BIGJFONT BIGJFONT
								       (CAR FNTS)
								       (QUOTE (MEDIUM REGULAR REGULAR]
)
)

(RPAQQ BIGJFONTNAMES ((32 JISKANAG32.CU JISPART1KANJIG32.CU)))
(DEFINEQ

(ALPHACHARP
  [LAMBDA (X)                                                (* lmm " 9-APR-82 13:02")
    (OR (AND (IGEQ X (CHARCODE A))
	     (ILEQ X (CHARCODE Z)))
	(AND (IGEQ X (CHARCODE a))
	     (ILEQ X (CHARCODE z])

(BLTDEFAULTKEY
  [LAMBDA (KEYNO)                                            (* edited: "27-MAR-82 14:38")
    (BITBLT DEFAULTKEYBM 0 0 VKBDW (IDIFFERENCE (CENTERX KEYNO)
						72)
	    (IDIFFERENCE (CENTERY KEYNO)
			 12)
	    160 32])

(CENTERX
  [LAMBDA (KEYNO)                                            (* lmm " 1-APR-82 10:24")
                                                             (* Key 0 is lower left, 1 is lower right, 2 is home 
							     left, etc.)
    (PROG ((ROWNO (IQUOTIENT KEYNO 2)))
          (RETURN (IPLUS 158 (COND
			   ((EQ ROWNO 2)
			     0)
			   ((EQ ROWNO 1)
			     8)
			   ((EQ ROWNO 3)
			     16)
			   (T 24))
			 (COND
			   ((ZEROP (IREMAINDER KEYNO 2))
			     0)
			   (T 160])

(CENTERY
  [LAMBDA (KEYNO)                                            (* edited: "30-MAR-82 00:44")
                                                             (* Key 0 is lower left, 1 is lower right, 2 is home 
							     left, etc.)
    (IPLUS 21 (ITIMES 32 (IQUOTIENT KEYNO 2])

(CONVERTTOPHONIC
  [LAMBDA (JISKANACODE)                                      (* lmm " 1-APR-82 10:28")
    (COND
      ((ILESSP JISKANACODE 127)                              (* ASCII)
	(IPLUS JISKANACODE 64))
      (T (PROG ((CODE (IDIFFERENCE (IREMAINDER JISKANACODE 256)
				   32)))
	       (RETURN (MAX 1 (MIN 86 CODE])

(CTENTRIES
  [LAMBDA (N)                                                (* edited: "16-MAR-82 16:17")
    (IREMAINDER N 256])

(CVROMA
  [LAMBDA (L)                                   (* lmm "22-APR-82 10:46"
)
    (COND
      [(LISTP L)
	(COND
	  [(FIXP (CADR L))
	    (LIST (CAR L)
		  (PACKC (for X in (CDR L)
			    join (LIST (LOGOR 128 37)
				       (LOGOR 128 X]
	  (T (CONS (CAR L)
		   (for X in (CDR L) collect (CVROMA X]
      (T L])

(DEALWITHHC
  [LAMBDA (REDOINGLOOKUPFLAG)                                (* lmm "13-APR-82 00:16")
    (RESETLST (PROG (THECHOSENHC KEYTOPLIST HCLISTTAIL HIFREQ DS0FLAG)
		    (SETQ HCLIST (UNIQUIFY HCLIST))
		    [COND
		      ((NULL (CDR HCLIST))
			(RETURN (REALLYADDKANJI (fetch KANJI of (CAR HCLIST]
		    (SETQ HCLIST (SORT HCLIST (FUNCTION GREATERFREQ)))
		    (SETQ HCLISTTAIL HCLIST)
		    (SETQ HIFREQ (fetch SCORE of (CAR HCLIST)))
		    (RESETSAVE NIL (LIST (FUNCTION SETJMODE)
					 JMODEFLAG T))
		LOOP(SETQ DS0FLAG (EQ HCLISTTAIL HCLIST))
		    (SETQ KEYTOPLIST (PICKHCKEYS HCLISTTAIL HIFREQ DS0FLAG))
		    [COND
		      ((AND DS0FLAG (NOT REDOINGLOOKUPFLAG)
			    (NULL (CDR KEYTOPLIST)))
			(RETURN (REALLYADDKANJI (fetch KANJI of (CAR HCLISTTAIL]
		    (SHOWVKBD HCVKBD)
		    [COND
		      (DS0FLAG (BLTDEFAULTKEY (CAR KEYTOPLIST]
		    (MAP2C HCLISTTAIL KEYTOPLIST (FUNCTION SHOWHC))
		    (PROG (INKEY)
		      CHOOSELP
		          (SETQ INKEY (KEYFORCHAR))
		          (COND
			    ((NULL INKEY)
			      (FLASHVKBDW)
			      (GO CHOOSELP))
			    [(EQ INKEY (QUOTE DEFAULT))
			      (RETURN (SETQ THECHOSENHC (CAR HCLIST]
			    ((EQ INKEY (QUOTE KANJILOOKUP))
			      (RETURN NIL)))
		          (SETQ THECHOSENHC (PICKHC INKEY KEYTOPLIST HCLISTTAIL))
		          (COND
			    ((NULL THECHOSENHC)
			      (FLASHAREA (IDIFFERENCE (CENTERX INKEY)
						      73)
					 (IDIFFERENCE (CENTERY INKEY)
						      9)
					 (IPLUS 73 90)
					 (IPLUS 9 15)
					 VKBDW)
			      (GO CHOOSELP)))
		          (RETURN THECHOSENHC))
		    [COND
		      (THECHOSENHC (SETJMODE JMODEFLAG T)
				   (RETURN (REALLYADDKANJI (fetch KANJI of THECHOSENHC]
		    [SETQ HCLISTTAIL (NTH HCLISTTAIL (ADD1 (LENGTH KEYTOPLIST]
                                                             (* Getting here means he hit the KANJILOOKUP key again 
							     to see more display sets)
		    (COND
		      ((NULL HCLISTTAIL)
			(SETQ HCLISTTAIL HCLIST)))
		    (GO LOOP])

(DICTWORD
  [LAMBDA (DICTTABLE DICT)                                   (* lmm "22-JUL-82 17:25")
    (COND
      (DICTTABLE                                             (* DICTTABLE presumed to be of form 
							     (reladdr, dictpage), except that we have to add 1 to 
							     skip new-fangled header page)
		 (WORDCONTENTS (WORDOFFSET (\MAPPAGE (ADD1 (fetch DICTPAGE of DICTTABLE))
						     DICT)
					   (fetch DICTWORD of DICTTABLE])

(DISKPAGE
  [LAMBDA (N)                                                (* edited: "16-MAR-82 16:33")
    (IREMAINDER N 4096])

(FLASHAREA
  [LAMBDA (LEFT BOTTOM WIDTH HEIGHT WINDOW)                  (* lmm "23-MAR-82 22:02")
    (FRPTQ 4 (BITBLT NIL NIL NIL WINDOW LEFT BOTTOM WIDTH HEIGHT (QUOTE TEXTURE)
		     (QUOTE INVERT)
		     BLACKSHADE)
	   (DISMISS BELLRATE])

(FLASHVKBDW
  [LAMBDA NIL                                                (* lmm "23-MAR-82 22:02")
    (FLASHAREA NIL NIL NIL NIL VKBDW])

(FREQUENCY
  [LAMBDA (N DUMMY)                                          (* edited: "16-MAR-82 16:54")
    (SETQ DUMMY (IQUOTIENT N 16))
    (IREMAINDER DUMMY 16])

(GREATERFREQ
  [LAMBDA (HC1 HC2)                                          (* lmm "13-APR-82 00:05")
    (IGREATERP (fetch SCORE of HC1)
	       (fetch SCORE of HC2])

(HCMEMBER
  [LAMBDA (HC LST)                                           (* lmm "13-APR-82 14:50")
    (COND
      ((NULL LST)
	NIL)
      ((EQUAL (fetch KANJI of HC)
	      (fetch KANJI of (CAR LST)))
	LST)
      (T (HCMEMBER HC (CDR LST])

(IFWECUT
  [LAMBDA (NODE INFDICTSTARTTABLE)                           (* lmm "22-JUL-82 16:42")

          (* i.e., we posit a terminal lookup on whatever was under way, see if any of those alternatives 
	  (including the possibility of starting out a soft ending) agrees grammatically with what preceeded them, and for 
	  each such we start off a new lookup of the current PHONICCODE in INFDICT)

                                                             (* returns a list of successful nodes, if any)
                                                             (* format of NODE is (table dicttype softkana hclist))
    (COND
      ((EQ (fetch (PARSENODE TABLE) of NODE)
	   (QUOTE SOFT))
	(COND
	  ((EQ INFDICTSTARTTABLE (QUOTE LOOKUP))             (* Special signal from DOLOOKUP, means I just want to 
							     return this soft node)
	    (LIST NODE))
	  (T                                                 (* it's ALREADY soft, so it can't be cut, only 
							     stretched)
	     NIL)))
      (T (PROG [HCLIS TAILPOSNO (TERMTABLE (TRAVERSETABLE 255 (fetch (PARSENODE TABLE) of NODE)
							  (fetch DICTTYPE of NODE]
	       (COND
		 ((NULL TERMTABLE)                           (* can't even BE cut)
		   (RETURN NIL)))
	       (SETQ HCLIS (TERMTABLETOHCLIST TERMTABLE (fetch DICTTYPE of NODE)))
	       [SETQ TAILPOSNO (PARTOFSPEECH (CAR (CAR (fetch HCLIST of NODE]
	       (SETQ HCLIS (for EACHHC in HCLIS when (GPSUCCESSIONP TAILPOSNO (PARTOFSPEECH
								      (CAR EACHHC)))
			      collect EACHHC))
	       [COND
		 ((EQ INFDICTSTARTTABLE (QUOTE LOOKUP))      (* Special signal from DOLOOKUP, at lookup time we gotta
							     check if we can end with this thing)
                                                             (* 249 is SOFT and 250 is HARD)
		   (SETQ HCLIS (for EACHHC in HCLIS when (OR (GPSUCCESSIONP (PARTOFSPEECH
									      (CAR EACHHC))
									    249)
							     (GPSUCCESSIONP (PARTOFSPEECH
									      (CAR EACHHC))
									    250))
				  collect EACHHC]            (* OK, now for each candidate on HCLIS we can 
							     potentially create TWO new nodes: one following 
							     INFDICTSTARTTABLE, and one which is soft)
	       (RETURN (NCONC (for EACHHC in HCLIS join (MAKEFOLLOWON NODE EACHHC INFDICTSTARTTABLE))
			      (COND
				((EQ INFDICTSTARTTABLE (QUOTE LOOKUP))
                                                             (* Special signal from DOLOOKUP, means I just want a 
							     cut, no softies)
				  NIL)
				(T (for EACHHC in HCLIS join (MAKESOFTY NODE EACHHC])

(IFWESTRETCH
  [LAMBDA (NODE PHONICCODE TAIL)                             (* lmm "22-JUL-82 16:46")
    (COND
      ((EQ (fetch (PARSENODE TABLE) of NODE)
	   (QUOTE SOFT))                                     (* it's ALREADY soft, so we can CERTAINLY stretch it)
	(CONS (create PARSENODE
		      TABLE ←(QUOTE SOFT)
		      DICTTYPE ← NIL
		      SOFTKANA ←(ADD1 (fetch SOFTKANA of NODE))
		      HCLIST ←(fetch HCLIST of NODE))
	      TAIL))
      (T                                                     (* i.e., we try to contine nonterminally down this table
							     by adding PHONICCODE; returns list of viable nodes so 
							     created (if any))
	 (PROG [(TABLE (TRAVERSETABLE PHONICCODE (fetch (PARSENODE TABLE) of NODE)
				      (fetch DICTTYPE of NODE]
	       (RETURN (COND
			 (TABLE                              (* Just return (list of) the node, with incremented 
							     table pointer)
				(RETURN (CONS (create PARSENODE reusing NODE TABLE ← TABLE)
					      TAIL)))
			 (T TAIL])

(INWD
  [LAMBDA (STREAM DUMMY)                                     (* edited: "30-MAR-82 00:59")
    (SETQ DUMMY (\BIN STREAM))
    (IPLUS (ITIMES DUMMY 256)
	   (\BIN STREAM])

(JKANJILOOKUP
  [LAMBDA NIL                                                (* lmm "13-APR-82 00:28")
    (NPROCESS)
    (PROG [(HCLIST (for NODE in (PRUNESOFTIES (for NODE in (fetch PARSETREE of STATE)
						 join (IFWECUT NODE (QUOTE LOOKUP)))
					      T)
		      bind (KANAS ←(REVERSE (fetch KANALOOKUPSTRING of STATE)))
		      collect (create HC
				      SCORE ←(SCORE NODE)
				      KANJI ←(NODETOKANJICODELIST NODE KANAS]
          (COND
	    (HCLIST (JERASECHARS (FUNCTION ROMAP))           (* Shouldn't be any: flush them)
		    (JERASECHARS (FUNCTION KANAP))
		    (DEALWITHHC])

(JLISPINIT
  [LAMBDA (DIRS)                                             (* lmm "22-JUL-82 17:26")
    [COND
      ((NEQ JLISPINIT T)
	(PROG NIL                                            (* lmm "21-MAR-82 23:32")
	      [RESETVARS ((FONTDIRECTORIES (APPEND (OR DIRS (QUOTE ({PHYLUM}<JLISP>)))
						   FONTDIRECTORIES)))
		         (SETQ JDISPLAYFONTS (ARRAY 128 (QUOTE POINTER)
						    NIL 0))
		         (for X in JAPANESEFONTS do (SETA JDISPLAYFONTS (CAR X)
							  (FONTCREATE (CADR X)
								      12]
	      (SETQ BIGJFONTS)
	      [PROGN                                         (* SET UP DUMMY PRESS FONTS)
		     (SETQ KANA10 (DUMMYPRESSFONT (QUOTE KANAMC)
						  10))
		     (SETQ KANA12 (DUMMYPRESSFONT (QUOTE KANAMC)
						  12))
		     (SETQ KANJI10 (ARRAY 127 (QUOTE POINTER)
					  NIL 0))
		     (SETQ KANJI12 (ARRAY 12 (QUOTE POINTER)
					  NIL 0))
		     (for I from 0 to 11 do (SETA KANJI10 I (DUMMYPRESSFONT
						    (PACK* (QUOTE KANJIMC)
							   (CHARACTER (IPLUS (CHARCODE A)
									     I)))
						    10))
					    (SETA KANJI12 I (DUMMYPRESSFONT
						    (PACK* (QUOTE KANJIMC)
							   (CHARACTER (IPLUS (CHARCODE A)
									     I)))
						    12]
	      (RESETVARS ((DIRECTORIES (APPEND DIRS DIRECTORIES)))
		         (SETQ VKBDW (MAKEVKBDW "Virtual Keyboard"))
		         (WINDOWPROP VKBDW (QUOTE RESHAPEFN)
				     (QUOTE DON'T))
		         (SETQ ENGVKBD (READPRESS (QUOTE VKBD-ENGLISH.PRESS)))
		         (SETQ HIRAVKBD (READPRESS (QUOTE VKBD-HIRAGANA.PRESS)))
		         (SETQ KATAVKBD (READPRESS (QUOTE VKBD-KATAKANA.PRESS)))
		         (SETQ HCVKBD (READPRESS (QUOTE VKBD-HOMOCHOICE.PRESS)))
		         (SETQ JMODEFLAG (QUOTE INITIAL))
		         (SETJMODE))
	      (PROGN (printout T "reading dictionaries . . .")
		     (OPENDICT (QUOTE MAINDICT))
		     (OPENDICT (QUOTE INFDICT))
		     (printout T "done" T))
	      (SETQ DEFAULTKEYBM (READPRESS (QUOTE DEFAULTKEY.PRESS)))
	      [PROGN (SETQ REALGRAMARRAY (BITMAPCREATE 256 256))
		     (for X in REALGRAMMAR do (for Y in (CDR X) do (BITMAPBIT REALGRAMARRAY
									      (CAR X)
									      Y 1]
	      (RETURN (SETQ JLISPINIT T]
    (OR (AND MAINDICT (OPENP MAINDICT (QUOTE INPUT)))
	(OPENDICT (QUOTE MAINDICT)))
    (OR (AND INFDICT (OPENP INFDICT (QUOTE INPUT)))
	(OPENDICT (QUOTE INFDICT])

(JRESETLINE
  [LAMBDA NIL                                                (* lmm "13-APR-82 14:37")
                                                             (* CALLED AT THE BEGINNING OF EACH NEW LINE TO RESET THE
							     LOOKUP STATE)
    (SETJMODE JMODEFLAG)
    (RESETLOOKUP])

(JROMACHAR
  [LAMBDA (CHAR)                                             (* lmm "25-APR-82 23:12")
    (PROG [(TREE (TREELOOK CHAR (fetch ROMATREE of STATE]
          (COND
	    [TREE                                            (* I.e., this character is a legal successor to what's 
							     there.)
		  (COND
		    ((NUMBERP (CADR TREE))                   (* I.e., this is a terminal node.)
		      (LOOKUPCHARS (CDR TREE)))
		    (T                                       (* I.e., this is non-terminal: jump down one level in 
							     the tree.)
		       (SETQ STATE (create CHARSTATE using STATE ROMATREE ← TREE))
		       (JADDCHAR CHAR]
	    ((NPROCESS)
	      (JROMACHAR CHAR))
	    ((EQ CHAR (CHARCODE '))                          (* ignore char)
	      NIL)
	    ((NOT (ALPHACHARP CHAR))                         (* NON-ALPHA CHAR)
	      (RESETLOOKUP)
	      (SELCHARQ CHAR
			(← (MAPC LONGBAR (FUNCTION JADDCHAR)))
			(↑ (MAPC CENTERDOT (FUNCTION JADDCHAR)))
			((%( %) %[ %])
			  (SETJMODE)
			  (JADDCHAR CHAR))
			(JADDCHAR CHAR)))
	    (T (FLASHVKBDW])

(JSHOWSTATE
  [LAMBDA NIL                                                (* lmm " 5-APR-82 15:21")
                                                             (* CALLED AFTER EACH BACKUP; CAN FIX UP DISPLAY TO SHOW 
							     STATE, E.G. BACK TO JLISP MODE IF BAKSPACE INTO KANJI)
    (COND
      [JMODEFLAG (OR STATE (SETQ STATE (create CHARSTATE]
      (T (SETQ STATE)))
    NIL])

(KANAFOR
  [LAMBDA (N)                                                (* lmm " 1-APR-82 15:20")
                                                             (* Input code is from ROMALIST, which is JIS lower kana 
							     byte (small a = 33))
    (IPLUS (LLSH JMODEFLAG 8)
	   N])

(KANAP
  [LAMBDA (STATE)                                            (* lmm " 2-APR-82 14:20")
    (AND STATE (NEQ (fetch (CHARSTATE PARSETREE) of STATE)
		    TOPLEVELPARSETREE])

(KEYFORCHAR
  [LAMBDA NIL                                                (* lmm "13-APR-82 00:15")
    (SELCHARQ (\GETKEY)
	      (ESC                                           (* ESCAPE key)
		   (QUOTE DEFAULT))
	      (TAB (QUOTE KANJILOOKUP))
	      ((z x c v b Z X C V B)
		0)
	      ((n m N M %. , / < > ?)
		1)
	      ((a s d f g A S D F G)
		2)
	      ((h j k l H J K L ; :)
		3)
	      ((q w e r t Q W E R T)
		4)
	      ((y u i o p Y U I O P)
		5)
	      ((2 3 4 5 6)
		6)
	      ((7 8 9 0 -)
		7)
	      NIL])

(LOOKUPCHARS
  [LAMBDA (CODES)                                            (* lmm "22-JUL-82 16:56")
    (PROG (INFDICTTABLE PHONICCODE (PARSETREE (fetch PARSETREE of STATE))
			KANACODE)
          (JERASECHARS (FUNCTION ROMAP))
          (for CODE in CODES do (SETQ KANACODE (KANAFOR CODE))
				(SETQ PHONICCODE (CONVERTTOPHONIC KANACODE))
				(SETQ INFDICTTABLE (TRAVERSETABLE PHONICCODE
								  (create DICTADDR
									  DICTWORD ← 0
									  DICTPAGE ← 0)
								  INFDICT))

          (* For use by IFWECUT: see if this code can start an inflection; although we call IFWECUT even if not, bcause 
	  maybe we can start a soft ending)


				(SETQ STATE (create CHARSTATE
					       using STATE PARSETREE ←(SETQ PARSETREE
						       (PRUNESOFTIES (for NODE in PARSETREE
									join (IFWESTRETCH
									       NODE PHONICCODE
									       (IFWECUT NODE 
										     INFDICTTABLE)))
								     NIL))
						     KANALOOKUPSTRING ←(CONS KANACODE
									     (fetch KANALOOKUPSTRING
										of STATE))
						     ROMATREE ← ROMALIST))
				(JADDCHAR KANACODE])

(MAKEFOLLOWON
  [LAMBDA (EXTANTNODE HC INFDICTTABLE)                       (* lmm "22-JUL-82 16:42")
                                                             (* If successful, returns LIST of the new node, for 
							     MAPCONCing)
    (COND
      ((NULL INFDICTTABLE)                                   (* can't start a next fragment that way)
	NIL)
      (T (LIST (create PARSENODE
		       TABLE ← INFDICTTABLE
		       DICTTYPE ← INFDICT
		       SOFTKANA ← 0
		       HCLIST ←(CONS HC (fetch HCLIST of EXTANTNODE])

(MAKESOFTY
  [LAMBDA (EXTANTNODE HC)                                    (* lmm "26-APR-82 00:07")
                                                             (* If successful, returns LIST of the new node, for 
							     MAPCONCing)
    (COND
      ((NOT (GPSUCCESSIONP (PARTOFSPEECH (CAR HC))
			   371Q))                            (* 371Q is SOFT this is the one place at which we test 
							     if the node will accept a soft ending)
	NIL)
      (T                                                     (* we create with SOFT as the sign of the soft node 
							     (1 soft kana as yet))
	 (LIST (create PARSENODE
		       TABLE ←(QUOTE SOFT)
		       DICTTYPE ← NIL
		       SOFTKANA ← 1
		       HCLIST ←(CONS HC (fetch HCLIST of EXTANTNODE])

(MAKEVKBDW
  [LAMBDA (STRING)                                           (* edited: "19-MAR-82 15:11")
    (CREATEW (QUOTE (300 150 584 165))
	     STRING])

(NKANJI
  [LAMBDA (N)                                                (* edited: "16-MAR-82 16:43")
    (IREMAINDER N 16])

(NODETOKANJICODELIST
  [LAMBDA (ANODE KANAS)                                      (* lmm "15-JUL-82 01:44")
    (PROG [(R (COND
		((EQ (fetch (PARSENODE TABLE) of ANODE)
		     (QUOTE SOFT))
		  (NLEFT KANAS (fetch SOFTKANA of ANODE]
          (for X in (fetch HCLIST of ANODE) do (SETQ R (NCONC (CDR X)
							      R)))
          (RETURN R])

(NPROCESS
  [LAMBDA NIL                                                (* lmm "25-APR-82 23:35")
    (PROG ((C (JPEEKBACK)))
          (RETURN (AND C (NULL (CDR C))
		       (SELCHARQ (CAR C)
				 ((N M)
				   (LOOKUPCHARS (QUOTE (115)))
				   T)
				 NIL])

(OPENDICT
  [LAMBDA (DICTTYPENAME)                                     (* rmk: "28-Jun-84 19:43")
    (SELECTQ DICTTYPENAME
	     [MAINDICT [SETQ MAINDICT (OPENSTREAM (FINDFILE DICTFILESOURCE T DICTFILEDIRS)
						  (QUOTE INPUT)
						  NIL NIL (QUOTE ((MAXBUFFERS 10]
		       (WHENCLOSE MAINDICT (QUOTE CLOSEALL)
				  (QUOTE NO))
		       (SETQ TOPLEVELPARSETREE
			 (LIST (create PARSENODE
				       TABLE ←(create DICTADDR
						      DICTPAGE ← 0
						      DICTWORD ← 0)
				       DICTTYPE ← MAINDICT
				       SOFTKANA ← 0
				       HCLIST ←(LIST (LIST 144]
	     (PROGN [SETQ INFDICT (OPENSTREAM (FINDFILE INFDICTSOURCE T DICTFILEDIRS)
					      (QUOTE INPUT)
					      NIL NIL (QUOTE ((MAXBUFFERS 10]
		    (WHENCLOSE INFDICT (QUOTE CLOSEALL)
			       (QUOTE NO])

(PARTOFSPEECH
  [LAMBDA (N)                                                (* edited: "16-MAR-82 16:33")
    (IQUOTIENT N 256])

(PHONIC
  [LAMBDA (N)                                                (* edited: "16-MAR-82 16:29")
    (IREMAINDER N 256])

(PICKHC
  [LAMBDA (KEYNO KEYNOLIST LISTOFHCS)                        (* edited: "27-MAR-82 17:06")
                                                             (* KEYNOLIST may be shorter than LISTOFHCS, but it 
							     assigns key numbers to the first however-many of the HCs
							     on LISTOFHCs)
    (COND
      ((NULL KEYNOLIST)
	NIL)
      ((NULL LISTOFHCS)
	NIL)
      ((EQ KEYNO (CAR KEYNOLIST))
	(CAR LISTOFHCS))
      (T (PICKHC KEYNO (CDR KEYNOLIST)
		 (CDR LISTOFHCS])

(PICKHCKEYS
  [LAMBDA (TAILOFHCLIST HIGHFREQ TOPLEVELFLAG)               (* lmm "13-APR-82 00:28")
    (PROG (MOD8 (KEYTOPLIS)
		UNASSIGNEDTAIL
		(NEXTBESTKEYS (QUOTE (3 2 5 4 1 0 7 6)))
		(MYTAIL TAILOFHCLIST))
      LOOP(COND
	    ((NULL MYTAIL)
	      (GO GLOOP))
	    ((IGREATERP (LENGTH KEYTOPLIS)
			7)
	      (GO GLOOP))
	    ((AND TOPLEVELFLAG (ILESSP (fetch SCORE of (CAR MYTAIL))
				       (IDIFFERENCE HIGHFREQ 2)))
                                                             (* THE MAGIC CONSTANT giving the frequency span of DS0)
	      (GO GLOOP)))
          (SETQ MOD8 (IREMAINDER (CAR (fetch KANJI of (CAR MYTAIL)))
				 8))                         (* WHAT IS THIS REMAINDER???)
          [SETQ KEYTOPLIS (NCONC1 KEYTOPLIS (COND
				    ((NOT (MEMB MOD8 KEYTOPLIS))
				      MOD8)
				    (T NIL]
          (SETQ MYTAIL (CDR MYTAIL))
          (GO LOOP)
      GLOOP
          (SETQ UNASSIGNEDTAIL (MEMB NIL KEYTOPLIS))
          (COND
	    ((NULL UNASSIGNEDTAIL)
	      (RETURN KEYTOPLIS))
	    ((MEMB (CAR NEXTBESTKEYS)
		   KEYTOPLIS)
	      (SETQ NEXTBESTKEYS (CDR NEXTBESTKEYS))
	      (GO GLOOP)))                                   (* This COND awkwardly pares down both NEXTBESTKEYS to 
							     throw away assigned keytops, and KEYTOPLIS to assign the
							     NIL's)
          (RPLACA UNASSIGNEDTAIL (CAR NEXTBESTKEYS))
          (SETQ NEXTBESTKEYS (CDR NEXTBESTKEYS))
          (GO GLOOP])

(PRUNESOFTIES
  [LAMBDA (GIVENPARSETREE DOINGALOOKUPFLAG)                  (* lmm "15-JUL-82 01:43")

          (* in intermediate steps, DOINGALOOKUPFLAG = NIL, and we want to preserve the shortest SOFT parse in case the hard
	  ones die off; at lookup time, we can throw away all SOFTs if there are any hards)


    (PROG ((LOSOFTNO 4096))                                  (* any high number; purpose below is to weed out all but
							     the shortest soft parsings)
          (for NODE in GIVENPARSETREE when (AND (OR DOINGALOOKUPFLAG (EQ (fetch (PARSENODE TABLE)
									    of NODE)
									 (QUOTE SOFT)))
						(ILESSP (fetch SOFTKANA of NODE)
							LOSOFTNO))
	     do                                              (* this weeding only applies to soft nodes, i.e. 
							     NODE:TABLE = SOFT)
		(SETQ LOSOFTNO (fetch SOFTKANA of NODE)))
          (RETURN (for NODE in GIVENPARSETREE when (OR (NEQ (fetch (PARSENODE TABLE) of NODE)
							    (QUOTE SOFT))
						       (EQ (fetch SOFTKANA of NODE)
							   LOSOFTNO))
		     collect NODE])

(REALLYADDKANJI
  [LAMBDA (KANJICODELIST)                                    (* lmm " 5-APR-82 16:51")
    (MAPC KANJICODELIST (FUNCTION JADDCHAR))
    (PROG (C)
          (COND
	    ((OR (EQ (SETQ C (JPEEKKEY))
		     (CHARCODE ↑A))
		 (EQ C KANJILOOKUPKEY))
	      (JGETKEY)
	      (MAPC KANJICODELIST (FUNCTION JCHDEL))
	      (DEALWITHHC T))
	    ((EQ C (CHARCODE ESC))
	      (JGETKEY))
	    (T (RESETLOOKUP])

(RELADDR
  [LAMBDA (N)                                                (* edited: "16-MAR-82 16:33")
    (IQUOTIENT N 256])

(RESETLOOKUP
  [LAMBDA NIL                                                (* lmm " 2-APR-82 16:32")
    (SETQ STATE (AND JMODEFLAG (create CHARSTATE])

(ROMAP
  [LAMBDA (STATE)                                            (* lmm " 2-APR-82 14:42")
    (AND STATE (fetch ROMATREE of STATE)
	 (NEQ (fetch (CHARSTATE ROMATREE) of STATE)
	      ROMALIST])

(SCANTABLE
  [LAMBDA (PHONIC THISTABLE NUMENTRIES DICT)                 (* lmm "22-JUL-82 16:41")
    (COND
      ((ILESSP NUMENTRIES 1)
	NIL)
      ((SCANTABLE1 PHONIC THISTABLE DICT))
      (T (SCANTABLE PHONIC (INCRTABLE THISTABLE 2)
		    (SUB1 NUMENTRIES)
		    DICT])

(SCANTABLE1
  [LAMBDA (PHONIC THISHERETABLE DICT)                        (* lmm "22-JUL-82 16:41")
    (COND
      ((NEQ PHONIC (PHONIC (DICTWORD THISHERETABLE DICT)))
	NIL)
      (T (create DICTADDR
		 DICTWORD ←(RELADDR (DICTWORD THISHERETABLE DICT))
		 DICTPAGE ←(DISKPAGE (DICTWORD (INCRTABLE THISHERETABLE 1)
					       DICT])

(SCORE
  [LAMBDA (ANODE)                                            (* lmm "13-APR-82 00:21")
    (PROG (HCLIST MINFREQ PARTCOUNT)                         (* one of many possible algorithms)
          (SETQ HCLIST (fetch HCLIST of ANODE))
          (SETQ PARTCOUNT (LENGTH HCLIST))
          (SETQ MINFREQ 4096)                                (* a large number)
          [MAPC HCLIST (FUNCTION (LAMBDA (HC)
		    (COND
		      ((ILESSP (FREQUENCY (CAR HC))
			       MINFREQ)
			(SETQ MINFREQ (FREQUENCY (CAR HC]
          (RETURN (IMAX 0 (IDIFFERENCE MINFREQ PARTCOUNT])

(SETJMODE
  [LAMBDA (MODE SHOWFLG)                                     (* lmm "19-APR-82 15:31")
    [COND
      ((OR SHOWFLG (NEQ MODE JMODEFLAG))
	(SHOWVKBD (SELECTQ MODE
			   (45Q KATAVKBD)
			   (44Q HIRAVKBD)
			   ENGVKBD))

          (* (BITBLT NIL NIL NIL VKBDW NIL NIL NIL NIL (QUOTE TEXTURE) (QUOTE INVERT) BLACKSHADE (SELECTQ MODE 
	  (45Q BLANKBOTTOM) (44Q BLANKMIDDLE) BLANKTOP)))


	]
    (COND
      ((SETQ JMODEFLAG MODE)                                 (* should make sure dictionaries are open)
	(CARET JMODECARET)
	(CHANGEFONT BOLDFONT)
	(SETQ SPECIALKEYS JMODEKEYS))
      (T (CARET T)
	 (CHANGEFONT DEFAULTFONT)
	 (SETQ SPECIALKEYS EMODEKEYS)))
    MODE])

(SHOWHC
  [LAMBDA (HC KEY)                                           (* lmm "13-APR-82 00:28")
    (MOVETO (IPLUS (IDIFFERENCE (CENTERX KEY)
				(IQUOTIENT (ITIMES (LENGTH (fetch KANJI of HC))
						   KANJIBITWIDTH)
					   2))
		   (IQUOTIENT KANJIBITWIDTH 2))
	    (CENTERY KEY)
	    VKBDW)
    (for KANJICODE in (fetch KANJI of HC) do (JSHOWKANJI KANJICODE VKBDW])

(SHOWVKBD
  [LAMBDA (KBDBM)                                            (* lmm "16-APR-82 11:43")
    (BITBLT KBDBM 10 15 VKBDW 0 0 NIL])

(TERMTABLETOHCLIST
  [LAMBDA (CURRENTTABLE DICT)                                (* lmm "22-JUL-82 16:42")
    (PROG (KANJILISTHEADER HCLIST (TABLEPTR (INCRTABLE CURRENTTABLE 1)))
          [for N from 1 to (CTENTRIES (DICTWORD CURRENTTABLE DICT))
	     do (SETQ KANJILISTHEADER (DICTWORD TABLEPTR DICT))
		[push HCLIST (CONS KANJILISTHEADER (for M from 1 to (NKANJI KANJILISTHEADER)
						      collect (DICTWORD (INCRTABLE TABLEPTR M)
									DICT]
		(SETQ TABLEPTR (INCRTABLE TABLEPTR (ADD1 (NKANJI KANJILISTHEADER]
          (RETURN HCLIST])

(TRAVERSETABLE
  [LAMBDA (PHONICCODE TABLE DICT)                            (* lmm "22-JUL-82 16:41")
    (COND
      (TABLE                                                 (* (EQ (TABLETYPE (DICTWORD TABLE DICT)) 1))
	     (SCANTABLE PHONICCODE (INCRTABLE TABLE 1)
			(CTENTRIES (DICTWORD TABLE DICT))
			DICT])

(TREELOOK
  [LAMBDA (CODE TR)                                          (* lmm " 1-APR-82 15:59")
    (FASSOC (FCHARACTER CODE)
	    (CDR TR])

(TYPEJAPANESE
  [LAMBDA (ROMA FLG)                                         (* lmm "25-APR-82 23:35")
    [BKSYSBUF (CONCAT (CHARACTER (CHARCODE #C))
		      ROMA "	
" (CHARACTER (CHARCODE #A]
    (COND
      (FLG (READ T T))
      (T (DOSTATS (QUOTE (READ T T])

(UNIQUIFY
  [LAMBDA (HCLIS)                                            (* lmm " 1-APR-82 11:31")
    (PROG ((REST HCLIS)
	   ANS NEXT TAIL)
      LOOP(COND
	    ((NULL REST)
	      (RETURN ANS)))
          (SETQ NEXT (CAR REST))
          (SETQ TAIL (HCMEMBER NEXT (CDR REST)))
          [COND
	    ((NULL TAIL)                                     (* It was already unique)
	      (SETQ ANS (CONS NEXT ANS))
	      (SETQ REST (CDR REST)))
	    (T                                               (* This has a duplicate)
	       (COND
		 [(GREATERFREQ NEXT (CAR TAIL))

          (* Kill off the lower-freq one later in the list, stick this one back on (there may be others later in the list), 
	  and try again.)


		   (SETQ REST (CONS NEXT (REMOVE (CAR TAIL)
						 REST]
		 (T                                          (* Throw NEXT away and try again)
		    (SETQ REST (CDR REST]
          (GO LOOP])
)

(RPAQQ BLANKBOTTOM (495 10 30 31))

(RPAQQ BLANKMIDDLE (511 40 30 31))

(RPAQQ BLANKTOP (536 74 30 30))

(RPAQQ CENTERDOT (8483))

(RPAQQ EMODEKEYS [(193 NIL (* english mode too))
		  (195 (PROGN (SETJMODE 37)
			      (RESETLOOKUP)))
		  (194 (PROGN (SETJMODE 36)
			      (RESETLOOKUP])

(RPAQQ ENGKEYLOC (511 40 30 31))

(RPAQQ JAPANESEFONTS ((33 NSJIS1-C41-)
		      (36 NSJIS1-C44-)
		      (37 NSJIS1-C45-)
		      (48 NSJIS1-C60-)
		      (49 NSJIS1-C61-)
		      (50 NSJIS1-C62-)
		      (51 NSJIS1-C63-)
		      (52 NSJIS1-C64-)
		      (53 NSJIS1-C65-)
		      (54 NSJIS1-C66-)
		      (55 NSJIS1-C67-)
		      (56 NSJIS1-C70-)
		      (57 NSJIS1-C71-)
		      (58 NSJIS1-C72-)
		      (59 NSJIS1-C73-)
		      (60 NSJIS1-C74-)
		      (61 NSJIS1-C75-)
		      (62 NSJIS1-C76-)
		      (63 NSJIS1-C77-)
		      (64 NSJIS1-C100-)
		      (65 NSJIS1-C101-)
		      (66 NSJIS1-C102-)
		      (67 NSJIS1-C103-)
		      (68 NSJIS1-C104-)
		      (69 NSJIS1-C105-)
		      (70 NSJIS1-C106-)
		      (71 NSJIS1-C107-)
		      (72 NSJIS1-C110-)
		      (73 NSJIS1-C111-)
		      (74 NSJIS1-C112-)
		      (75 NSJIS1-C113-)
		      (76 NSJIS1-C114-)
		      (77 NSJIS1-C115-)
		      (78 NSJIS1-C116-)
		      (79 NSJIS1-C117-)))

(RPAQQ BIGJFONTNAMES ((32 JISKANAG32.CU JISPART1KANJIG32.CU)))

(RPAQQ JMODEKEYS [(9 (JKANJILOOKUP))
		  (193 (PROGN (JERASECHARS (QUOTE ROMAP))
			      (SETJMODE NIL)
			      (RESETLOOKUP))
		       (* English mode))
		  (195 (PROGN (SETJMODE 37)
			      (RESETLOOKUP)))
		  (194 (PROGN (SETJMODE 36)
			      (RESETLOOKUP])

(RPAQQ KANJILOOKUPKEY 9)

(RPAQQ KATKEYLOC (495 10 30 31))

(RPAQQ LONGBAR (8508))

(RPAQQ JLISPINIT NIL)

(RPAQQ REALGRAMMAR ((18 250 129 134 130 131 132 133 212 224 225)
	(20 249 145 140 142 143 144 210 224 238 240 216 217)
	(21 249 145 140 142 143 144 210 224 238 240 216 217 241 239 242 72 243)
	(31 249)
	(40 49 71 50 51 52 53 55 54 57 58 59 60 61 63 62 65 64 66 67 68)
	(32 249)
	(27 249 145 140 142 143 144 240 210 238 241 239 242)
	(28 249 145 140 142 143 144 240 210 238 241 239 242)
	(9 250 135 137 139 136 138 174 175)
	(5 250 146 148 152 147 149 150 151)
	(4 250 154 156 160 155 157 158 159)
	(10 250 161 167 169 166 168 174 175)
	(8 250 170 172 176 171 173 174 175)
	(11 250 177 179 181 178 180 194 195)
	(6 250 182 184 188 183 185 186 187)
	(7 250 190 192 196 191 193 194 195)
	(3 250 197 199 201 198 200 194 195)
	(1 249 114 115 113 116 117 118 119 112 181 171 178 126 127 128 223 213 234 231 218 176 230 
	   214 225 217 239 240 211 219 104 105 106 107)
	(2 249 114 115 219 113 116 117 118 119 112 181 171 178 126 127 128 223 213 234 231 218 176 
	   230 214 225 217 239 240 211 145 140 142 143 144 210 238 241 242 104 105 106 107)
	(14 250 154 156 160 155 157 194 195)
	(25 250 145 140 142 143 144 240 210 238 241 239 242 72 243)
	(33 250)
	(15 249 116 117 114 119 112 115 113 118 127 128 214 213 225 217 239 240 211)
	(16 126 171 218 213 176 230 231 234)
	(17 181 178)
	(34 250 177 179 181 178 180 194 195 153)
	(22 250 145 140 142 143 144 240 210 238 241 239 242 243)
	(48 249)
	(26 249 145 140 142 143 144 240 210 238 241 239 242 72 243)
	(39 250)
	(23 250 145 140 142 143 144 240 210 238 241 239 242 243)
	(29 250 145 140 142 143 144 240 210 238 241 239 242 243)
	(12 250 104 107 105 106)
	(24 250 145 140 142 143 144 240 210 238 241 239 242 104 107 105 106 97 72 243)
	(41 249 145 140 142 143 144 240 210 238 241 239 242)
	(35 232 235 236)
	(36 171 213 176 230 231 228)
	(37 249 114 115 113 116 117 118 119 112 126 127 128 214 225 217 239 240 211 213 218)
	(38 181 178)
	(19 249 226)
	(46 250 129 134 130 131 132 133 202 212 224)
	(47 250 154 156 160 155 157)
	(13 250 203 205 206 204)
	(49 49 76 82 83 77 80 85 81 86 84 74 92 89 87 78 90 79 88 91 66 67 68 69 70)
	(71 84 79 88 92)
	(50 250 69 80 83 85 86 82 91 88 89 145 140 142 143 144 240 210 238 241 239 242 74)
	(51 70 90 86 78 87 81)
	(93 81)
	(52 250 69 70 80 83 85 90 74 86 77 82 81 91 88 89 84 79 92 145 140 142 143 144 240 210 238 
	    241 239 242)
	(53 250 69 70 80 83 85 90 86 82 87 76 81 74 88 89 92 145 140 142 143 144 240 210 238 241 239 
	    242)
	(55 83 85 82 84 79)
	(54 250 69 70 80 90 86 77 82 87 81 91 88 77 145 140 142 143 144 240 210 238 241 239 242 74)
	(94 81)
	(56 145 140 142 143 144 240 210 238 241 239 242)
	(57 250 69 70 80 83 85 90 86 82 91 88 89 84 79 145 140 142 143 144 240 210 238 241 239 242 74)
	(58 86 78 87 81)
	(59 250 69 80 83 85 86 82 91 88 89 92 77 90 81 145 140 142 143 144 240 210 238 241 239 242 74)
	(60 250 69 80 83 85 86 77 82 81 84 91 88 79 145 140 142 143 144 240 210 238 241 239 242 74)
	(61 70 90 86 78 87 81 88 79)
	(63 250 85 82 89 145 140 142 143 144 240 210 238 241 239 242)
	(62 250 69 70 80 83 90 86 77 82 81 84 91 88 79 145 140 142 143 144 240 210 238 241 239 242 74)
	(65 70 90 86 78 87 81 79 88)
	(64 250 50 51 52 53 54 55 56 57 58 59 60 61 62 63 69 80 83 85 82 91 89 84 145 140 142 143 144 
	    240 210 238 241 239 242 74)
	(66 250 50 51 52 53 54 55 57 58 59 60 61 62 63 64 65 69 70 80 83 85 90 86 82 91 88 89 84 79 
	    145 140 142 143 144 240 210 238 241 239 242 74)
	(67 86 78 87 81)
	(68 250 50 51 52 53 54 55 57 58 59 60 61 62 63 64 65 66 67 69 70 80 83 85 90 86 82 87 76 81 
	    88 89 84 145 140 142 143 144 240 210 238 241 239 242 74)
	(69 250 50 51 52 53 54 55 57 58 59 60 61 62 63 64 65 66 67 68 80 83 85 90 86 82 87 76 81 88 
	    89 84 145 140 142 143 144 240 210 238 241 239 242)
	(74 250 50 51 52 53 54 55 57 58 59 60 61 62 63 64 65 66 67 68 80 83 85 90 86 82 77 81 88 89 
	    84 91 145 140 142 143 144 240 210 238 241 239 242)
	(70 250 50 51 52 53 54 55 57 58 59 60 61 62 63 64 65 66 67 68 80 83 85 90 86 77 82 81 91 88 
	    89 145 140 142 143 144 240 210 238 241 239 242)
	(72 249 145 140 142 143 144 210 238 240 216 217)
	(73 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(76 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(82 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(83 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(77 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(80 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(85 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(81 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(95 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(86 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(84 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(92 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(89 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(87 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(78 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(90 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(79 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(88 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(91 249 73 240 145 140 142 143 144 210 238 241 239 242)
	(97 249 115 113 116 117 118 119 112 181 171 178 126 127 128 223 213 218 176 230 214 225 239 
	    240 211)
	(98 154 156 160 155 157 194 195)
	(99 249 114 115 113 116 117 118 119 112 127 128 214 213 225 217 239 240 211)
	(100 126 171 218 213 176 230 231 234)
	(101 181 178)
	(102 177 179 181 178 180 194 195)
	(103 249 145 140 142 143 144 240 210 238 241 239 242 243)
	(104 232 235 236)
	(105 171 213 176 230 215 231 228)
	(106 249 114 115 113 116 117 118 119 112 126 127 128 214 225 217 213 218 239 240 211)
	(107 181 178)
	(108 197 199 201 198 200 194 195)
	(109 134 130 131 132 133 212 202)
	(110 154 156 160 155 157)
	(208 249 109)
	(238 249 241 97 98 99 100 101 102 103 104 105 106 107 108 109 110 112 113 114 115 116 117 118 
	     119 218 120 121 122 123 124 125 239)
	(209 201)
	(210 249 188 164 186 187)
	(239 249 98 99 100 101 102 103 104 105 106 107 108 109 110 112 113 114 115 116 117 118 119 
	     218 120 121 122 123 124 125)
	(112 129 134 130 131 132 133 212 224 225)
	(113 154 156 160 155 157 158 159)
	(114 161 167 169 166 168 174 175)
	(115 177 179 181 178 180 194 195)
	(116 182 184 188 183 185 186 187)
	(117 197 199 201 198 200 194 195)
	(118 249 181 171 178 126 127 128 223 213 234 231 218 176 230 214 225 217 239 240 211)
	(119 177 179 181 178 180 194 195 153)
	(211 249 145 140 142 143 144 240 210 238 241 239 242 243)
	(212 249 97 98 99 100 101 102 104 105 106 107 110 113 114 115 116 117 118 119 218 120 121 122 
	     123 124 125 239)
	(126 201)
	(127 249 103 222 180 220 209 227 241 240 140 238 243)
	(128 249 101 100 99 122 123 121 125 98 110 109 124 120 239 227 241 140)
	(129 176 230)
	(130 208)
	(131 201)
	(132 249 221 225 229 103 210 227 140 222 180 220 243)
	(133 249)
	(134 249 221 225 229 103 210 227 140 217 243)
	(135 232 235 236 218 176 230 171)
	(136 249 181 171 178 126 127 128 213 232 218 176 230 214 225 239 208)
	(137 249 104 105 106 107 116 117 114 119 112 115 118 113 214 225 217 97 239 240 211 219)
	(138 201)
	(139 249 227 221 225 229 241 213 103 209 140 243)
	(140 249)
	(142 249)
	(143 249 103 222 180 220 241 209 140 238 227 243)
	(144 249 121 125)
	(145 249)
	(146 232 235 236 218 176 230 171)
	(147 249 181 171 178 126 127 128 213 218 176 230 214 225 239 208)
	(148 249 104 105 106 107 116 117 114 119 112 115 118 113 214 225 217 97 239 240 211 219)
	(149 201)
	(150 249 103 222 180 220 241 209 140 238 227 243)
	(151 249 227 124 120 99 101 100 122 123 121 125 98 110 109 241 239)
	(152 249 227 221 225 229 241 213 103 209 140 243)
	(153 249 214)
	(154 232 235 236 218 176 230 171 182 184 188 183 185 186 187)
	(155 249 181 171 178 126 127 128 213 218 176 230 214 225 239 208)
	(156 249 104 105 106 107 116 117 114 119 112 115 118 113 214 225 217 97 239 240 211 219)
	(157 201)
	(158 249 103 222 180 220 241 209 140 238 227 243)
	(159 249 227 124 120 99 101 100 122 123 121 125 98 110 109 241 239)
	(160 249 227 221 225 229 241 213 103 209 140 243)
	(161 232 235 236 218 176 230 171)
	(162 249 176 230 208 171 215)
	(163 208)
	(164 201)
	(166 249 181 171 178 126 127 128 213 218 176 230 214 225 239 208)
	(167 249 104 105 106 107 116 117 114 119 112 115 118 113 214 225 217 97 239 240 211 219)
	(168 201)
	(169 249 227 221 225 229 241 213 103 209 140 243)
	(170 232 235 236 218 176 230 171)
	(171 249 181 171 178 126 127 128 213 218 176 230 214 225 239 208)
	(172 249 116 117 114 119 112 115 118 113 214 225 217 239 240 211 219)
	(173 201)
	(174 249 103 222 180 220 241 209 140 238 227 243)
	(175 249 227 124 120 99 101 100 122 123 121 125 98 110 109 241 239)
	(176 249 227 221 225 229 241 213 103 209 140 243)
	(177 232 235 236 218 176 230 171)
	(178 249 208)
	(179 249 104 105 106 107 116 117 114 119 112 115 118 113 214 225 217 97 239 240 211 219)
	(180 201)
	(181 249 227 221 225 229 241 213 103 209 140 243)
	(182 232 235 236 218 176 230 171)
	(183 249 181 171 178 126 127 128 213 218 176 230 214 225 239 208)
	(184 249 104 105 106 107 116 117 114 119 112 115 118 113 214 225 217 97 239 240 211 219)
	(185 201)
	(186 249 103 222 180 220 241 209 140 238 227 243)
	(187 249 227 124 120 99 101 100 122 123 121 125 98 110 109 241 239)
	(188 249 227 221 225 229 241 213 103 209 140 243)
	(190 232 235 236 218 176 230 171)
	(191 249 181 171 178 126 127 128 213 218 176 230 214 225 239 208)
	(192 249 104 105 106 107 116 117 114 119 112 115 118 113 214 225 217 97 239 240 211 219)
	(193 201)
	(194 249 103 222 180 220 241 209 140 238 227 243)
	(195 249 227 124 120 99 101 100 122 123 121 125 98 110 109 241 239)
	(196 249 227 221 225 229 241 213 103 209 140 243)
	(197 232 235 236 218 176 230 171)
	(198 249 181 171 178 126 127 128 213 218 176 230 214 225 239 208)
	(199 249 104 105 106 107 116 117 114 119 112 115 118 113 214 225 217 97 239 240 211 219)
	(200 201)
	(201 249 227 221 225 229 241 213 103 209 140 243)
	(202 225)
	(203 176 230 231 171 228)
	(204 208)
	(205 249 116 117 114 119 118 112 115 113 126 127 128 223 214 225 217 239 240 211 213 218 171 
	     176 219)
	(206 181)
	(213 249)
	(214 162 188 163 164 186 187)
	(243 249 145 140 142 143 144 210 238 240 216)
	(215 249 210 227)
	(216 249 103)
	(217 249)
	(218 134 130 131 132 133 202 212)
	(240 249 98 99 100 101 102 104 105 106 107 108 109 110 218 120 121 122 123 124 239)
	(241 249 240 145 140 142 143 144 210 238 242 239)
	(242 249)
	(220 249 208)
	(231 249 114 115 113 116 117 118 119 112 181 171 178 126 127 128 223 213 218 176 230 214 225 
	     217 239 240 211)
	(221 129 134 130 131 132 133 212 224)
	(232 249 114 115 113 116 117 118 119 112 181 171 178 126 127 128 223 213 218 176 230 214 225 
	     217 239 240 211)
	(222 249 107 106 104 105 239)
	(223 249)
	(224 249 145 140 142 143 144 240 210 238 241 239 242)
	(234 249 114 115 113 116 117 118 119 112 181 171 178 126 127 128 223 213 218 176 231 230 214 
	     225 217 239 240 211)
	(235 249 114 115 113 116 117 118 119 112 181 171 178 126 127 128 223 213 231 218 176 230 214 
	     225 217 239 240 211)
	(236 249 114 115 113 116 117 118 119 112 181 171 178 126 127 128 223 213 218 176 230 214 225 
	     217 239 240 211)
	(225 249 145 140 142 143 144 210 224 238 240 216)
	(226 249)
	(120 154 156 160 155 157 158 159)
	(121 177 179 181 178 180 194 195)
	(122 182 184 188 183 185 186 187)
	(123 197 199 201 198 200 194 195)
	(124 249 181 171 178 126 127 128 223 213 231 218 176 230 214 225 217 239 240 211)
	(125 177 179 181 178 180 194 195 153)
	(219 249 227 221 225 229 241 213 103 209 140 243)
	(227 249)
	(228 249)
	(229 249 145 140 142 143 144 210 224 238 240 216)
	(230 249)
	(0 18 20 21 31 40 32 27 28 9 5 4 10 8 11 6 7 3 1 2 14 25 33 15 16 17 34 22 48 26 39 23 29 12 
	   24 41 35 36 37 38 19 46 47 13 49 71 50 51 52 53 55 54 56 57 58 59 60 61 63 62 65 64 66 67 
	   68 69 74 70)
	(253 18 9 5 4 10 8 11 6 7 3 14 33 34 12 46 47 13)))

(RPAQQ ROMALIST (nil (A 34)
		     (B (A 80)
			(E 89)
			(I 83)
			(O 92)
			(U 86)
			(Y (A 83 99)
			   (O 83 103)
			   (U 83 101)))
		     (C (C (H (A 67 65 99)
			      (E 67 65 39)
			      (I 67 65)
			      (O 67 65 103)
			      (U 67 65 101)))
			(H (A 65 99)
			   (E 65 39)
			   (I 65)
			   (O 65 103)
			   (U 65 101)))
		     (D (A 64)
			(E 71)
			(I 66)
			(O 73)
			(U 69)
			(Y (A 66 99)
			   (I 71 35)
			   (O 66 103)
			   (U 66 101)))
		     (E 40)
		     (F (A 85 33)
			(E 85 39)
			(I 85 35)
			(O 85 41)
			(U 85))
		     (G (A 44)
			(E 50)
			(I 46)
			(O 52)
			(U 48)
			(W (A 48 110))
			(Y (A 46 99)
			   (O 46 103)
			   (U 46 101)))
		     (H (A 79)
			(E 79)
			(I 82)
			(O 91)
			(U 85)
			(Y (A 82 99)
			   (O 82 103)
			   (U 82 101)))
		     (I 36)
		     (J (A 56 99)
			(E 56 39)
			(I 56)
			(O 56 103)
			(U 56 101))
		     (K (A 43)
			(E 49)
			(I 45)
			(K (A 67 43)
			   (E 67 49)
			   (I 67 45)
			   (O 67 51)
			   (U 67 47)
			   (Y (A 67 45 99)
			      (O 67 45 103)
			      (U 67 45 101)))
			(O 51)
			(U 47)
			(W (A 47 110))
			(Y (A 45 99)
			   (O 45 103)
			   (U 45 101)))
		     (M (A 94)
			(E 97)
			(I 95)
			(O 98)
			(U 96)
			(Y (A 95 99)
			   (O 95 103)
			   (U 95 101)))
		     (N (A 74)
			(E 77)
			(I 75)
			(O 78)
			(U 76)
			(Y (A 75 99)
			   (O 75 103)
			   (U 75 101)))
		     (O 42)
		     (P (A 81)
			(E 90)
			(I 84)
			(O 93)
			(P (A 67 81)
			   (E 67 90)
			   (I 67 84)
			   (O 67 93)
			   (U 67 87)
			   (Y (A 67 84 99)
			      (O 67 84 103)
			      (U 67 84 101)))
			(U 87)
			(Y (A 84 99)
			   (O 84 103)
			   (U 84 101)))
		     (R (A 105)
			(E 108)
			(I 106)
			(O 109)
			(U 107)
			(Y (A 106 99)
			   (O 106 103)
			   (U 106 101)))
		     (S (A 53)
			(E 59)
			(H (A 55 99)
			   (E 55 39)
			   (I 55)
			   (O 55 103)
			   (U 55 101))
			(I 55)
			(O 61)
			(S (A 67 53)
			   (E 67 59)
			   (H (A 67 55 99)
			      (E 67 55 39)
			      (I 67 55)
			      (O 67 55 103)
			      (U 67 55 101))
			   (I 67 55)
			   (O 67 61)
			   (U 67 57)
			   (Y (A 67 55 99)
			      (E 67 55 39)
			      (O 67 55 103)
			      (U 67 55 101)))
			(U 57)
			(Y (A 55 99)
			   (E 55 39)
			   (O 55 103)
			   (U 55 101)))
		     (T (A 63)
			(C (H (A 67 65 99)
			      (E 67 65 39)
			      (O 67 65 103)
			      (U 67 65 101)))
			(E 70)
			(I 65)
			(O 72)
			(S (U 68))
			(T (A 67 63)
			   (E 67 70)
			   (I 67 65)
			   (O 67 72)
			   (S (U 67 68))
			   (U 67 68)
			   (Y (A 67 65 99)
			      (E 67 65 39)
			      (O 67 65 103)
			      (U 67 65 101)))
			(U 68)
			(Y (A 65 99)
			   (E 65 39)
			   (I 70 35)
			   (O 65 103)
			   (U 65 101)))
		     (U 38)
		     (W (A 111)
			(E 113)
			(I 112)
			(O 114))
		     (Y (A 100)
			(O 104)
			(U 102))
		     (Z (A 54)
			(E 60)
			(I 56)
			(O 62)
			(U 58)
			(Y (A 56 99)
			   (E 56 39)
			   (O 56 103)
			   (U 56 101)))
		     (a 33)
		     (e 39)
		     (i 35)
		     (m 115)
		     (n 115)
		     (o 41)
		     (t (s (u 67))
			(S (U 67))
			(u 67)
			(U 67))
		     (u 37)
		     (w (a 110)
			(A 110))
		     (y (a 99)
			(A 99)
			(o 103)
			(O 103)
			(u 101)
			(U 101))))

(RPAQQ DICTFILESOURCE MAINDICT426.JLISPLOOKUP)

(RPAQQ DICTFILEDIRS ({DSK} {PHYLUM}<JLISP>))

(RPAQQ INFDICTSOURCE INFDICT)

(RPAQ JMODECBITMAP (READBITMAP))
(16 16
"CH@@"
"CH@@"
"CH@@"
"CH@@"
"CH@@"
"CH@@"
"CH@@"
"CH@@"
"CH@@"
"CH@@"
"CH@@"
"CH@@"
"CH@@"
"CH@@"
"@@@@"
"@@@@")

(RPAQ JMODECARET (CONS JMODECBITMAP (QUOTE (0 . 4))))
(DECLARE: EVAL@COMPILE 

(RPAQQ KANJIBITWIDTH 14)

(CONSTANTS KANJIBITWIDTH)
)
[DECLARE: EVAL@COMPILE 

(RECORD CHARSTATE (ROMATREE PARSETREE WORD# KANALOOKUPSTRING)
                                                             (* RECORD OF CURRENT STATE OF BUFFER.)
		  ROMATREE ← ROMALIST PARSETREE ← TOPLEVELPARSETREE)

(ACCESSFNS DICTADDR ((DICTWORD (LOGAND DATUM 255))
		     (DICTPAGE (LRSH DATUM 8)))
		    (CREATE (IPLUS DICTWORD (LLSH DICTPAGE 8))))

(RECORD DICTENT (KH TBL DICTOFD))

(RECORD HC (SCORE . KANJI))

(DATATYPE PARSENODE (TABLE DICTTYPE SOFTKANA HCLIST))
]
(/DECLAREDATATYPE (QUOTE PARSENODE)
		  (QUOTE (POINTER POINTER POINTER POINTER)))
(DECLARE: EVAL@COMPILE 

(PUTPROPS CHKIN MACRO ((N)
		       (OR (EQ (INWD OFD)
			       N)
			   (HELP))))

(PUTPROPS GPSUCCESSIONP MACRO ((POSNO1 POSNO2)
			       (NEQ 0 (BITMAPBIT REALGRAMARRAY POSNO1 POSNO2))))

(PUTPROPS INCRTABLE MACRO [LAMBDA (TABLE N)                  (* lmm "15-APR-82 12:13")
			    (IPLUS TABLE N])
)
(DECLARE: DOEVAL@COMPILE DONTCOPY

(ADDTOVAR GLOBALVARS AMERVKBD BELLRATE BIGJFONTNAMES BIGJFONTS BLACKSHADE BLANKBOTTOM BLANKMIDDLE 
	  BLANKTOP DEFAULTKEYBM DICTFILE EMODEKEYS FONTDIRECTORIES HCVKBD JAPANESEFONTS JAPANESEFONTS 
	  JDISPLAYFONTS JLISPINIT JMODEFLAG JMODEKEYS KANA10 KANA12 KANJI10 KANJI12 KANJIBITWIDTH 
	  KANJILOOKUPKEY INFDICT MAINDICT REALGRAMARRAY REALGRAMMAR ROMALIST SPECIALKEYS 
	  TOPLEVELPARSETREE VKBDW VKBDW)
)
(PUTPROPS JGP COPYRIGHT ("Xerox Corporation" 1982 1983 1984))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (2012 2407 (READBIGJFONTS 2022 . 2405)) (2476 31871 (ALPHACHARP 2486 . 2712) (
BLTDEFAULTKEY 2714 . 2965) (CENTERX 2967 . 3471) (CENTERY 3473 . 3772) (CONVERTTOPHONIC 3774 . 4110) (
CTENTRIES 4112 . 4245) (CVROMA 4247 . 4564) (DEALWITHHC 4566 . 6642) (DICTWORD 6644 . 7124) (DISKPAGE 
7126 . 7259) (FLASHAREA 7261 . 7512) (FLASHVKBDW 7514 . 7663) (FREQUENCY 7665 . 7835) (GREATERFREQ 
7837 . 8026) (HCMEMBER 8028 . 8294) (IFWECUT 8296 . 11059) (IFWESTRETCH 11061 . 12156) (INWD 12158 . 
12342) (JKANJILOOKUP 12344 . 13019) (JLISPINIT 13021 . 15448) (JRESETLINE 15450 . 15760) (JROMACHAR 
15762 . 16917) (JSHOWSTATE 16919 . 17324) (KANAFOR 17326 . 17626) (KANAP 17628 . 17822) (KEYFORCHAR 
17824 . 18356) (LOOKUPCHARS 18358 . 19531) (MAKEFOLLOWON 19533 . 20090) (MAKESOFTY 20092 . 20894) (
MAKEVKBDW 20896 . 21059) (NKANJI 21061 . 21190) (NODETOKANJICODELIST 21192 . 21579) (NPROCESS 21581 . 
21852) (OPENDICT 21854 . 22652) (PARTOFSPEECH 22654 . 22789) (PHONIC 22791 . 22921) (PICKHC 22923 . 
23434) (PICKHCKEYS 23436 . 24903) (PRUNESOFTIES 24905 . 26065) (REALLYADDKANJI 26067 . 26497) (RELADDR
 26499 . 26629) (RESETLOOKUP 26631 . 26793) (ROMAP 26795 . 27016) (SCANTABLE 27018 . 27311) (
SCANTABLE1 27313 . 27685) (SCORE 27687 . 28291) (SETJMODE 28293 . 28994) (SHOWHC 28996 . 29408) (
SHOWVKBD 29410 . 29554) (TERMTABLETOHCLIST 29556 . 30169) (TRAVERSETABLE 30171 . 30507) (TREELOOK 
30509 . 30658) (TYPEJAPANESE 30660 . 30930) (UNIQUIFY 30932 . 31869)))))
STOP