任何人都可以幫助我嗎?我想將sentences[]
拆分爲words[]
。但它表明Syntax error on token "j", delete this token
......將文件分割成文字
我的代碼是:
try
{
int j;
String paragraph = sample.readFileString(f);
String[] sentences = paragraph.split("[\\.\\!\\?]");
for (int i=0;i<sentences.length;i++)
{
System.out.println(i);
System.out.println(sentences[i]);
for(j=0;j<=i;j++)
{
String word[j]=sentences[i].split(" ");
}
}
}
我能做些什麼?
鍵入您正試圖分裂的句子。 –
你還可以添加完整的錯誤日誌嗎? – goravine