def __len__(self):
n_token_patterns = sum(len(p) for p in self.token_patterns.values())<EOL>n_phrase_patterns = sum(len(p) for p in self.phrase_patterns.values())<EOL>return n_token_patterns + n_phrase_patterns<EOL>
The number of all patterns added to the entity ruler.