MCPcopy Create free account
hub / github.com/Albert-Ma/PROP / __init__

Method __init__

prop/preprocessing_data.py:27–33  ·  view source on GitHub ↗
(self, temp_dir)

Source from the content-addressed store, hash-verified

25
26class DocumentDatabase:
27 def __init__(self, temp_dir):
28 self.temp_dir = TemporaryDirectory(dir=temp_dir)
29 self.working_dir = Path(self.temp_dir.name)
30 self.document_shelf_filepath = self.working_dir / 'shelf.db'
31 self.document_shelf = shelve.open(str(self.document_shelf_filepath),
32 flag='n', protocol=-1)
33 self.docids = []
34
35 def add_document(self, doc_id, document):
36 self.document_shelf[str(doc_id)] = document

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected