private void cleaningText(){
  int latinCount=0, nonLatinCount=0;
  for (int i=0; i < text.length(); ++i) {
    char c=text.charAt(i);
    if (c <= 'z' && c >= 'A') {
      ++latinCount;
    }
 else     if (c >= '\u0300' && UnicodeBlock.of(c) != UnicodeBlock.LATIN_EXTENDED_ADDITIONAL) {
      ++nonLatinCount;
    }
  }
  if (latinCount * 2 < nonLatinCount) {
    StringBuffer textWithoutLatin=new StringBuffer();
    for (int i=0; i < text.length(); ++i) {
      char c=text.charAt(i);
      if (c > 'z' || c < 'A')       textWithoutLatin.append(c);
    }
    text=textWithoutLatin;
  }
}

private void cleaningText ( ) { int latinCount = 0 , nonLatinCount = 0 ; for ( int i = 0 ; i < text . length ( ) ; ++ i ) { char c = text . charAt ( i ) ; if ( c <= 'z' && c >= 'A' ) { ++ latinCount ; } else if ( c >= '̀' && UnicodeBlock . of ( c ) != UnicodeBlock . LATIN_EXTENDED_ADDITIONAL ) { ++ nonLatinCount ; } } if ( latinCount * 2 < nonLatinCount ) { StringBuffer textWithoutLatin = new StringBuffer ( ) ; for ( int i = 0 ; i < text . length ( ) ; ++ i ) { char c = text . charAt ( i ) ; if ( c > 'z' || c < 'A' ) textWithoutLatin . append ( c ) ; } text = textWithoutLatin ; } }
cleaning text to detect ( eliminate url , e - mail address and latin sentence if it is not written in latin alphabet )
