<p>你可以定义一个类似这样的函数</p>
<pre><code>def find_sentences( word, text ):
sentences = text.split('.')
findings = []
for i in range(len(sentences)):
if word.lower() in sentences[i].lower():
if i==0:
findings.append( sentences[i+1]+'.' )
elif i==len(sentences)-1:
findings.append( sentences[i-1]+'.' )
else:
findings.append( sentences[i-1]+'.' + sentences[i+1]+'.' )
return findings
</code></pre>
<p>这可以称为</p>
<pre><code>findings = find_sentences( 'Power curve', Str_wrds )
</code></pre>
<p>用一些漂亮的印刷品</p>
<pre><code>for finding in findings:
print( finding +'\n')
</code></pre>
<p>我们得到了结果</p>
<pre><code>However, there is substantial uncertainty linked to power curve measurements as they usually take place only at hub height.
Power curve, supplied by turbine manufacturers, are extensively used in condition monitoring, energy estimation, and improving operational efficiency. Data-driven model accuracy is significantly affected by uncertainty.
The uncertainty associated with models is quantified using confidence intervals (CIs), which are themselves estimated. A radial basis function is taken as the kernel function to improve the accuracy of the SVM models.
The proposed techniques are then verified by extensive 10 min average supervisory control and data acquisition (SCADA) data, obtained from pitch-controlled wind turbines..
</code></pre>
<p>我希望这就是你想要的:)</p>