Hey Romain,
This could be really simple, or actually quite complicated, depending
on how you want to view it.
If your problem is "how do I look at two words at a time in a list of
words", then that's not so hard. Maybe do something like:
for index in range(len(words)):
oneword = words[index]
# check to see if it's in the dictionary
if index < len(words) - 1:
twowords = [words[index], words[index+1]]
# check to see if they're in the dictionary as a sequence
... something like that.
The harder problem is that you've got to decide whether, in this
context, an instance of the string in your dictionary is actually a
reference to the sovereign nation. As a trivial example, what if you
find the word "Turkey' in your input?
Like almost all NLP, this becomes a problem of ambiguity resolution
really quickly.
Hope this helps!
--
-- alexr