I am very well aware of the set operators in Python.
I tested the function with various input, it always either return 0 or 1, however gwords there are.

I am confused about whether it counts the number of variants of gwords in <code>text</code> or the number of occurrences and unfortunately the implementation doesn't follow either of the two.