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

Method extend

pattern/vector/__init__.py:917–928  ·  view source on GitHub ↗

Extends the model with the given list of documents.

(self, documents)

Source from the content-addressed store, hash-verified

915 list.append(self.documents, document)
916
917 def extend(self, documents):
918 """ Extends the model with the given list of documents.
919 """
920 for document in documents:
921 if not isinstance(document, Document):
922 raise TypeError, "Model.extend() expects a list of Documents."
923 document._model = self
924 if document.name is not None:
925 self._index[document.name] = document
926 if self._weight != TF:
927 self._update()
928 list.extend(self.documents, documents)
929
930 def remove(self, document):
931 """ Removes the given Document from the model, and sets Document.model=None.

Callers 5

__init__Method · 0.95
filterMethod · 0.95
__init__Method · 0.45
centroidFunction · 0.45
flattenMethod · 0.45

Calls 1

_updateMethod · 0.95

Tested by

no test coverage detected