|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.northwestern.at.utils.corpuslinguistics.FileTokenizer
public class FileTokenizer
Tokenize a text file.
| Field Summary | |
|---|---|
protected java.io.BufferedReader |
input
|
protected java.lang.String |
nextToken
|
protected Pretokenizer |
pretokenizer
|
protected java.util.StringTokenizer |
tokenizer
|
| Constructor Summary | |
|---|---|
FileTokenizer(java.io.File file)
Create file tokenizer. |
|
FileTokenizer(java.io.File file,
java.lang.String encoding,
Pretokenizer pretokenizer)
Create file tokenizer. |
|
FileTokenizer(java.lang.String fileName)
Create file tokenizer. |
|
FileTokenizer(java.lang.String fileName,
java.lang.String encoding)
Create file tokenizer. |
|
| Method Summary | |
|---|---|
void |
close()
Close input file once tokenization is complete. |
java.lang.String |
getNextToken()
Get the next token. |
boolean |
hasMoreTokens()
Check if more tokens are available. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.io.BufferedReader input
protected java.util.StringTokenizer tokenizer
protected java.lang.String nextToken
protected Pretokenizer pretokenizer
| Constructor Detail |
|---|
public FileTokenizer(java.io.File file,
java.lang.String encoding,
Pretokenizer pretokenizer)
throws java.io.IOException
file - Input file.encoding - Input file text encoding (e.g., "utf-8").pretokenizer - The pretokenizer for each input line.
DefaultPretokenizer is used if null.
java.io.IOException - if input file can't be read.
public FileTokenizer(java.io.File file)
throws java.io.IOException
file - Input file.
java.io.IOException - if input file can't be read.
public FileTokenizer(java.lang.String fileName,
java.lang.String encoding)
throws java.io.IOException
fileName - Name of the input file.encoding - Encoding (e.g., "utf-8").
java.io.IOException - if input file can't be read.
public FileTokenizer(java.lang.String fileName)
throws java.io.IOException
fileName - Name of the input file.
java.io.IOException - if input file can't be read. | Method Detail |
|---|
public java.lang.String getNextToken()
public boolean hasMoreTokens()
public void close()
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||