python中列表和词典_Python如何相应地匹配列表和字典

我有一张单子和一本字典。

我想找到一个句子,其中包含从mykeys列表中的单词。在mykeys=['city', 'salon', 'last', 'website', 'car', 'offense', 'open', 'day', 'apple','tree']

mydict={u'00:01:00,880 --> 00:01:34,550': u'created by at the insistence of open and opened, 'u'the little boys, to cater last object to the fact that the mantle Arnold fall with an eye and water on the map and at the salon of the damage of a now will forgive if Mr. Odd enough for the rest of the fat of the day last of the best place to run they saw finances of a sense of hope that they say the.',

u'00:01:34,710 --> 00:02:00,460': u'lot at the at the end of that call of the key to a loss of the holder of the offense of the offense of the season sat, a lot to the city to city that the staff at the fourth of that.',

u'00:00:30,080 --> 00:01:00,710': u'of the game is at a Sonoma world of cities wants any site at gained a son, some crying again and again and they will be if not as a starter for that CNS that and I and far made for the man at the one that ended up by a wall in java battled head up, finished 10 a week of school full time at Seattle king eight you did.',

u'00:00:01,310 --> 00:00:30,080': u'The list of the din of the dossier scene of the site is the issues of stocks and sacked for you to close at least a minute, that uses of the Cincinnati at all of the east of science of the insisted a lot of the senate committees that king case out kingpins in Natal and they all died in Lima and begin and died of.'}

mydict包含{speechtime:speechments}

mykeys包含[10个关键字]

我想从我的关键字列表中找到包含关键字的seech语句。在

例如:

匹配的语音句子如下:

因为它包含:城市,沙龙,最后,进攻,开放,白天。在

^{pr2}$

其他人找不到关键词。在

那么如何生成匹配结果,比如newdicnewdic={u'00:01:00,880 --> 00:01:34,550': u'created by at the insistence of open and opened, 'u'the little boys, to cater last object to the fact that the mantle Arnold fall with an eye and water on the map and at the salon of the damage of a now will forgive if Mr. Odd enough for the rest of the fat of the day last of the best place to run they saw finances of a sense of hope that they say the.',

u'00:01:34,710 --> 00:02:00,460': u'lot at the at the end of that call of the key to a loss of the holder of the offense of the offense of the season sat, a lot to the city to city that the staff at the fourth of that.',}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值