Skip to content
jico edited this page Mar 31, 2011 · 2 revisions

Console

The Console is similar to a command-line utility for interacting with the Language Processor (LP), along with its supporting Engines (Number, Callsign, Instruction). It's primarily used for quickly testing LP or Engine methods against passed strings.

Using the console

When you run the Console, you should see: Console started. "exit" to quit. >>

You can then invoke predefined methods on strings.

Methods

Method invocation syntax is: method: parameter

The parameter is typically a String. Methods are case-insensitive.

The currently available methods are:

  • parse Main purpose method. Takes an ATC command string and returns an ATCCommand object containing the recognized recipient, type, and parameter. For example: parse: Cactus fourteen fifty descend and maintain flight level three three zero The above returns an ATCCommand object. You can then retrieve the information in xml format through the object toString method, which produces: AWE1450altitudeFL330
  • toNum Accepts a "text" number and outputs the numeric representation. For example: toNum: thirty three hundred Outputs: 3300
  • identify Accepts a telephony callsign and outputs the three-letter designator. For example: identify: Cactus Outputs: AWE
  • params Identifies the parameters in a command string. For example: params: Cactus fourteen fifty descend and maintain flight level three three zero Outputs: phrase[Cactus fourteen fifty descend and maintain flight level three three zero] type[altitude] param[FL330]
  • instruction Checks if the passed string is a valid instruction. Returns the index in the xml library if the passed string is valid. Returns -1 otherwise. (Essentially the isInstruction() method of the InstructionEngine class).

Clone this wiki locally