MCPcopy Index your code
hub / github.com/clips/pattern / count

Method count

pattern/vector/__init__.py:501–505  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

499
500 @property
501 def count(self):
502 # Yields the number of words in the document representation.
503 # Cache the word count so we can reuse it when calculating tf.
504 if not self._count: self._count = sum(self.terms.values())
505 return self._count
506
507 def __len__(self):
508 return len(self.terms)

Callers

nothing calls this directly

Calls 2

sumFunction · 0.85
valuesMethod · 0.45

Tested by

no test coverage detected