MaltParser 1.4.1

org.maltparser.core.options
Class OptionDescriptions

java.lang.Object
  extended by org.maltparser.core.options.OptionDescriptions

public class OptionDescriptions
extends Object

Organizes all the option descriptions. Option descriptions can be loaded from the application data /appdata/options.xml, but also from a plugin option description file (always with the name plugin.xml).

Since:
1.0
Author:
Johan Hall

Constructor Summary
OptionDescriptions()
          Creates the Option Descriptions
 
Method Summary
 void generateMaps()
          Creates several option maps for fast access to individual options.
 Option getOption(String optionflag)
          Returns an option based on the option flag
 Option getOption(String optiongroup, String optionname)
          Returns an option based on the option name and/or the option group name
 Collection<Option> getOptionGroupList(String groupname)
          Returns a collection of option that are member of an option group
 TreeSet<String> getOptionGroupNameSet()
          Return a sorted set of option group names
 Set<Option> getSaveOptionSet()
          Returns a set of option that are marked as SAVEOPTION
 void parseOptionDescriptionXMLfile(URL url)
          Parse a XML file that contains the options used for controlling the application.
 String toString()
           
 String toStringMaps()
          Returns a string representation that contains printable information of several options maps
 String toStringOptionGroup(String groupname)
          Returns a string representation of a option group without the option group name in the string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OptionDescriptions

public OptionDescriptions()
Creates the Option Descriptions

Method Detail

getOption

public Option getOption(String optiongroup,
                        String optionname)
                 throws MaltChainedException
Returns an option based on the option name and/or the option group name

Parameters:
optiongroup - the name of the option group
optionname - the option name
Returns:
an option based on the option name and/or the option group name
Throws:
MaltChainedException

getOption

public Option getOption(String optionflag)
                 throws MaltChainedException
Returns an option based on the option flag

Parameters:
optionflag - the option flag
Returns:
an option based on the option flag
Throws:
MaltChainedException

getSaveOptionSet

public Set<Option> getSaveOptionSet()
Returns a set of option that are marked as SAVEOPTION

Returns:
a set of option that are marked as SAVEOPTION

getOptionGroupNameSet

public TreeSet<String> getOptionGroupNameSet()
Return a sorted set of option group names

Returns:
a sorted set of option group names

getOptionGroupList

public Collection<Option> getOptionGroupList(String groupname)
Returns a collection of option that are member of an option group

Parameters:
groupname - the name of the option group
Returns:
a collection of option that are member of an option group

parseOptionDescriptionXMLfile

public void parseOptionDescriptionXMLfile(URL url)
                                   throws MaltChainedException
Parse a XML file that contains the options used for controlling the application. The method calls the parseOptionGroups to parse the set of option groups in the DOM tree.

Parameters:
url - The path to a XML file that explains the options used in the application.
Throws:
OptionException
MaltChainedException

generateMaps

public void generateMaps()
                  throws MaltChainedException
Creates several option maps for fast access to individual options.

Throws:
OptionException
MaltChainedException

toStringMaps

public String toStringMaps()
Returns a string representation that contains printable information of several options maps

Returns:
a string representation that contains printable information of several options maps

toStringOptionGroup

public String toStringOptionGroup(String groupname)
Returns a string representation of a option group without the option group name in the string.

Parameters:
groupname - The option group name
Returns:
a string representation of a option group

toString

public String toString()
Overrides:
toString in class Object

MaltParser 1.4.1

Copyright 2007-2010 Johan Hall, Jens Nilsson and Joakim Nivre.