Пример #1
0
 def get_idx(klass, path):
   if path in klass._cdb_cache:
     idx = klass._cdb_cache[path]
   else:
     idx = cdb.init(path)
     klass._cdb_cache[path] = idx
   return idx
Пример #2
0
 def get_idx(klass, path):
     if path in klass._cdb_cache:
         idx = klass._cdb_cache[path]
     else:
         idx = cdb.init(path)
         klass._cdb_cache[path] = idx
     return idx
Пример #3
0
 def open(self):
     if not self.cdb:
         self.cdb = cdb.init(self.fname)
         (self.ndocs, self.nterms) = idx_info(self.cdb)
     return
Пример #4
0
 def open(self):
   if not self.cdb:
     self.cdb = cdb.init(self.fname)
     (self.ndocs, self.nterms) = idx_info(self.cdb)
   return
Пример #5
0
 def open(self, mode='r'):
   import pycdb as cdb
   self._db = cdb.init(self.dbfile)
   return
Пример #6
0
 def open(self, mode='r'):
     import pycdb as cdb
     self._db = cdb.init(self.dbfile)
     return