def test_duplicate_by_transposing_and_into_letters():
    from config import get_configs
    from load_songs_tools import get_raw_data

    configs = get_configs()
    configs["augment_data"] = False
    configs["use_letternames"] = False
    seqs, syms = get_raw_data(configs)
    seqs, translation_dict = duplicate_by_transposing_and_into_letters(seqs)

    # want to store augmented_seqs
    fname_base = "%s-letters-augmented" % (configs["corpus"])

    print "...writing chord strings to file"
    fname = "%s.txt" % fname_base

    with open(fname, "w") as p:
        for seq in seqs:
            for ch in seq:
                p.write(ch + " ")
            p.write("\n")
    print ".finished writing chord strings to file"

    print "...pickling chord strings to file"
    fname = "%s.pkl" % fname_base
    with open(fname, "wb") as p:
        pickle.dump(seqs, p)
    print ".finished pickling chord strings to file"

    print "... pickling translation dict to file"
    fname = "%s-translation_dict.pkl" % fname_base
    with open(fname, "wb") as p:
        pickle.dump(translation_dict, p)
    print ".finished pickling translation dict to file"
def test_PreprocessedSeq():
    configs = get_configs()
    seqs, syms = get_raw_data(configs)
    window = configs["window"]
    seq = seqs[0]
    seq[1] = 'a'
    seq_p = PreprocessedSeq(seq, syms, configs["window"])
    data = PreprocessedData(seqs[:2], syms, window)