コード例 #1
0
ファイル: base.py プロジェクト: schuyler/nlplib
 def add(self, guid, content=None, source=None):
     print >>sys.stderr, "Adding '%s' (%s)" % (title, url)
     try:
         doc = Document.byGuid(guid)
     except:
         doc = Document(guid=guid, doc_type=self.doc_type)
         Link(source=source, target=doc)
     if content and not doc.data:
         data, tags, vector = self.process(content)
         doc.data = data
         doc.vector = vector
         doc.tags = tags
         doc.sync()
     return doc