Package edu.cmu.tetrad.data
Class RegexTokenizer
java.lang.Object
edu.cmu.tetrad.data.RegexTokenizer
Tokenizes the given input character sequence using the type of delimiter specified bythe given CPDAG. Meant to
function just like StringTokenizer, with more control over what counts as a tokenization delimiter.
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Constructor Summary
ConstructorsConstructorDescriptionRegexTokenizer
(CharSequence line, Pattern delimiterPattern, char quoteChar) Constructs a tokenizer for the given input line, using the given Pattern as delimiter. -
Method Summary
Modifier and TypeMethodDescriptionboolean
hasMoreTokens.nextToken.void
setQuoteSensitive
(boolean quoteSensitive) True iff the parser should be aware of quotation marks and remove them from returned strings.
-
Constructor Details
-
RegexTokenizer
Constructs a tokenizer for the given input line, using the given Pattern as delimiter.- Parameters:
line
- aCharSequence
objectdelimiterPattern
- aPattern
objectquoteChar
- a char
-
-
Method Details
-
hasMoreTokens
public boolean hasMoreTokens()hasMoreTokens.
- Returns:
- true iff more tokens exist in the line.
-
nextToken
-
setQuoteSensitive
public void setQuoteSensitive(boolean quoteSensitive) True iff the parser should be aware of quotation marks and remove them from returned strings.- Parameters:
quoteSensitive
- a boolean
-