You need to split the string into separate words. Made so. It works well with the text written by the Latin. But the words written by Cyrillic does not recognize. Tell me what can be done?
Public Class TextSplitter {
public arraylist & lt; string & gt; SplittextTowOWords (String String) {
ArrayList & LT; String & GT; List = New ArrayList & LT; & GT; ();
String [] strings = string.split ("\\ w");
For (int i = 0; i & lt; strings.length; I ++) {
if (Strings [i] .length () & gt; 0) {
List.add (strings [i] .TolowerCase ());
}
}
RETURN LIST;
}
Answer 1, Authority 100%
You can try this to add Cyrillic
string [] strings = string.split ("[^ a-za-za-ya-ya0-9_] ");
or divide on spaces
string [] strings = string.split ("\\ s");
But the first is better for me. Because the second divides on spaces.