import sys from gender.gender_run import main as gender_run from fishy.preprocess import preprocess as fishy_preprocess from crm.preprocess_corpus import preprocess as crm_preprocess_corpus def preprocess(language): r = raw_input( "Would you like to preprocess all stimuli? It will take approx. 5 min. (Y/n): ") if r.lower() == 'y': pass elif r.lower() == 'n': sys.exit() else: raise "That is not a valid option." print "==== Preprocessing for fishy ====" try: fishy_preprocess(language) except: raise Exception("There was an error with fishy preprocess.") print "==== Preprocessing for Gender ====" try: options = {} gender_run(options, "generation", "test", language) except: raise Exception( "There was an error preporocessing the gender stimuli.") print "==== Preprocessing for CRM ====" try: crm_preprocess_corpus("all", language, 0) except: raise Exception("There was an error preprocessing the CRM corpus.") print "Preprocessing completed." print "Calibration must still be performed." if __name__ == "__main__": import argparse parser = argparse.ArgumentParser() parser.add_argument("--language", "-l", help="Language for preprocessing", required=True) args = parser.parse_args() preprocess(args.language)