Sparkle’s Workshop

Archive for February, 2006

SentenceAnalyzer

Posted on February 20, 2006 - Filed Under Uncategorized

public class SentenceAnalyzer {
private char[] interpunction = new char[] { ‘!’, ‘…’, ‘!’, ‘?’, ‘,’, ‘@’,
‘“’, ‘”’, ‘"’, ‘\”, ‘《’, ‘》’, ‘{’, ‘}’, ‘(’, ‘)’, ‘;’, ‘:’, ‘>’,
‘<’, ‘~’, ‘_’, ‘.’, ‘[', ']‘, ‘/’, ‘-’, ‘:’ };
 
public SentenceAnalyzer() {
interpunctionSet = new HashSet<Character>();
for (char interpunctionChar : interpunction) {
interpunctionSet.add(interpunctionChar);
}
interpunction = null;
}
 
private Set<Character> interpunctionSet;
 
public [...]

Read More..>>