def trans2pairs(trans):
    """
    Makes strings and triples of rules in transitions

    Arguments
    trans : the transitions (bigrams), no probs

    Returns
    list of ("a,b", (a,b)) pairs
    """

    bigrams=[]
    for lhs in trans:
        for rhs in trans[lhs]:
            bigrams.append(('%s,%s'%(lhs,rhs),(lhs,rhs)))

    return bigrams