Package org.carrot2.language
Class TokenTypeUtils
java.lang.Object
org.carrot2.language.TokenTypeUtils
public final class TokenTypeUtils extends Object
Utility methods for working with
Tokenizer attributes.-
Method Summary
Modifier and Type Method Description static booleanisCommon(int flag)ReturntrueifTokenizer.TF_COMMON_WORDis set.static booleanisDocumentSeparator(int type)Returnstrueif the given type hasTokenizer.TF_SEPARATOR_DOCUMENTset.static booleanisFieldSeparator(int type)Returnstrueif the given type hasTokenizer.TF_SEPARATOR_FIELDset.static booleanisInQuery(int flag)ReturntrueifTokenizer.TF_QUERY_WORDis set.static booleanisTerminator(int type)Returnstrueif the given type hasTokenizer.TF_TERMINATORset.static intmaskType(int rawType)Mask the given raw token type and leave just the token type bits.
-
Method Details
-
maskType
public static int maskType(int rawType)Mask the given raw token type and leave just the token type bits. -
isDocumentSeparator
public static boolean isDocumentSeparator(int type)Returnstrueif the given type hasTokenizer.TF_SEPARATOR_DOCUMENTset. -
isFieldSeparator
public static boolean isFieldSeparator(int type)Returnstrueif the given type hasTokenizer.TF_SEPARATOR_FIELDset. -
isTerminator
public static boolean isTerminator(int type)Returnstrueif the given type hasTokenizer.TF_TERMINATORset. -
isCommon
public static boolean isCommon(int flag)ReturntrueifTokenizer.TF_COMMON_WORDis set. -
isInQuery
public static boolean isInQuery(int flag)ReturntrueifTokenizer.TF_QUERY_WORDis set.
-