public final class SentenceUtil extends Object
The GNU Lesser General Public License for details.
Modifier | Constructor and Description |
---|---|
private |
SentenceUtil()
Ensure we can not be instantiated
|
Modifier and Type | Method and Description |
---|---|
static int |
firstLetter(String word)
Where is the first letter in this word
|
static String[] |
getWords(String aSentence)
From a sentence get a list of words (in original order) without any
punctuation, and all in lower case.
|
static int |
lastLetter(String word)
Where is the last letter in this word
|
static String[] |
stripPunctuation(String... words)
From a sentence get a list of words (in original order) without any
punctuation, and all in lower case.
|
static String |
stripPunctuationWord(String word)
Remove the punctuation from the ends of the word
|
static String[] |
stripWords(String... words)
From a sentence get a list of words (in original order) without any
punctuation, and all in lower case.
|
static String |
stripWords(String first,
String last)
Remove the punctuation from the ends of the word.
|
static String[] |
tokenize(String sentence)
Take a string and tokenize it using " " and "--" as delimiters into an
Array of Strings.
|
public static String[] tokenize(String sentence)
sentence
- The string to parse.public static String[] stripPunctuation(String... words)
words
- Words with punctuationpublic static String[] stripWords(String... words)
words
- Words with punctuationpublic static String stripWords(String first, String last)
first
- The word to grab the punctuation from the end oflast
- The word to grab the punctuation from the start ofpublic static String[] getWords(String aSentence)
aSentence
- The string to parse.public static String stripPunctuationWord(String word)
word
- Word with punctuationpublic static int firstLetter(String word)
word
- The word to search for letterspublic static int lastLetter(String word)
word
- The word to search for letters