def __init__(self, threshold, manual_fn): Filter.__init__(self) self.appl_only_filter = ApplicationModeAnnotator(threshold) self.null_only_filter = NullModeAnnotator(threshold) self.manual_fn = manual_fn
def __init__(self, outdir, format): Filter.__init__(self) OutputDerivation.__init__(self, transformer=self.transformer, outdir=outdir) self.format_string = self.make_format_string_from(format)
def __init__(self, substs, output_dir): # substs maps from the _name_ of each old category to its replacement category _object_. Filter.__init__(self) DerivationOutput.__init__(self) self.substs = substs self.output_dir = output_dir
def __init__(self, expression): Filter.__init__(self) initialise() self.expression = expression self.nmatched = self.total = 0
def __init__(self, outdir): Filter.__init__(self) OutputPrefacedPTBDerivation.__init__(self, outdir) self.outdir = outdir self.bad = OutputPrefacedPTBDerivation(os.path.join(outdir, 'failed')) self.bad_freqs = defaultdict(int)
def __init__(self, expression): Filter.__init__(self) initialise() self.expression = expression self.count = 0 self.total = 0
def __init__(self, anno_filename, output_dir): Filter.__init__(self) self.anno_filename = anno_filename self.substs = self.process_annotator_into_substs(anno_filename) self.output_dir = output_dir self.filter = Subst(self.substs, self.output_dir)
def __init__(self, output_dir, extension): Filter.__init__(self) self.output_dir = output_dir self.extension = extension try: os.mkdir(self.output_dir) except OSError: pass
def __init__(self): Filter.__init__(self) self.counts = defaultdict(lambda: 0) self.adjunction_kinds = defaultdict(lambda: 0) self.predication_kinds = defaultdict(lambda: 0) self.apposition_kinds = defaultdict(lambda: 0) self.modification_kinds = defaultdict(lambda: 0) self.coordination_kinds = defaultdict(lambda: 0)
def __init__(self): Filter.__init__(self) class D(object): def __init__(self): self.va = 0 self.jj = 0 self.va_examples = Counter() self.jj_examples = Counter() self.mixed_examples = Counter() def __repr__(self): return '<va:%d, jj:%d>' % (self.va, self.jj) self.counts = defaultdict(D)
def __init__(self): Filter.__init__(self) self.headfreqs = defaultdict(int)
def __init__(self): Filter.__init__(self) self.counter = CountDict()
def __init__(self): Filter.__init__(self) self.counts = defaultdict(int)
def __init__(self, lex): Filter.__init__(self) self.lex = lex self.cats_seen = set()
def __init__(self): Filter.__init__(self)
def __init__(self): Filter.__init__(self) self.words = []
def __init__(self, outdir): Filter.__init__(self) self.outdir = outdir
def __init__(self, indices): Filter.__init__(self) self.indices = set(map(int, indices.split(',')))
def __init__(self): Filter.__init__(self) self.n = 0 self.total = 0
def __init__(self): Filter.__init__(self) self.total = 0 self.l, self.r = 0, 0 self.other = 0
def __init__(self): Filter.__init__(self) self.conjs = defaultdict(lambda: defaultdict(int)) self.inverse = defaultdict(lambda: defaultdict(int))
def __init__(self, outdir): Filter.__init__(self) OutputPrefacedPTBDerivation.__init__(self, outdir)
def __init__(self, outdir): Filter.__init__(self) self.nbad = 0 self.nderivs = 0
def __init__(self): Filter.__init__(self) self.freqs = CountDict()
def __init__(self): Filter.__init__(self) self.atoms = set()
def __init__(self): Filter.__init__(self) self.depth = 0 self.nderivs = 0
def __init__(self): Filter.__init__(self) self.puncts = Counter()
def __init__(self): Filter.__init__(self) self.branches = 0 self.internals = 0
def __init__(self): Filter.__init__(self) self.rcderivs = 0 self.total = 0 self.parents = defaultdict(int)
def __init__(self): Filter.__init__(self) self.examples = defaultdict(CountDict)
def __init__(self, outdir): Filter.__init__(self) OutputDerivation.__init__(self, outdir, transformer=self.process, fn_template=lambda bundle: "chtb_%02d%02d.parg" % (bundle.sec_no, bundle.doc_no), outdir_template=lambda outdir, bundle: "%s/%02d" % (outdir, bundle.sec_no))