private void markupSpelling(StyledDocument doc, int start, int end){
int wordStart=-1,
wordEnd=-1;
String word;
DocumentWordTokenizer docTok;
@SuppressWarnings("unused")
Segment seg=new Segment();
docTok=new DocumentWordTokenizer(doc);
if(start>0){
docTok.posStartFullWordFrom(start);
}
while(docTok.hasMoreWords() && docTok.getCurrentWordPosition()<=end){
word=docTok.nextWord();
wordStart=docTok.getCurrentWordPosition();
// Mark non word parts (spaces) as correct
if(wordEnd!=-1){
//System.out.println("Space:"+wordEnd+","+wordStart);
markAsCorrect(doc, wordEnd, wordStart);
}
wordEnd=docTok.getCurrentWordEnd();
if(wordEnd>doc.getLength())
wordEnd=doc.getLength()-1;
if(wordStart>=wordEnd)
continue;