def get_output_filename(identifier): if output_dir is not None: return os.path.join(output_dir, \ "%s.res" % slugify(str(identifier)))
old_res = ParseResults.from_file(outfile) except ParseResults.LoadError, err: pass else: # File loaded ok: don't process this input # Mark it as complete completed_parses[input_identifier] = True continue # Mark this as incomplete completed_parses[input_identifier] = False # Get a filename for a logger for this input if parse_logger_dir: parse_logger = os.path.join(parse_logger_dir, "%s.log" % \ slugify(input_identifier)) else: parse_logger = None # Create a new copy of the options dicts for this partition input_topts = copy.deepcopy(topts) input_popts = copy.deepcopy(popts) input_npopts = copy.deepcopy(npopts) if partitions > 1: partition_num = partition_numbers[input_index] # All ModelTagger, PcfgParser and BackoffBuilder # subclasses take this option, so it's safe # to assume that if we're giving a model name we can also give # a partition number if 'model' in input_topts and input_topts['model'] is not None: