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

Method append

pattern/vector/__init__.py:903–915  ·  view source on GitHub ↗

Appends the given Document to the model. If Model.weight != TF, the cache of vectors and cosine similarity is cleared (feature weights will be different now that there is a new document).

(self, document)

Source from the content-addressed store, hash-verified

901 self._update()
902
903 def append(self, document):
904 """ Appends the given Document to the model.
905 If Model.weight != TF, the cache of vectors and cosine similarity is cleared
906 (feature weights will be different now that there is a new document).
907 """
908 if not isinstance(document, Document):
909 raise TypeError, "Model.append() expects a Document."
910 document._model = self
911 if document.name is not None:
912 self._index[document.name] = document
913 if self._weight != TF:
914 self._update()
915 list.append(self.documents, document)
916
917 def extend(self, documents):
918 """ Extends the model with the given list of documents.

Callers 15

case_sensitiveFunction · 0.45
upper_consonant_yFunction · 0.45
shiFunction · 0.45
saveMethod · 0.45
exportMethod · 0.45
CkMethod · 0.45
__call__Method · 0.45
centroidFunction · 0.45
k_meansFunction · 0.45
kmppFunction · 0.45
flattenMethod · 0.45
hierarchicalFunction · 0.45

Calls 1

_updateMethod · 0.95

Tested by

no test coverage detected