1 package com
.swabunga
.spell
.event
;
3 /** This interface returns words.
4 * It also allows for the current word to be mutated
6 * @author Jason Height (jheight@chariot.net.au)
8 public interface WordTokenizer
{
9 /** Returns true iif there are more words left*/
10 public boolean hasMoreWords();
11 /**Returns an index representing the start location in the original set of words*/
12 public int getCurrentWordPosition();
13 /**Returns an index representing the end location in the original set of words*/
14 public int getCurrentWordEnd();
16 /** Returns the next word token*/
17 public String
nextWord();
18 /** Returns the number of word tokens that have been processed thus far*/
19 public int getCurrentWordCount();
20 /** Replaces the current word token
21 * <p>When a word is replaced care should be taken that the WordTokenizer
22 * repositions itself such that the words that were added arent rechecked. Of
23 * course this is not mandatory, maybe there is a case when an application
24 * doesnt need to do this.</p>
26 public void replaceWord(String newWord
);
27 /** Returns the context text that is being tokenized (should include any changes
28 * that have been made)
30 public String
getContext();
31 /** Returns true iif the current word is at the start of a sentance*/
32 public boolean isNewSentance();