Package com.swabunga.spell.event
Class FileWordTokenizer
- java.lang.Object
-
- com.swabunga.spell.event.AbstractWordTokenizer
-
- com.swabunga.spell.event.FileWordTokenizer
-
- All Implemented Interfaces:
WordTokenizer
public class FileWordTokenizer extends AbstractWordTokenizer
This class tokenizes a input file.Any takers to do this efficiently?? doesn't need to replace any words to start with. I need this to get an idea of how quick the spell checker is.
-
-
Field Summary
-
Fields inherited from class com.swabunga.spell.event.AbstractWordTokenizer
currentWord, finder, sentenceIterator, wordCount
-
-
Constructor Summary
Constructors Constructor Description FileWordTokenizer(java.io.File inputFile)
Creates a new FileWordTokenizer object.FileWordTokenizer(java.io.File inputFile, WordFinder finder)
Creates a new FileWordTokenizer object and associate a WordFinder to it's processing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
replaceWord(java.lang.String s)
Replaces the current word token-
Methods inherited from class com.swabunga.spell.event.AbstractWordTokenizer
getContext, getCurrentWordCount, getCurrentWordEnd, getCurrentWordPosition, hasMoreWords, isNewSentence, nextWord
-
-
-
-
Constructor Detail
-
FileWordTokenizer
public FileWordTokenizer(java.io.File inputFile)
Creates a new FileWordTokenizer object.- Parameters:
inputFile
- the file to work upon
-
FileWordTokenizer
public FileWordTokenizer(java.io.File inputFile, WordFinder finder)
Creates a new FileWordTokenizer object and associate a WordFinder to it's processing.- Parameters:
inputFile
- the file to word upon.finder
- the specialize processing for words.
-
-
Method Detail
-
replaceWord
public void replaceWord(java.lang.String s)
Replaces the current word token- Specified by:
replaceWord
in interfaceWordTokenizer
- Specified by:
replaceWord
in classAbstractWordTokenizer
- Parameters:
s
- the new string- Throws:
WordNotFoundException
- current word not yet set.
-
-