Python检查列表中的两个连续单词是否是另一个列表中的单词

Sam*_*Sam 2 python python-3.x

例如:

a = ['The', 'man', 'is', 'eating', 'pear']
Run Code Online (Sandbox Code Playgroud)

eating并且pear是连续的

b = ['these', 'are', 'random', 'words', 'but', 'they', 'have', 'pear', 'and', 'eating']
Run Code Online (Sandbox Code Playgroud)

这是一个随机的单词列表,我想检查两个CONSECUTIVE单词是否为b中的单词

我如何生成像这样的列表

c = ['eating', 'pear']
Run Code Online (Sandbox Code Playgroud)

Min*_*ato 5

c = [(x,y) for x, y in zip(a[0:], a[1:]) if x in b and y in b]
print(c)
Run Code Online (Sandbox Code Playgroud)