基本上我想遍历所有句子,例如:
string sentence = "How was your day - Andrew, Jane?";
string[] separated = SeparateSentence(sentence);
separated
输出如下:
[1] =“如何”
[2] = " "
[3] = “曾经”
[4] = " "
[5] = “你的”
[6] = " "
[7] = “天”
[8] = " "
[9] =“-”
[10] = " "
[11] = “安德鲁”
[12] = ","
[13] = " "
[14] = “简”
[15] = “?”
截至目前,我只能使用正则"\w(?<!\d)[\w'-]*"
表达式来抓取单词。根据输出示例,如何将句子分成更小的部分?
编辑:该字符串没有以下任何内容:
IE
固体形式
第八、第一、第二