Type | Name and description |
---|---|
def |
buffer |
static String |
create |
static def |
endPunctuationList endPunctuationList the list of punctuation symbols that can be removed from the ends of words |
static def |
fileHandle |
String |
fileName |
static def |
fileReader |
boolean |
finishing Reads the file a line at a time using the fileReader and returns at least maxWords in buffer, except for the last buffer. |
static String |
init |
static int |
maxBufferSize |
static def |
startPunctuationList startPunctuationList the list of punctuation symbols that can be removed from the start of words |
Constructor and description |
---|
WordBuffer
() |
Type Params | Return Type | Name and description |
---|---|---|
|
def |
createBuffer(FileReader fileReader, int maxWords) |
|
int |
createInstance(List d) |
|
int |
initClass(List d) |
|
def |
processLine(def line) processLine takes a line of text which is split into words using tokenize(' ') |
|
def |
removePunctuation(def w) removePunctuation removes any punctuation characters from the start and end of a word |
|
String |
toString() |
endPunctuationList the list of punctuation symbols that can be removed from the ends of words
Reads the file a line at a time using the fileReader and returns at least maxWords in buffer, except for the last buffer. Once the end of file is reached the method returns a null value. Words in the buffer may include punctuation.
fileReader
- The file fileName's associated fileReadermaxWords
- The minimum number of words in a returned bufferstartPunctuationList the list of punctuation symbols that can be removed from the start of words
processLine takes a line of text which is split into words using tokenize(' ')
line
- a line that has been read from a fileremovePunctuation removes any punctuation characters from the start and end of a word
w
- String containing the word to be processedDemonstrations of the Use of the Groovy Parallel Patterns Library generated 18-09-2017 by Jon Kerridge, Edinburgh Napier University - j.kerridge@napier.ac.uk