public int getWordStart(JTextComponent c, int offs) throws BadLocationException {
    	Document doc = c.getDocument();
    	//
    	String text=doc.getText(0,doc.getLength());
    	//
        int wordPosition = offs;
        boolean isEnd=false;
        if (wordPosition<text.length()-1) do {
       		wordPosition++;
       		//
       		char cc=text.charAt(wordPosition);
       		char pc=text.charAt(wordPosition-1);
       		boolean csc=isSeparatorChar(cc);
       		boolean psc=isSeparatorChar(pc);
       		//
       		isEnd=(!csc&&psc)||(csc&&psc&&(cc!=pc)||(csc&&!psc));
       		//
        } while ((wordPosition<text.length()-1)&&(!isEnd));
        //
        return wordPosition;
    }