I am trying to figure out how to can condense the number of pattern matching rules I need to create to pick up on conditions like I saw a man at the SW corner of Pike street. For "SW Corner", I don't want to write a match rule for every directional variation (N, S, E, W, etc.). I tried to do it with the below, but it isn't right. Well, it works but it also picks up other things.
Example:
matcher.add("DIRECTION", None,
[{}, {"TEXT":{"REGEX":"(?:N)|(?:S)|(?:E)|(?:W)|(?:NW)|(?:NE)|(?:SW)|(?:SE)"}}, {"LOWER":"corner"}]
)
I want to be able to use the OR statements, but I am not sure how to do that with the single or double characters (N, S, E, W, NW, NE, SW, SE).
What am I doing wrong?