Ejemplo n.º 1
0
def read_projected_rm_linll(doc_id, page_no, level):
    prm_odir = cfgObj.get_config('PageAnalysis', 'projectedrmlnill_odir')
    fpath = os.path.join(opath, str(doc_id), prm_odir, '')
    #os.system('mkdir -p %s' %fpath)
    datastore.make_dirs(fpath)
    filename = '%s_%s.sh' % (str(page_no), level)
    fname = os.path.join(fpath, filename)
    data = datastore.read_data_fname(fname, isdb, isenc, d)
    return data.get('data', {})
Ejemplo n.º 2
0
def write_cagr_shelve(doc_id, page_no, CellInfoDict, level):
    ci_odir = cfgObj.get_config('PageAnalysis', 'cagr_result_odir')
    fname = '%s_%s.sh' % (page_no, level)
    #shname = os.path.join(ipath, str(doc_id), ci_odir, fname)
    shname = os.path.join(opath, str(doc_id), ci_odir, fname)
    datastore.make_dirs(os.path.join(opath, str(doc_id), ci_odir))

    d = {}
    d['data'] = CellInfoDict
    datastore.write_data_fname(shname, isdb, isenc, d)
    return
Ejemplo n.º 3
0
    def write_projected_rm(self, doc_id, page_no, level, rm_lines):
        prm_odir = cfgObj.get_config('PageAnalysis', 'projectedrm_odir')
        fpath = os.path.join(self.opath, str(doc_id), prm_odir, '')
        #os.system('mkdir -p %s' %fpath)
        datastore.make_dirs(fpath)
        filename = '%s_%s.sh' % (str(page_no), level)
        fname = os.path.join(fpath, filename)
        d = {}
        d['data'] = rm_lines[:]
        datastore.write_data_fname(fname, self.isdb, self.isenc, d)

        return
Ejemplo n.º 4
0
def write_projected_rm_file_linll(doc_id, page_no, level, rm_lines):
    prm_odir = cfgObj.get_config('PageAnalysis', 'projectedrm_odir')
    fpath = os.path.join(opath, str(doc_id), prm_odir, '')
    #os.system('mkdir -p %s' %fpath)
    datastore.make_dirs(fpath)
    filename = '%s_%s_LinLL.txt' % (str(page_no), level)
    fname = os.path.join(fpath, filename)

    f1 = open(fname, "w")
    for e in rm_lines:
        es = '\t'.join(e)
        f1.write('%s\n' % es)
    f1.close()
    return