edu.northwestern.at.morphadorner.tools.lgparser

## Class LGParser

- java.lang.Object
- - edu.northwestern.at.morphadorner.tools.lgparser.LGParser

-     public class LGParser
      extends java.lang.Object

  Link grammar parser driver.

  Usage:

  >       java edu.northwestern.at.morphadorner.tools.lgparser.LGParser lgparserdatadirectory "sentence text to parse"

  where lgparserdatadirectory is a directory containing link grammar parser data files and "sentence to parse" is the text of the sentence to parse.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.lang.String` | `defaultDataDirectory` Data file directory.
    `protected static Dictionary` | `dictionary` Parser dictionary.
    `protected ParseOptions` | `parseOptions` Parser options.
    `protected Sentence` | `sentence` Sentence to parse.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LGParser()` Create a linkage grammar parser.
    `LGParser(int maxLinkage, int maxParseTime)` Create a linkage grammar parser.
    `LGParser(java.lang.String dataDirectory)` Create a linkage grammar parser.
    `LGParser(java.lang.String dataDirectory, int maxLinkage, int maxParseTime)` Create a linkage grammar parser.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static java.lang.String` | `fixOutput(java.lang.String s)` Fix the output generated by the parser for presentation.
    `Linkage` | `getLinkage(int index)` Get a linkage from a parsed sentence.
    `static void` | `main(java.lang.String[] args)` Main program.
    `Sentence` | `parse(java.lang.String s)` Parse sentence text.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### dictionary

          protected static Dictionary dictionary

      Parser dictionary.

    - #### parseOptions

          protected ParseOptions parseOptions

      Parser options.

    - #### sentence

          protected Sentence sentence

      Sentence to parse.

    - #### defaultDataDirectory

          protected static java.lang.String defaultDataDirectory

      Data file directory.

  - ### Constructor Detail

    - #### LGParser

          public LGParser()

      Create a linkage grammar parser.

    - #### LGParser

          public LGParser(java.lang.String dataDirectory)

      Create a linkage grammar parser.
      Parameters:
        `dataDirectory` - The data directory.

    - #### LGParser

          public LGParser(int maxLinkage,
                  int maxParseTime)

      Create a linkage grammar parser.
      Parameters:
        `maxLinkage` - Maximum number of linkages.
        `maxParseTime` - Maximum parse time in seconds.

    - #### LGParser

          public LGParser(java.lang.String dataDirectory,
                  int maxLinkage,
                  int maxParseTime)

      Create a linkage grammar parser.
      Parameters:
        `dataDirectory` - The data directory.
        `maxLinkage` - Maximum number of linkages.
        `maxParseTime` - Maximum parse time in seconds.

  - ### Method Detail

    - #### getLinkage

          public Linkage getLinkage(int index)

      Get a linkage from a parsed sentence.
      Parameters:
        `index` - The index of the linkage to return.
      Returns:
        The linkage at the specified index.

    - #### parse

          public Sentence parse(java.lang.String s)

      Parse sentence text.
      Parameters:
        `s` - Sentence text to parse.
      Returns:
        Parse sentence.

    - #### main

          public static void main(java.lang.String[] args)

      Main program.
      Parameters:
        `args` - Command line arguments.

    - #### fixOutput

          protected static java.lang.String fixOutput(java.lang.String s)

      Fix the output generated by the parser for presentation.
      Parameters:
        `s` - Output generated by parser.
      Returns:
        Corrected output.