Hello,
I am starting to use the pattern library and really love it.
One thing that bothers me though is the behavior of "!". As I understood, when used for instance in "!not", it matches any word that is not "not". The problem is that it has to match a word, which makes the constraint problematic: not only must the word "not" not be there, but another word must exist.
As an example of where this makes trouble, consider the code below. My goal is to match sentences comparing Chuck Norris to Dolph Lundgren without using the negation. For the reason explained above, it doesn't work. Is there another way ?
from pattern.search import Pattern
from pattern.en import parsetree
t = parsetree('Chuck Norris is cooler than Dolph Lundgren.', lemmata=True)
p = Pattern.fromstring('{NP} be {!not} JJ* than {NP}')
m = p.search(t)
Thanks in advance