This is a weird corner case, but worth noting and perhaps fixing. If you are using the library with the ARK tagger you might get pronouns tagged with "O".
Because phrasemachine marks tokens that are not in the coarsemap with "O" (i.e. other) this does weird things when you have a custom regex that involves pronoun tags.
tokens = "I drive a red car".split()
postags = "P V D A N".split()
pronouns = "O"
phrasemachine.get_phrases(tokens=tokens, postags=postags, regex=pronouns, minlen=1)["counts"]
Counter({'drive': 1})
I think an easy fix is to change "O" to another, rare-r character internally. Another option (better?) is just not to fix this.
This is a weird corner case, but worth noting and perhaps fixing. If you are using the library with the ARK tagger you might get pronouns tagged with "O".
Because phrasemachine marks tokens that are not in the coarsemap with "O" (i.e. other) this does weird things when you have a custom regex that involves pronoun tags.
I think an easy fix is to change "O" to another, rare-r character internally. Another option (better?) is just not to fix this.