GATE
Version 3.1-2270

gate.creole.morph
Class ParsingFunctions

java.lang.Object
  extended by gate.creole.morph.ParsingFunctions

public class ParsingFunctions
extends Object

Title: ParsingFunctions.java

Description: This class implements all static methods, which can be used for various purposes, like converting rules defined by users into the regular expressions, finding varilable type from its value type etc.


Constructor Summary
ParsingFunctions()
          Default Constructor
 
Method Summary
static String convertToRegExp(String line, Storage storage)
          This method convert the expression which has been entered by the user in the .rul file (i.e. rules defined by the user), into the expression which are recognized by the regular expression Patterns
static int findVariableType(String varValue)
          This method takes the value of the variable and tells the user what type of value is from CharacterRange, CharacterSet, StringSet
static boolean isBoolean(String value)
          This method checks for the string if it is a valid integer value
static boolean isInteger(String value)
          This method checks for the string if it is a valid integer value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParsingFunctions

public ParsingFunctions()
Default Constructor

Method Detail

findVariableType

public static int findVariableType(String varValue)
This method takes the value of the variable and tells the user what type of value is from CharacterRange, CharacterSet, StringSet

Parameters:
varValue - value for which to find the variable type
Returns:
ERROR_CODE = -4, STRING_SET_CODE = 0, CHARACTER_RANGE_CODE = 1, CHARACTER_SET_CODE = 2;

isInteger

public static boolean isInteger(String value)
This method checks for the string if it is a valid integer value

Parameters:
value - value to be checked for its type to be integer
Returns:
if value is an integer returns true, false otherwise

isBoolean

public static boolean isBoolean(String value)
This method checks for the string if it is a valid integer value

Parameters:
value - value to be checked for its type to be integer
Returns:
if value is an integer returns true, false otherwise

convertToRegExp

public static String convertToRegExp(String line,
                                     Storage storage)
This method convert the expression which has been entered by the user in the .rul file (i.e. rules defined by the user), into the expression which are recognized by the regular expression Patterns

Parameters:
line - rule defined by the user
storage - this method internally requires values of the used variables to replace the them with their values in the expression
Returns:
newly generated regular expression

GATE
Version 3.1-2270