% (C)1992 Institute for New Generation Computer Technology
% $BG[IU$=$NB>$O(BCOPYRIGHT$B%U%!%$%k$r;2>H$7$F2<$5$$(B
% (See COPYRIGHT file for detailed information.)

1. What is LAX system?

(1) Overview
     A total supporting tool for the development of morphological
   analyzer and its dictionary.

(2) Features

  <Morphological analyzing program>
    $B!&(BOutputs all interpretation at one time as a graph stack structure
    $B!&(BRecognizes unknown words and location of failure point in
      analysis easliy
    $B!&(BCan be used as a server program on UNIX system

  <Dictionary developtin environment>
    $B!&(BResults of the analysis including ambiguity and occurrence of
      unknown words are displayed effectively
    $B!&(BRegistration and deletion of entries,and revision of definition
      for categories can be executed instantly for the intermediate
      dictionary

(3) Function
    This system provides a common development environment of
   morphological analyzer and its dictionary for NLP system developer
   and enables them to get morphological analyzer they need easily.
    In this sytem, user describe a morphological dictionary first, in
   which morphological categories with their connection information
   and morphemes of each category should be defined. Next, the user
   translate this dictionary into an intermediate dictionary, with
   which one can perform analyzing test, modify the attributes of 
   categories and add new entries instantly. This analyzer can be 
   combined with other applications on CESP.
     Moreover, this system can  transform the analyzer into a server
   program on UNIX system. Using the server combiend with various
   applications developed on UNIX system, one can make a NLP system
   efficiently, which would be very practical because a server program
   can be accessed by many people simultaneously. This server program
   performs not only morphological analysis but also revision of
   intermediate dictionary such as addition of entries. Then, one can
   take advantage of this function to build a flexible application. 

2. Environment

     It needs the following system environment to run the LAX system.
         Maching:UNIX machine
         Environment: UNIX,CESP
         Language: CESP
         Source Code : 0.3MB (without dictionary)

3. List of Programs

     macro.esp       Macro to cover the difference between ESP and CESP
     lax_macro.esp   Macro for LAX system

  <_simpos> Programs to cover the difference between ESP and CESP
     bfiles.esp
     e_etring.esp
     frozen_term.esp
     lax_dir.esp
     lax_name.esp
     ltb_unix.esp
     name.esp
     pathname.esp
     stdiobuf.esp
     str.esp
  <_source> Programs for LAX system
     cat.esp
     defcat.esp
     dict.esp
     ent.esp
     entr_to_file.esp
     fea.esp
     file _io.esp
     fixrec_file.esp
     flex_file.esp
     hash_files.esp
     id.esp
     imf_dic.esp
     imf_log.esp
     lax_files.esp
     laxdisp.esp
     lex_inter.esp
     mdif.esp
     mesenger.esp
     rev.esp
     select.esp
     sem.esp
     sem_inter.esp
     std_empty.esp
     trans.esp
     trie.esp
  <OBJECT> Programs for LAX dictionary object
     convert.esp
     frame.esp
     laxout.esp
     select.esp
     sem_type.esp
  <_unix> Programs for using as UNIX server
     c.esp
     cs.esp
     (*)lax_add
     (*)lax_analyze
     (*)lax_cat
     (*)lax_close
     (*)lax_inq
     (*)lax_trans
  <_demo> Example programs for LAX interface
     c.esp
     cs.esp
     demo.esp
     demo_ana.esp
     morph_disp.esp

   (*) stands for UNIX c-shell script file.
   Most of these files include a Chinese character code.
   We use EUC code as a Chinese character code, because CESP uses it.

4. Before the Installation

    <Directory>
      MDIF   : Intermediate dictionary
      SOURCE : Morphological dictionary
      OBJECT : Utitlity for dictionary object
      _simpos: Program for difference between ESP & CESP
      _source: Program for LAX system
      _unix  : Program for LAX system
      _demo  : Example program for LAX interface

    <Directory for Dictionary>
       $SDIR: Directory for Morphological dictionary
       $MDIR: Directory for Intermediate dictionary
       $DICT: Name of dictionary
    
      <Morphological dictionary>
        $SDIR/$DICT/$DICT.lax (main dictionary)
                       :      (external dictionary or file for entries)
      <Intermediate dictionary>
           (n shows number of dictionaries)
        $MDIR/$DICT/cat (for category)
                    cid (for connected feature)
                    ent_i(for entry)(i= 1$B!A(Bn)
                    fea (for feature)
                    rev (for index)
                    sav (for MDIF information)
                    sem (for semantics rule)
                    sid (for morphological feature)
                    trie_i(for TRIE structure)(i=1$B!A(Bn)
                    upd (for update information)

     And, we use follow packages.
    <Package>
      laxsys : for LAX system programs
      laxobj : for LAX dictionary objects
      lax    : for common utility

    (See also "INSTALL")

5. Methods

$B!y(BIntermediate dictionary
 *Make
   :start(Class,Window,Dictname,SrcDir,MdifDir,^LEX)
         Class   : laxsys##lax_trans
         Window  : Window object with standard io module
         Dictname: Dictionary Name(DataType: 2 bytes string)
         SrcDir  : Direcotry includes Morpological dictionary
         MdifDir : Direcotry includes Intermediate dictionary
         LEX     : Instance of Intermediate dictionary
 *close
   :close(LEX)
 *open
   :open(Class,^LEX,Dictname,MdifDir)
         Class   : laxsys##imf_dictionary
         LEX     : Object of Intermediate dictionary
         Dictname: Dictionary Name (string)
         MdifDir : Directory that LAX will make Itermediate dictionary in
        
$B!y(Banalyze
 *lexical analysis
   :lexs(Class,Sentence,^LexResult,LEX)
         Class   : laxsys##lex_interpreter
         Sentence: sentence(string,2bytes)
         LexResult  : Result of lexical analysis
         LEX     : Object of Intermediate dictionary
 *constracting semantics
   :sems(Class,LexResult,^SemResult,SemType,LEX)
   :sems(Class,LexResult,^SemResult,LEX)
         Class   : laxsys##lex_interpreter
         LexResult  : Result of lexical analysis
         SemResult  : Result of constracting semantics
         SemType    : Class object of SEM Type
            (defualt is laxobj##sem_type)
         LEX     : Object of Intermediate dictionary
 
$B!y(Bediting module of intermediate dictionary
 * catalogue of category
   :get_categoryes(LEX,^CATL)
         LEX     : Intermediate dicationary 
         CATL    : List of category's name (atom)
 * catalogue of entries in one category
   :inquiry_1cat(LEX,CATN,^MORL)
         LEX     : Object of Intermediate dictionary
         CATN    : Category's name (atom)
         MORL    : List of entries (Surface(Token))
 * feature of a category
   :get_catname_inf(LEX,CATN,^Inf,^No)
         LEX     : Object of Intermediate dictionary
         CATN    : Category's name (atom)
         Inf     : {SidNo,CidNo,SemNo,_}
         No      : Category ID
   :get_sid(LEX,SidNo,^SID)
   :get_cid(LEX,CidNo,^CID)
   :get_sem(LEX,SemNo,^SEM)
         LEX     : Object of Intermediate dictionary
         SidNo   : ID of morpheme feature
         SID     : morpheme feature
         CidNo   : ID of connected morpheme feature
         CID     : connected morpheme feature
         SemNo   : ID of semantics constructing rule
         SEM     : semantics constructing rule
 * information of a morpheme
   :inquiry_mors(LEX,Sur,^Catinf,^No)
         LEX     : Object of Intermediate dictionary
         Sur     : surface, or surface(token)
         Catinf  : [surface(token),CategoryID,pointer]
         No      : ID of entry
   :get_entrys(LEX,NoList,^MORL)
         LEX     : Object of Intermediate dictionary
         NoList  : List of entry IDs
         MORL    : List of morpheme(surface(token))
 *adding entry
   :add_entry_log(LEX,{Sur,Cat},^Result)
         LEX     : Object of Intermediate dictionary
         Sur     : surface, or surface(token)
         Cat     : category's name
         Result  : success, fail,double,no_category
 *replacing category
   :move_entry_log(LEX,{Sur,Cat1,Cat2},^Result)
         LEX     : Object of Intermediate dictionary
         Sur     : surface, or surface(token)
         Cat1    : name of original category
         Cat2    : name of alter category
         Result  : success,not_found,fail,double
 *removing entry
   :remove_entry_log(LEX,{Sur,Cat},^Result)
         LEX     : Object of Intermediate dictionary
         Sur     : surface, or surface(token)
         Cat     : category's name
         Result  : success,not_found,fail
 *updating morpheme dictionary
   :update(LEX,W,^Result)
   :update(LEX,^Result)
         LEX     : Object of Intermediate dictionary
         W       : Window object with standard io module
         Result  : non,update
     Update the morpheme dictionary accoring to the intermediate dictionary.
     Updating object is only following conditional entry.
             the entry defined in entry's file.
             the category that the entry belongs to has only one entry's file.
             no entry is defined in the same file of the category.

     (how to update)
       1. adding entry to the entry's file
       2. remaking entry's file

A.appendix
$B!y(Bexample
% translate
??- :start(#laxsys##lax_trans,standard#message,"kishimen","/home/yoneda/lax/SOURCE/kishimen","/home/yoneda/lax/MDIF",LEX).
  Translating start ...

MATRIX  : [$BGI@8(B]
DICT_NUM: 2
ENT_NUM : 100
WORD_LEN: 12
CAT_LEN : 12
FEA_LEN : 10
FEA_NUM : 224
UNDEF_CAT:$BL>;l(B
$BL>;l(B/
include:"noun".
$B3J=u;l(B/
include:"affix".
$BF0;l(B/
include:"verb".
$BFC<l5-9f(B/$B7AMF;l(B/
include:"adj".

making file end.
making TRIE 21end.
 word max    :5
 category max:4
 feature max :2
(40 entries. 5 categories.)
LEX = $imf_dictionary
??- 

%close of intermediate dictionary
??- :close(LEX).


%open of intermediate dictionary
??- :open(#laxsys##imf_dictionary,LEX,"kishimen","/home/yoneda/lax/MDIF").

LEX = $imf_dictionary
??- 
%lexical analysis
??- :lexs(#laxsys##lex_interpreter,gs#"$B$-$7$a$s$r?)$Y$k(B",R,LEX).
:lexs(#laxsys##lex_interpreter,gs#"$B$-$7$a$s$r?)$Y$k(B",R,LEX).

LEX = $imf_dictionary
R = {0,[{[$B$-$7$a$s(B($B$-$7$a$s(B,$BL>;l(B,end,$BJ8@a(B)],[1],5,1},{[$B$-$7(B($B$-$7(B,$B3J=u;l(B,end,$BJ8@a(B)],[2],3,2}|A],B,[{[$B$a$s(B($B$a$s(B,$BL>;l(B,end,$BJ8@a(B)],[1],5,3}|C],D, .. }

??- :lexs(#laxsys##lex_interpreter,gs#"$BKL3$F;$GLS3*$r?)$Y$k!#(B",R,LEX).

LEX = $imf_dictionary
R = {0,[{[$BKL3$F;(B($BKL3$F;(B,$BL>;l(B,end,$BJ8@a(B)],[1],4,1}|A],B,C,[{[$B$G(B($B$G(B,$B3J=u;l(B,end,$BJ8@a(B)],[2],5,2}|D], .. }
*$B0UL#9=@.(B*
??- :sems(#laxsys##sem_interpreter,R,RR,#laxobj##kishi_sem_type,LEX).

LEX = $imf_dictionary
R = {0,[{[$B$-$7$a$s(B($B$-$7$a$s(B,$BL>;l(B,end,$BJ8@a(B)],[1],5,1}],A,B,C,[{[$B$r(B($B$r(B,$B3J=u;l(B,end,$BJ8@a(B)],[2],6,2}],[{[$B?)$Y$k(B($B?)$Y$k(B,$BF0;l(B,end,$BJ8@a(B)],[2],D,3}],E,F}
RR = {G,[{[$B$-$7$a$s(B($B$-$7$a$s(B,$BL>;l(B,end,$BJ8@a(B)],noun($B$-$7$a$s(B),5,1}],H,I,J,[{[$B$r(B($B$r(B,$B3J=u;l(B,end,$BJ8@a(B)],p($B$r(B),6,2}],[{[$B?)$Y$k(B($B?)$Y$k(B,$BF0;l(B,end,$BJ8@a(B)],verb($B?)$Y$k(B([],[])),D,3}],K,L}
??- :get_categorys(LEX,CATL).
:get_categorys(LEX,CATL).

CATL = [$BL>;l(B,$B3J=u;l(B,$BF0;l(B,$BFC<l5-9f(B,$B7AMF;l(B]
LEX = $imf_dictionary


??- :add_entry_log(LEX,{$B$&$I$s(B,$BL>;l(B},_R).
LEX = $imf_dictionary
_R = success

??- :inquiry_mors(LEX,$B$&$I$s(B,_CCC,_NNN).
LEX = $imf_dictionary
_CCC = [{$B$&$I$s(B($B$&$I$s(B),0,0}]
_NNN = [17]


