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