001 package org.maltparser.core.feature.function; 002 003 import org.maltparser.core.exception.MaltChainedException; 004 import org.maltparser.core.feature.value.FeatureValue; 005 import org.maltparser.core.symbol.SymbolTable; 006 /** 007 * 008 * 009 * @author Johan Hall 010 */ 011 public interface FeatureFunction extends Function { 012 /** 013 * Cause the feature function to update the cardinality of the feature value. 014 * 015 * @throws MaltChainedException 016 */ 017 public abstract void updateCardinality() throws MaltChainedException; 018 /** 019 * Returns the string representation of the integer <code>code</code> according to the feature function. 020 * 021 * @param code the integer representation of the symbol 022 * @return the string representation of the integer <code>code</code> according to the feature function. 023 * @throws MaltChainedException 024 */ 025 public abstract String getSymbol(int code) throws MaltChainedException; 026 /** 027 * Returns the integer representation of the string <code>symbol</code> according to the feature function. 028 * 029 * @param symbol the string representation of the symbol 030 * @return the integer representation of the string <code>symbol</code> according to the feature function. 031 * @throws MaltChainedException 032 */ 033 public abstract int getCode(String symbol) throws MaltChainedException; 034 /** 035 * Returns the symbol table used by the feature function. 036 * 037 * @return the symbol table used by the feature function. 038 */ 039 public abstract SymbolTable getSymbolTable(); 040 /** 041 * Returns the feature value 042 * 043 * @return the feature value 044 */ 045 public abstract FeatureValue getFeatureValue(); 046 }