+++ /dev/null
-/*\r
-Jazzy - a Java library for Spell Checking\r
-Copyright (C) 2001 Mindaugas Idzelis\r
-Full text of license can be found in LICENSE.txt\r
-\r
-This library is free software; you can redistribute it and/or\r
-modify it under the terms of the GNU Lesser General Public\r
-License as published by the Free Software Foundation; either\r
-version 2.1 of the License, or (at your option) any later version.\r
-\r
-This library is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-Lesser General Public License for more details.\r
-\r
-You should have received a copy of the GNU Lesser General Public\r
-License along with this library; if not, write to the Free Software\r
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
-*/\r
-package com.swabunga.spell.event;\r
-\r
-/**\r
- * <p>An interface for objects which take a text-based media as input, and iterate through\r
- * the words in the text stored in that media. Examples of such media could be Strings,\r
- * Documents, Files, TextComponents etc.\r
- * </P>\r
- *\r
- * <P>\r
- * When the object is instantiated, and before the first call to <CODE>next()</CODE> is made,\r
- * the following methods should throw a <CODE>WordNotFoundException</CODE>:<br>\r
- * <CODE>getCurrentWordEnd()</CODE>, <CODE>getCurrentWordPosition()</CODE>,\r
- * <CODE>isNewSentence()</CODE> and <CODE>replaceWord()</CODE>.\r
- * </P>\r
- *\r
- * <P>A call to <CODE>next()</CODE> when <CODE>hasMoreWords()</CODE> returns false\r
- * should throw a <CODE>WordNotFoundException</CODE>.</P>\r
- * @author Jason Height (jheight@chariot.net.au)\r
- */\r
-public interface WordTokenizer {\r
-\r
- //~ Methods .................................................................\r
-\r
- /**\r
- * Returns the context text that is being tokenized (should include any\r
- * changes that have been made).\r
- * @return the text being searched.\r
- */\r
- public String getContext();\r
-\r
- /**\r
- * Returns the number of word tokens that have been processed thus far\r
- * @return the number of words found so far.\r
- */\r
- public int getCurrentWordCount();\r
-\r
- /**\r
- * Returns an index representing the end location of the current word in the text.\r
- * @return index of the end of the current word in the text.\r
- * @throws WordNotFoundException current word has not yet been set.\r
- */\r
- public int getCurrentWordEnd();\r
-\r
- /**\r
- * Returns an index representing the start location of the current word in the text.\r
- * @return index of the start of the current word in the text.\r
- * @throws WordNotFoundException current word has not yet been set.\r
- */\r
- public int getCurrentWordPosition();\r
-\r
- /**\r
- * Returns true if the current word is at the start of a sentence\r
- * @return true if the current word starts a sentence.\r
- * @throws WordNotFoundException current word has not yet been set.\r
- */\r
- public boolean isNewSentence();\r
-\r
- /**\r
- * Indicates if there are more words left\r
- * @return true if more words can be found in the text.\r
- */\r
- public boolean hasMoreWords();\r
-\r
- /**\r
- * This returns the next word in the iteration. Note that any implementation should return\r
- * the current word, and then replace the current word with the next word found in the\r
- * input text (if one exists).\r
- * @return the next word in the iteration.\r
- * @throws WordNotFoundException search string contains no more words.\r
- */\r
- public String nextWord();\r
-\r
- /**\r
- * Replaces the current word token\r
- *\r
- * <p/>\r
- * When a word is replaced care should be taken that the WordTokenizer\r
- * repositions itself such that the words that were added aren't rechecked.\r
- * Of course this is not mandatory, maybe there is a case when an\r
- * application doesn't need to do this.\r
- * <p/>\r
- * @param newWord the string which should replace the current word.\r
- * @throws WordNotFoundException current word has not yet been set.\r
- */\r
- public void replaceWord(String newWord);\r
-}
\ No newline at end of file