コード例 #1
0
def main(args):
    """Main method."""
    if len(args) != 1:
        raise ValueError('Invalid arguments to main(): {!s}. Can only take one '
                         'filename'.format(args))
    # TODO: support multiple input filenames
    trees = utils.read_trees_from_file(args[0])
    for i, tree in enumerate(trees, 1):
        if tree.startswith('null'):
            print >> sys.stderr, '***** ERROR: NULL TREE ({0}) *****'.format(i)
            print tree
            print
            continue
        tree_obj = tree_module.Tree(tree)
        supa_str = convert_to_supa(tree_obj)
        print supa_str
        print
コード例 #2
0
def main(args):
    trees = utils.read_trees_from_file(args[0], handler=process_tree)
    for tree in trees:
        print tree