Esempio n. 1
0
    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
Esempio n. 2
0
    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)
Esempio n. 3
0
 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
Esempio n. 4
0
    def __init__(self, expression):
        Filter.__init__(self)
        initialise()

        self.expression = expression

        self.nmatched = self.total = 0
Esempio n. 5
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)
Esempio n. 6
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)
Esempio n. 7
0
 def __init__(self, expression):
     Filter.__init__(self)
     initialise()
     
     self.expression = expression
     self.count = 0
     self.total = 0
Esempio n. 8
0
 def __init__(self, expression):
     Filter.__init__(self)
     initialise()
     
     self.expression = expression
     
     self.nmatched = self.total = 0
Esempio n. 9
0
    def __init__(self, expression):
        Filter.__init__(self)
        initialise()

        self.expression = expression
        self.count = 0
        self.total = 0
Esempio n. 10
0
    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
Esempio n. 11
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)
Esempio n. 12
0
 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
Esempio n. 13
0
    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)
Esempio n. 14
0
    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
Esempio n. 15
0
    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)
Esempio n. 16
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)
Esempio n. 17
0
 def __init__(self):
     Filter.__init__(self)
     self.headfreqs = defaultdict(int)
Esempio n. 18
0
 def __init__(self):
     Filter.__init__(self)
     self.counter = CountDict()
Esempio n. 19
0
 def __init__(self):
     Filter.__init__(self)
     self.counts = defaultdict(int)
Esempio n. 20
0
 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)
Esempio n. 21
0
 def __init__(self, lex):
     Filter.__init__(self)
     self.lex = lex
     self.cats_seen = set()
Esempio n. 22
0
 def __init__(self):
     Filter.__init__(self)
Esempio n. 23
0
 def __init__(self, lex):
     Filter.__init__(self)
     self.lex = lex
     self.cats_seen = set()
Esempio n. 24
0
 def __init__(self):
     Filter.__init__(self)
     self.words = []
Esempio n. 25
0
    def __init__(self, outdir):
        Filter.__init__(self)

        self.outdir = outdir
Esempio n. 26
0
 def __init__(self, indices):
     Filter.__init__(self)
     self.indices = set(map(int, indices.split(',')))
Esempio n. 27
0
 def __init__(self):
     Filter.__init__(self)
     self.n = 0
     self.total = 0
Esempio n. 28
0
 def __init__(self):
     Filter.__init__(self)
     self.total = 0
     self.l, self.r = 0, 0
     self.other = 0
Esempio n. 29
0
 def __init__(self):
     Filter.__init__(self)
     self.counts = defaultdict(int)
Esempio n. 30
0
 def __init__(self):
     Filter.__init__(self)
     self.conjs = defaultdict(lambda: defaultdict(int))
     self.inverse = defaultdict(lambda: defaultdict(int))
Esempio n. 31
0
 def __init__(self, outdir):
     Filter.__init__(self)
     OutputPrefacedPTBDerivation.__init__(self, outdir)
Esempio n. 32
0
 def __init__(self):
     Filter.__init__(self)
Esempio n. 33
0
 def __init__(self, outdir):
     Filter.__init__(self)
     self.nbad = 0
     self.nderivs = 0
Esempio n. 34
0
 def __init__(self):
     Filter.__init__(self)
     self.freqs = CountDict()
Esempio n. 35
0
 def __init__(self):
     Filter.__init__(self)
     self.counter = CountDict()
Esempio n. 36
0
 def __init__(self):
     Filter.__init__(self)
     self.n = 0
     self.total = 0
Esempio n. 37
0
 def __init__(self):
     Filter.__init__(self)
     self.atoms = set()
Esempio n. 38
0
 def __init__(self):
     Filter.__init__(self)
     self.depth = 0
     self.nderivs = 0
Esempio n. 39
0
 def __init__(self):
     Filter.__init__(self)
     self.total = 0
     self.l, self.r = 0, 0
     self.other = 0
Esempio n. 40
0
 def __init__(self):
     Filter.__init__(self)
     
     self.puncts = Counter()
Esempio n. 41
0
 def __init__(self):
     Filter.__init__(self)
     self.branches = 0
     self.internals = 0
Esempio n. 42
0
    def __init__(self):
        Filter.__init__(self)

        self.rcderivs = 0
        self.total = 0
        self.parents = defaultdict(int)
Esempio n. 43
0
 def __init__(self, outdir):
     Filter.__init__(self)
     OutputPrefacedPTBDerivation.__init__(self, outdir)
Esempio n. 44
0
 def __init__(self):
     Filter.__init__(self)
     self.branches = 0
     self.internals = 0
Esempio n. 45
0
    def __init__(self, outdir):
        Filter.__init__(self)

        self.outdir = outdir
Esempio n. 46
0
 def __init__(self):
     Filter.__init__(self)
     
     self.rcderivs = 0
     self.total = 0
     self.parents = defaultdict(int)
Esempio n. 47
0
 def __init__(self):
     Filter.__init__(self)
     self.examples = defaultdict(CountDict)
Esempio n. 48
0
 def __init__(self):
     Filter.__init__(self)
     self.atoms = set()
Esempio n. 49
0
 def __init__(self, indices):
     Filter.__init__(self)
     self.indices = set(map(int, indices.split(',')))
Esempio n. 50
0
 def __init__(self):
     Filter.__init__(self)
     self.words = []
Esempio n. 51
0
 def __init__(self):
     Filter.__init__(self)
     self.conjs = defaultdict(lambda: defaultdict(int))
     self.inverse = defaultdict(lambda: defaultdict(int))
Esempio n. 52
0
 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))