Package net.didion.jwnl.dictionary.morph
Class TokenizerOperation
- java.lang.Object
-
- net.didion.jwnl.dictionary.morph.AbstractDelegatingOperation
-
- net.didion.jwnl.dictionary.morph.TokenizerOperation
-
- All Implemented Interfaces:
Operation,Createable
public class TokenizerOperation extends AbstractDelegatingOperation
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String[]_delimitersstatic java.lang.StringDELIMITERSParameter list that determines the delimiters this operation will use to concatanate tokens.static java.lang.StringPHRASE_OPERATIONSParameter that determines the operations this operation will perform on the phrases.static java.lang.StringTOKEN_OPERATIONSParameter that determines the operations this operation will perform on the tokens.
-
Constructor Summary
Constructors Constructor Description TokenizerOperation()TokenizerOperation(java.lang.String[] delimiters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexecute(POS pos, java.lang.String lemma, BaseFormSet forms)Execute the operation.protected AbstractDelegatingOperationgetInstance(java.util.Map params)protected java.lang.String[]getKeys()private booleantryAllCombinations(POS pos, java.lang.String[] tokens, java.lang.String delimiter, BaseFormSet forms)private booleantryAllCombinations(POS pos, BaseFormSet[] tokenForms, int startIndex, int endIndex, BaseFormSet forms)-
Methods inherited from class net.didion.jwnl.dictionary.morph.AbstractDelegatingOperation
addDelegate, create, delegate, hasDelegate
-
-
-
-
Field Detail
-
TOKEN_OPERATIONS
public static final java.lang.String TOKEN_OPERATIONS
Parameter that determines the operations this operation will perform on the tokens.- See Also:
- Constant Field Values
-
PHRASE_OPERATIONS
public static final java.lang.String PHRASE_OPERATIONS
Parameter that determines the operations this operation will perform on the phrases.- See Also:
- Constant Field Values
-
DELIMITERS
public static final java.lang.String DELIMITERS
Parameter list that determines the delimiters this operation will use to concatanate tokens.- See Also:
- Constant Field Values
-
_delimiters
private java.lang.String[] _delimiters
-
-
Method Detail
-
getInstance
protected AbstractDelegatingOperation getInstance(java.util.Map params) throws JWNLException
- Specified by:
getInstancein classAbstractDelegatingOperation- Throws:
JWNLException
-
getKeys
protected java.lang.String[] getKeys()
- Specified by:
getKeysin classAbstractDelegatingOperation
-
execute
public boolean execute(POS pos, java.lang.String lemma, BaseFormSet forms) throws JWNLException
Description copied from interface:OperationExecute the operation.forms- BaseFormSet to which all discovered base forms should be added.- Returns:
- true if at least one base form was discovered by the operation and added to baseForms.
- Throws:
JWNLException
-
tryAllCombinations
private boolean tryAllCombinations(POS pos, BaseFormSet[] tokenForms, int startIndex, int endIndex, BaseFormSet forms) throws JWNLException
- Throws:
JWNLException
-
tryAllCombinations
private boolean tryAllCombinations(POS pos, java.lang.String[] tokens, java.lang.String delimiter, BaseFormSet forms) throws JWNLException
- Throws:
JWNLException
-
-