|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.googlecode.whatswrong.TokenFilter
public class TokenFilter
A Tokenfilter removes certain properties from each token and removes tokens that do not contain certain property values. The filter also removes all edges that were connecting one or more removed tokens.
Constructor Summary | |
---|---|
TokenFilter()
Creates a new TokenFilter. |
Method Summary | |
---|---|
void |
addAllowedString(java.lang.String string)
Add a an allowed property value. |
void |
addForbiddenProperty(java.lang.String name)
Add a property that is forbidden so that the corresponding values are removed from each token. |
void |
clearAllowedStrings()
Remove all allowed strings. |
NLPInstance |
filter(NLPInstance original)
Filter an NLP instance by first filtering the tokens and then removing edges that have tokens which were filtered out. |
java.util.List<Token> |
filterTokens(java.util.Collection<Token> original)
Filter a set of tokens by removing property values and individual tokens according to the set of allowed strings and forbidden properties. |
java.util.Set<TokenProperty> |
getForbiddenTokenProperties()
Returns an unmodifiable view on the set of all allowed token properties. |
boolean |
isWholeWord()
Are tokens allowed only if they have a property value that equals one of the allowed strings or is it sufficient if one value contains one of the allowed strings. |
void |
removeForbiddenProperty(java.lang.String name)
Remove a property that is forbidden so that the corresponding values shown again. |
void |
setWholeWord(boolean wholeWord)
Should tokens be allowed only if they have a property value that equals one of the allowed strings or is it sufficient if one value contains one of the allowed strings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TokenFilter()
Method Detail |
---|
public boolean isWholeWord()
public void setWholeWord(boolean wholeWord)
wholeWord
- true iff tokens should be allowed based on exact matches with allowed strings, false otherwise.public void addAllowedString(java.lang.String string)
string
- the allowed property value.public void clearAllowedStrings()
public void addForbiddenProperty(java.lang.String name)
name
- the name of the property to forbid.public void removeForbiddenProperty(java.lang.String name)
name
- the name of the property to show again.public java.util.Set<TokenProperty> getForbiddenTokenProperties()
public java.util.List<Token> filterTokens(java.util.Collection<Token> original)
original
- the original set of tokens.
public NLPInstance filter(NLPInstance original)
filter
in interface NLPInstanceFilter
original
- the original nlp instance.
NLPInstanceFilter.filter(NLPInstance)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |