適切に解析された複数段落のドキュメント ( \n\nで区切られたすべての段落と "." で区切られた文) のリストがあり、それらを複数の文に分割したいと考えています。資料。たとえば、(2 段落) 入力は次のとおりです。
First sentence of the 1st paragraph. Second sentence of the 1st paragraph. \n\n
First sentence of the 2nd paragraph. Second sentence of the 2nd paragraph. \n\n
理想的には、出力は次のようになります。
1 First sentence of the 1st paragraph.
1 Second sentence of the 1st paragraph.
2 First sentence of the 2nd paragraph.
2 Second sentence of the 2nd paragraph.
ドキュメントを文に分割できる Perl の Lingua::Sentences パッケージに精通しています。ただし、段落番号付けとは互換性がありません。そのため、上記を実現する別の方法があるかどうか疑問に思っています (ドキュメントには略語が含まれていません)。どんな助けでも大歓迎です。ありがとう!