MaltParser 1.4.1

org.maltparser.core.syntaxgraph.feature
Class DistanceFeature

java.lang.Object
  extended by org.maltparser.core.syntaxgraph.feature.DistanceFeature
All Implemented Interfaces:
FeatureFunction, Function

public class DistanceFeature
extends Object
implements FeatureFunction


Field Summary
protected  AddressFunction addressFunction1
           
protected  AddressFunction addressFunction2
           
protected  SingleFeatureValue featureValue
           
protected  Map<Integer,String> normalization
           
protected  String normalizationString
           
protected  SymbolTable table
           
protected  SymbolTableHandler tableHandler
           
 
Constructor Summary
DistanceFeature(SymbolTableHandler tableHandler)
           
 
Method Summary
 boolean equals(Object obj)
           
 AddressFunction getAddressFunction1()
          Returns the address function 1 (argument 1)
 AddressFunction getAddressFunction2()
          Returns the address function 2 (argument 2)
 int getCode(String symbol)
          Returns the integer representation of the string symbol according to the distance feature function.
 FeatureValue getFeatureValue()
          Returns the feature value
 Class<?>[] getParameterTypes()
          Returns an array of class types used by the feature extraction system to invoke initialize with correct arguments.
 String getSymbol(int code)
          Returns the string representation of the integer code according to the distance feature function.
 SymbolTable getSymbolTable()
          Returns the symbol table used by the distance feature function
 SymbolTableHandler getTableHandler()
          Returns symbol table handler
 int hashCode()
           
 void initialize(Object[] arguments)
          Initialize the distance feature function
 void setAddressFunction1(AddressFunction addressFunction1)
          Sets the address function 1 (argument 1)
 void setAddressFunction2(AddressFunction addressFunction2)
          Sets the address function 2 (argument 2)
 void setSymbolTable(SymbolTable table)
          Sets the symbol table used by the distance feature function
 void setTableHandler(SymbolTableHandler tableHandler)
          Sets the symbol table handler
 String toString()
           
 void update()
          Cause the feature function to update the feature value.
 void updateCardinality()
          Cause the distance feature function to update the cardinality of the feature value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

addressFunction1

protected AddressFunction addressFunction1

addressFunction2

protected AddressFunction addressFunction2

tableHandler

protected SymbolTableHandler tableHandler

table

protected SymbolTable table

featureValue

protected SingleFeatureValue featureValue

normalizationString

protected String normalizationString

normalization

protected Map<Integer,String> normalization
Constructor Detail

DistanceFeature

public DistanceFeature(SymbolTableHandler tableHandler)
                throws MaltChainedException
Throws:
MaltChainedException
Method Detail

initialize

public void initialize(Object[] arguments)
                throws MaltChainedException
Initialize the distance feature function

Specified by:
initialize in interface Function
Parameters:
arguments - an array of arguments with the type returned by getParameterTypes()
Throws:
MaltChainedException

getParameterTypes

public Class<?>[] getParameterTypes()
Returns an array of class types used by the feature extraction system to invoke initialize with correct arguments.

Specified by:
getParameterTypes in interface Function
Returns:
an array of class types

getSymbol

public String getSymbol(int code)
                 throws MaltChainedException
Returns the string representation of the integer code according to the distance feature function.

Specified by:
getSymbol in interface FeatureFunction
Parameters:
code - the integer representation of the symbol
Returns:
the string representation of the integer code according to the distance feature function.
Throws:
MaltChainedException

getCode

public int getCode(String symbol)
            throws MaltChainedException
Returns the integer representation of the string symbol according to the distance feature function.

Specified by:
getCode in interface FeatureFunction
Parameters:
symbol - the string representation of the symbol
Returns:
the integer representation of the string symbol according to the distance feature function.
Throws:
MaltChainedException

updateCardinality

public void updateCardinality()
Cause the distance feature function to update the cardinality of the feature value.

Specified by:
updateCardinality in interface FeatureFunction
Throws:
MaltChainedException

update

public void update()
            throws MaltChainedException
Cause the feature function to update the feature value.

Specified by:
update in interface Function
Throws:
MaltChainedException

getFeatureValue

public FeatureValue getFeatureValue()
Returns the feature value

Specified by:
getFeatureValue in interface FeatureFunction
Returns:
the feature value

getSymbolTable

public SymbolTable getSymbolTable()
Returns the symbol table used by the distance feature function

Specified by:
getSymbolTable in interface FeatureFunction
Returns:
the symbol table used by the distance feature function

getAddressFunction1

public AddressFunction getAddressFunction1()
Returns the address function 1 (argument 1)

Returns:
the address function 1 (argument 1)

setAddressFunction1

public void setAddressFunction1(AddressFunction addressFunction1)
Sets the address function 1 (argument 1)

Parameters:
addressFunction1 - a address function 1 (argument 1)

getAddressFunction2

public AddressFunction getAddressFunction2()
Returns the address function 2 (argument 2)

Returns:
the address function 1 (argument 2)

setAddressFunction2

public void setAddressFunction2(AddressFunction addressFunction2)
Sets the address function 2 (argument 2)

Parameters:
addressFunction2 - a address function 2 (argument 2)

getTableHandler

public SymbolTableHandler getTableHandler()
Returns symbol table handler

Returns:
a symbol table handler

setTableHandler

public void setTableHandler(SymbolTableHandler tableHandler)
Sets the symbol table handler

Parameters:
tableHandler - a symbol table handler

setSymbolTable

public void setSymbolTable(SymbolTable table)
Sets the symbol table used by the distance feature function

Parameters:
table -

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

MaltParser 1.4.1

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