def create_reader(args, md, validation=False):
    if validation:
        msg = "validation"
        filename = args.dev
    else:
        msg = "training"
        filename = args.gold
    
    logger.info("Reading %s data..." % msg)
    if args.task == 'pos':
        text_reader = pos.POSReader(md, filename=filename)
        if args.suffix:
            text_reader.create_affix_list('suffix', args.suffix_size, 5)
        if args.prefix:
            text_reader.create_affix_list('prefix', args.prefix_size, 5)
            
    elif args.task.startswith('srl'):
        text_reader = srl.SRLReader(md, filename=filename, only_boundaries=args.identify, 
                                    only_classify=args.classify,
                                    only_predicates=args.predicates)
        if args.identify:
            # only identify arguments
            text_reader.convert_tags('iobes', only_boundaries=True)
            
        elif not args.classify and not args.predicates:
            # this is SRL as one step, we use IOB
            text_reader.convert_tags('iob', update_tag_dict=False)
    
    elif 'dependency' in args.task:
        text_reader = parse.DependencyReader(md, filename)
    
    else:
        raise ValueError("Unknown task: %s" % args.task)
    
    text_reader.codify_sentences()
    return text_reader
Creates and returns a TextReader object according to the task at hand.
dataset/ETHPy150Open erickrf/nlpnet/bin/nlpnet-train.py/create_reader