Parses input arguments and runs clustering algorithm.

    :param source_file_path: Required. Location of the .csv or .TextGrid file to be
        analyzed.
    :param output_path: Path to which to write the resultant csv file. If left None,
        path will be set to the source_file_path.  If set to False, no file will be
        written.
    :param phonemic: The letter used for phonetic clustering. Note: should be False if
        semantic clustering is being used.
    :param semantic: The word category used for semantic clustering. Note: should be
        False if phonetic clustering is being used.
    :param quiet: Set to True if you want to suppress output to the screen during processing.
    :param similarity_file (optional): When doing semantic processing, this is the path of
        a file containing custom term similarity scores that will be used for clustering.
        If a custom file is used, the default LSA-based clustering will not be performed.
    :param threshold (optional): When doing semantic processing, this threshold is used
        in conjunction with a custom similarity file. The value is used as a semantic
        similarity cutoff in clustering. This argument is required if a custom similarity
        file is specified.  This argument can also be used to override the built-in
        cluster/chain thresholds.

    :return data: A dictionary of measures derived by clustering the input response.

def get_duration_measures(source_file_path,
                          output_path=None,
                          phonemic=False,
                          semantic=False,
                          quiet=False,
                          similarity_file = None,
                          threshold = None):
    """Parses input arguments and runs clustering algorithm.

    :param source_file_path: Required. Location of the .csv or .TextGrid file to be
        analyzed.
    :param output_path: Path to which to write the resultant csv file. If left None,
        path will be set to the source_file_path.  If set to False, no file will be
        written.
    :param phonemic: The letter used for phonetic clustering. Note: should be False if
        semantic clustering is being used.
    :param semantic: The word category used for semantic clustering. Note: should be
        False if phonetic clustering is being used.
    :param quiet: Set to True if you want to suppress output to the screen during processing.
    :param similarity_file (optional): When doing semantic processing, this is the path of
        a file containing custom term similarity scores that will be used for clustering.
        If a custom file is used, the default LSA-based clustering will not be performed.
    :param threshold (optional): When doing semantic processing, this threshold is used
        in conjunction with a custom similarity file. The value is used as a semantic
        similarity cutoff in clustering. This argument is required if a custom similarity
        file is specified.  This argument can also be used to override the built-in
        cluster/chain thresholds.

    :return data: A dictionary of measures derived by clustering the input response.

    """

    #validate arguments here rather than where they're first passed in, in case this is used as a package
    args = Args()
    args.output_path = output_path
    args.phonemic = phonemic
    args.semantic = semantic
    args.source_file_path = source_file_path
    args.quiet = quiet
    args.similarity_file = similarity_file
    args.threshold = threshold
    args = validate_arguments(args)

    if args.phonemic:
        response_category = args.phonemic
        output_prefix = os.path.basename(args.source_file_path).split('.')[0] + "_vfclust_phonemic_" + args.phonemic
    elif args.semantic:
        response_category = args.semantic
        output_prefix = os.path.basename(args.source_file_path).split('.')[0] + "_vfclust_semantic_" + args.semantic
    else:
        response_category = ""
        output_prefix = ""

    if args.output_path:
        #want to output csv file
        target_file_path = os.path.join(args.output_path, output_prefix + '.csv')
    else:
        #no output to system
        target_file_path = False

    engine = VFClustEngine(response_category=response_category,
                      response_file_path=args.source_file_path,
                      target_file_path=target_file_path,
                      quiet = args.quiet,
                      similarity_file = args.similarity_file,
                      threshold = args.threshold
    )


    return dict(engine.measures)