Lexical Tools

LVG - API

Java Class Api - LvgCmdApi( )

command line/text output

  • PreProcess:
    1. To instantiate an LvgCmdApi object
      String optionStr = new String("....");      // define the option string
      LvgCmdApi lvg = new LvgCmdApi(optionStr);   // instantiate the LvgCmdApi
      
      or
      
      String optionStr = new String("....");      // define the option string
      LvgCmdApi lvg = new LvgCmdApi( );           // instantiate the LvgCmdApi
      lvg.SetOption(optionStr);                   // set the option
      	
    2. To use other Api methods
      lvg.SetPromptStr(promptStr);               // Set the prompt string
      lvg.SetQuitStrList(quitStrList);           // Set quit string
      lvg.IsLegalOption( );                      // check if the option is legal
      lvg.PrintLvgHelp( );                       // Print out LVg help menu
      	
  • Process:
    1. In case of using Lvg mutate method with Lvg prompt function:
      lvg.ProcessLine(term);           // Mutate the input term with interface prompt
      	
    2. In case of using Lvg mutate method only:
      lvg.Mutate(term);                // Mutate the input term
      	
  • PostProcess:

    A CleanUp( ) method must be called after using LvgCmdApi to disconnect database and close persistant tries.

    lvg.CleanUp( );	                // Close database and files
    	

Two sample programs were developed to illustrate above usage.

  • LVG Command Line Interface Program - LvgCmdApiTest.java
  • LVG Text Based Interactive Interface Program - LvgTextInterface.java