示例#1
0
    def modify_edb(self, modifier):

        orig_edb = EntityDB.load_from_files(self.dir_old)
        altered_edb = EntityDB()
        for e in orig_edb.dawg.keys():
            types = orig_edb.get_type(e)
            for type_ in types:
                src, data = type_
                needed, e_, data_, src_ = modifier((e, data, src))
                if e_ == '':
                    continue
                if needed:
                    altered_edb.add_entity(e_, data_, src_)
        altered_edb.dump_to_files(self.dir_new)