【发布时间】:2018-06-06 19:02:16
【问题描述】:
这是我的全文:
RETENTION
Liability in excess of the Retention
The Retention shall be borne by the Named Insured and the Insurer shall only be liable for Loss once the Retention has been fully eroded. The Retention shall apply until such time as it has been fully eroded after which no Retention shall apply.
Erosion of the Retention
The Retention shall be eroded by Loss for which the Insurer would be liable under this Policy but for the Retention.
我想提取整个 RETENTION 段落。
这是我提取具有特定单词的句子的代码(这里:保留)。
abc3=([sentence + '.' for sentence in txt_trim_string.split('.') if 'RETENTION' in sentence])
但这给出的输出为:
RETENTION
Liability in excess of the Retention
The Retention shall be borne by the Named Insured and the Insurer shall only be liable for Loss once the Retention has been fully eroded.
我还想包括:
Erosion of the Retention
The Retention shall be eroded by Loss for which the Insurer would be liable under this Policy but for the Retention.
我该怎么做?
【问题讨论】:
-
你如何定义这里的模式?段落的边界是什么?