phrases = ['i am good', 'going to the market', 'eating cookies']
dictionary = {'http://www.firsturl.com': 'i am going to the market and tomorrow will be eating cookies',
'http://www.secondurl.com': 'tomorrow is my birthday and i shall be',
'http://www.thirdurl.com': 'i am good and will go to sleep'}
如果至少有一个匹配项:预期输出:
url phrasecount phrase
http://www.firsturl.com 2 going to the market, eating cookies
http://www.thirdurl.com 1 i am good
如果所有 3 个 url 都没有匹配项,则只返回第一次出现的 url,计数为零,预期输出为空白短语:
url phrasecount phrase
http://www.firsturl.com 0
拉风的咖菲猫
相关分类