Pep 0.4 API Documentation

edu.osu.ling.pep
Enum ParserOption

java.lang.Object
  extended by java.lang.Enum<ParserOption>
      extended by edu.osu.ling.pep.ParserOption
All Implemented Interfaces:
Serializable, Comparable<ParserOption>

public enum ParserOption
extends Enum<ParserOption>

An option used to configure an Earley parser.

Version:
$LastChangedRevision: 556 $
Author:
Scott Martin

Enum Constant Summary
IGNORE_TERMINAL_CASE
          Signals whether an Earley parser should ignore the case of terminal tokens.
PREDICT_FOR_PRETERMINALS
          Whether the Earley parser should make predictions based on pre-terminal categories.
 
Method Summary
 Boolean getDefaultValue()
          Gets the default value for this option.
 String toString()
          Gets a string representation of this Earley parser option.
static ParserOption valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ParserOption[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

IGNORE_TERMINAL_CASE

public static final ParserOption IGNORE_TERMINAL_CASE
Signals whether an Earley parser should ignore the case of terminal tokens. If this is set to true, the tokens John and john will be treated as equivalent, but they will be treated as distinct tokens if this is set to false.

Default value: Boolean.FALSE.

Since:
0.2

PREDICT_FOR_PRETERMINALS

public static final ParserOption PREDICT_FOR_PRETERMINALS
Whether the Earley parser should make predictions based on pre-terminal categories. If this is true, the parser will make a prediction for every grammar entry where the left side is a category it has predicted for and the right side is a terminal. For example, in a grammar where the pre-terminal category N can expand to dog, boy, or man and a rule exists where NP expands to Det N, the parser will predict whenever it is able to predict NP (or any other rule that can expand to N).

Alternatively, if this option is specified as false, the parser will only complete (as opposed to predict) for those terminals it actually encounters in the input string, instead of predicting for every possible terminal.

Default value: Boolean.FALSE.

Method Detail

getDefaultValue

public Boolean getDefaultValue()
Gets the default value for this option.


toString

public String toString()
Gets a string representation of this Earley parser option.

Overrides:
toString in class Enum<ParserOption>
Returns:
OPTION_NAME=option default value

valueOf

public static ParserOption valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name

values

public static final ParserOption[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(ParserOption c : ParserOption.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

Pep: Pep is an Earley parser

Pep API Documentation, Copyright © 2007 Scott Martin

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the overview file.