我想从文档中拆分每个句子并将每个句子存储在不同的数组中。每个数组元素都是句子的单词。但我不能远离这一点。
int count =0,len=0;
String sentence[];
String words[][];
sentence = name.split("\\.");
count = sentence.length;
System.out.print("total sentence: " );
System.out.println(count);
int h;
words = new String[count][];
for (h = 0; h < count; h++) {
String tmp[] = sentence[h].split(" ");
words[h] = tmp;
len = len + words[h].length;
System.out.println("total words: " );
System.out.print(len);
temp = sentence[h].split(delimiter);
for(int i = 0; i < temp.length; i++) {
System.out.print(len);
System.out.println(temp[i]);
len++;
}
}