code: protected static String getEndedWord(String str, int pos){
  		assert(pos < str.length() && pos >= 0);
  
  		if(	posIsAtWordEnd(str, pos) ){
  			int prevSpace = findLastNonLetterOrDigit(str, pos);
  
  			return str.substring(prevSpace+1, pos+1);
  		}
  		return null;
  	}
docs: If pos is ending a word in str: returns this word.
  Else: returns null;