def _node_factory(self, cui, description, weight, original_line=None): """Generates a new node. It will weight the node using the TF*IDF provider, if one was specified.""" # This function also mantains the internal node list new_node = Node(cui, description, weight, original_line) if self._tf_idf_scores is not None: new_node.weight = (new_node.weight * self._tf_idf_scores[cui]) self._node_cache.add(new_node) return new_node
def _node_factory(self, cui, description, weight, original_line=None): """Generates a new node. It will weight the node using the TF*IDF provider, if one was specified.""" # This function also mantains the internal node list new_node=Node(cui, description, weight, original_line) if self._tf_idf_scores is not None: new_node.weight=(new_node.weight* self._tf_idf_scores[cui]) self._node_cache.add(new_node) return new_node