ucot.parser
Class SimpleParser

java.lang.Object
  extended by ucot.ModuleProperties
      extended by ucot.parser.SimpleParser
All Implemented Interfaces:
ModulePropertyInterface, ParserInterface

public class SimpleParser
extends ModuleProperties
implements ParserInterface

Simple parser. Expects that the usecase steps consists of three parts separated with ",". First part is noun, second is verb and the third is noun.

Author:
pajumasu

Field Summary
 
Fields inherited from class ucot.ModuleProperties
properties, propertiesURL
 
Fields inherited from interface ucot.parser.ParserInterface
NOUN, OBJECT, SUBJECT, VERB
 
Constructor Summary
SimpleParser()
           
 
Method Summary
 void applyProperties()
          Applies current properties for the module.
 java.lang.String getName()
          Returns adapter's name.
 java.util.Properties loadDefaultProperties()
          Method which returns the factory default properties for the module.
 ParsedData parse(UseCase useCase)
          Parses given usecase and returns parsed data as a ParsedData object.
 java.lang.String toString()
           
 
Methods inherited from class ucot.ModuleProperties
getProperties, loadProperties, saveProperties, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ucot.ModulePropertyInterface
getProperties, loadProperties, saveProperties, setProperties
 

Constructor Detail

SimpleParser

public SimpleParser()
Method Detail

parse

public ParsedData parse(UseCase useCase)
Description copied from interface: ParserInterface
Parses given usecase and returns parsed data as a ParsedData object.

Specified by:
parse in interface ParserInterface
Parameters:
useCase - Use case to parse.
Returns:
Parsed data as a ParsedData object.

getName

public java.lang.String getName()
Description copied from interface: ParserInterface
Returns adapter's name.

Specified by:
getName in interface ParserInterface
Returns:
Adapter's name.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

loadDefaultProperties

public java.util.Properties loadDefaultProperties()
Description copied from interface: ModulePropertyInterface

Method which returns the factory default properties for the module.

Specified by:
loadDefaultProperties in interface ModulePropertyInterface
Overrides:
loadDefaultProperties in class ModuleProperties
Returns:
Default properties.
See Also:
ModulePropertyInterface.loadDefaultProperties()

applyProperties

public void applyProperties()
                     throws BadPropertyValueException
Description copied from interface: ModulePropertyInterface

Applies current properties for the module.

Specified by:
applyProperties in interface ModulePropertyInterface
Overrides:
applyProperties in class ModuleProperties
Throws:
BadPropertyValueException - In this case exception is thrown only if either the given parser or heuristic does not exist.
See Also:
ModulePropertyInterface.applyProperties()