Ejemplo n.º 1
0
def main():
    args = docopt(__doc__, version='meTypeset 0.1')
    bare_gv = GV(args)

    if args['--debug']:
        bare_gv.debug.enable_debug(args['--nogit'])

    nlm_instance = TeiToNlm(bare_gv)

    if args['process']:
        # run non-transform portions of teitonlm
        TeiToNlm(bare_gv).run(True, False)
        # run reference linker
        rl = ReferenceLinker(bare_gv)
        rl.run(args['--interactive'])
        rl.cleanup()

        bibliography_classifier = BibliographyClassifier(bare_gv)

        # run table classifier
        cc = CaptionClassifier(bare_gv)
        if int(args['--aggression']) > int(
                bare_gv.settings.get_setting(
                    'tablecaptions', None, domain='aggression')):
            cc.run_tables()

        if int(args['--aggression']) > int(
                bare_gv.settings.get_setting(
                    'graphiccaptions', None, domain='aggression')):
            cc.run_graphics()

        if args['--interactive']:
            bibliography_classifier.run_prompt(True)

        # process any bibliography entries that are possible
        BibliographyDatabase(bare_gv).run()

        # remove stranded titles
        manipulate = NlmManipulate(bare_gv)
        manipulate.final_clean()

        if args['--identifiers']:
            IdGenerator(bare_gv).run()

        if args['--chain']:
            # construct and run an XSLT chainer
            XslChain(bare_gv).run()

        if args['--clean']:
            ComplianceEnforcer(bare_gv).run()
Ejemplo n.º 2
0
def main():
    args = docopt(__doc__, version='meTypeset 0.1')
    bare_gv = GV(args)

    if args['--debug']:
        bare_gv.debug.enable_debug(args['--nogit'])

    nlm_instance = TeiToNlm(bare_gv)

    if args['process']:
            # run non-transform portions of teitonlm
            TeiToNlm(bare_gv).run(True, False)
            # run reference linker
            rl = ReferenceLinker(bare_gv)
            rl.run(args['--interactive'])
            rl.cleanup()

            bibliography_classifier = BibliographyClassifier(bare_gv)

            # run table classifier
            cc = CaptionClassifier(bare_gv)
            if int(args['--aggression']) > int(bare_gv.settings.get_setting('tablecaptions',
                                                                            None, domain='aggression')):
                cc.run_tables()

            if int(args['--aggression']) > int(bare_gv.settings.get_setting('graphiccaptions',
                                                                            None, domain='aggression')):
                cc.run_graphics()

            if args['--interactive']:
                bibliography_classifier.run_prompt(True)

            # process any bibliography entries that are possible
            BibliographyDatabase(bare_gv).run()

            # remove stranded titles
            manipulate = NlmManipulate(bare_gv)
            manipulate.final_clean()

            if args['--identifiers']:
                IdGenerator(bare_gv).run()

            if args['--chain']:
                # construct and run an XSLT chainer
                XslChain(bare_gv).run()

            if args['--clean']:
                ComplianceEnforcer(bare_gv).run()