Ejemplo n.º 1
0
def _mini_diff(k, args, old_doc, new_doc, span):
    """
    Return lines of text to be printed out, showing how the nudge
    affected the text
    """
    mini_old_doc = narrow_to_span(old_doc, span)
    mini_new_doc = narrow_to_span(new_doc, span)
    return [
        "======= SPLIT AT TURN {} in {} ========".format(args.turn, k), "...",
        show_diff(mini_old_doc, mini_new_doc), "...", ""
    ]
Ejemplo n.º 2
0
def _mini_diff(k, old_doc, new_doc, span):
    """
    Return lines of text to be printed out, showing how the EDU
    split affected the text
    """
    mini_old_doc = narrow_to_span(old_doc, span)
    mini_new_doc = narrow_to_span(new_doc, span)
    return [
        "======= MERGE EDUS %s ========" % (k), "...",
        show_diff(mini_old_doc, mini_new_doc), "...", ""
    ]
Ejemplo n.º 3
0
def _mini_diff(k, old_doc, new_doc, span):
    """
    Return lines of text to be printed out, showing how the EDU
    split affected the text
    """
    mini_old_doc = narrow_to_span(old_doc, span)
    mini_new_doc = narrow_to_span(new_doc, span)
    return ["======= SPLIT EDU %s ========" % (k),
            "...",
            show_diff(mini_old_doc, mini_new_doc),
            "...",
            ""]
Ejemplo n.º 4
0
def _mini_diff(k, args, old_doc, new_doc, span):
    """
    Return lines of text to be printed out, showing how the nudge
    affected the text
    """
    mini_old_doc = narrow_to_span(old_doc, span)
    mini_new_doc = narrow_to_span(new_doc, span)
    return ["======= SPLIT AT TURN {} in {} ========".format(args.turn, k),
            "...",
            show_diff(mini_old_doc, mini_new_doc),
            "...",
            ""]
Ejemplo n.º 5
0
def _mini_diff(k, args, old_doc, new_doc, span):
    """
    Return lines of text to be printed out, showing how the nudge
    affected the text
    """
    mini_old_doc = narrow_to_span(old_doc, span)
    mini_new_doc = narrow_to_span(new_doc, span)
    return ["======= NUDGE TURN %d %s in %s ========" %
            (args.turn, args.direction, k),
            "...",
            show_diff(mini_old_doc, mini_new_doc),
            "...",
            ""]
Ejemplo n.º 6
0
def _mini_diff(k, old_doc_span, new_doc_span):
    """
    Return lines of text to be printed out, showing how the nudge
    affected the text
    """
    old_doc, old_span = old_doc_span
    new_doc, new_span = new_doc_span
    interesting_span = _enclosing_turn_span(old_doc, old_span)
    mini_old_doc = narrow_to_span(old_doc, interesting_span)
    mini_new_doc = narrow_to_span(new_doc, interesting_span)
    return [
        "======= NUDGE %s to %s in %s ========" % (old_span, new_span, k),
        "...",
        show_diff(mini_old_doc, mini_new_doc), "...", ""
    ]
Ejemplo n.º 7
0
def _mini_diff(k, old_doc_span, new_doc_span):
    """
    Return lines of text to be printed out, showing how the nudge
    affected the text
    """
    old_doc, old_span = old_doc_span
    new_doc, new_span = new_doc_span
    interesting_span = _enclosing_turn_span(old_doc, old_span)
    mini_old_doc = narrow_to_span(old_doc, interesting_span)
    mini_new_doc = narrow_to_span(new_doc, interesting_span)
    return ["======= NUDGE %s to %s in %s ========" % (old_span, new_span, k),
            "...",
            show_diff(mini_old_doc, mini_new_doc),
            "...",
            ""]
Ejemplo n.º 8
0
def commit_msg(info):
    """
    Generate a commit message describing the operation
    we just did
    """
    k = info.key
    mini_new_doc = narrow_to_span(info.after, info.span)

    lines = [
        "{}_{}: split dialogue before turn {}".format(k.doc, k.subdoc,
                                                      info.tid), "",
        annotate_doc(mini_new_doc), "..."
    ]
    return "\n".join(lines)
Ejemplo n.º 9
0
def commit_msg(info):
    """
    Generate a commit message describing the operation
    we just did
    """
    k = info.key
    mini_new_doc = narrow_to_span(info.after, info.span)

    lines = ["{}_{}: split dialogue before turn {}".format(
        k.doc, k.subdoc, info.tid),
             "",
             annotate_doc(mini_new_doc),
             "..."]
    return "\n".join(lines)
Ejemplo n.º 10
0
def commit_msg(info):
    """
    Generate a commit message describing the operation
    we just did
    """
    k = info.key
    mini_new_doc = narrow_to_span(info.after, info.span)

    lines = ["%s_%s: move turn %d %s" % (k.doc, k.subdoc,
                                         info.tid, info.direction),
             "",
             annotate_doc(mini_new_doc),
             "..."]
    return "\n".join(lines)