从文本文件中提取相应的单词列表中的行?

时间:2017-04-24 16:46:35

标签: python text-mining

我是Python新手,我正在努力解决文本挖掘问题。我在下面提供问题陈述。

我有一个PDF文件和一个单词列表。我需要从包含上述列表中任何单词的文件中选择那些行。

我要做的是:我首先将pdf文件转换为文本文件然后我逐行搜索,但我不知道如何搜索多个单词和第二个问题是我无法选择完整的确切线。

说,我在列表中有三个词:'评论','基金'和'国家'。

文字档案:

Country Of Registrations and Fund Charges

For details on fund charges and country of registrations please

see the KIID. For the Manager's investment commentary,

portfolio activity and market outlook, please see the Fund's

Profile at www.BlackRock.com.

因此,对于单词评论,它应该选择以下行

For the Manager's investment commentary,portfolio activity and market outlook, please see the Fund's Profile at www.BlackRock.com.

但它正在挑选:see the KIID. For the Manager's investment commentary

有人可以先帮助我以正确的格式对齐文件中的文本,其中一行应该是完整的完整句子。

0 个答案:

没有答案