Skip to content

Add option to split alignment output based on maximum character length #88

@gerazov

Description

@gerazov

This would be useful for looking at alignments of long sentences, e.g.:

    out = jiwer.process_words(
        "This is a very long sentence that is much longer than the previous one or the one before that",
        "This is a very loong sentence that is not much longer than the previous one or one before that",
        )

    print(jiwer.visualize_alignment(out, max_chars=80))

Would output:

sentence 1
REF: This is a very  long sentence that is *** much longer than the previous one
HYP: This is a very loong sentence that is not much longer than the previous one
                        S                    I

REF: or the one before that
HYP: or *** one before that
          D

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions