Module diffy

Diffy, an erlang diff match and patch implementation.

Copyright © 2014-2019 Maas-Maarten Zeeman

Authors: Maas-Maarten Zeeman (mmzeeman@xs4all.nl).

Description

Diffy, an erlang diff match and patch implementation

Copyright 2014-2019 Maas-Maarten Zeeman

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Erlang diff-match-patch implementation

Data Types

diff()

diff() = {diff_op(), unicode:unicode_binary()}

diff_op()

diff_op() = delete | equal | insert

diffs()

diffs() = [diff()]

Function Index

cleanup_efficiency/1Do efficiency cleanup of diffs.
cleanup_efficiency/2
cleanup_merge/1
cleanup_semantic/1Do semantic cleanup of diffs.
destination_text/1Compute the destination text from a list of diffs.
diff/2Compute the difference between two binary texts.
diff_bisect/2
diff_linemode/2
levenshtein/1Compute the Levenshtein distance, the number of inserted, deleted or substituted characters.
make_patch/1create a patch from a list of diffs.
make_patch/2create a patch from the source and destination texts.
pretty_html/1Convert the diffs into a pretty html report.
source_text/1Compute the source text from a list of diffs.
split_pre_and_suffix/2
text_size/1Count the number of characters in a utf8 binary.
unique_match/2Returns true iff Pattern is a unique match inside Text.

Function Details

cleanup_efficiency/1

cleanup_efficiency(Diffs::diffs()) -> diffs()

Do efficiency cleanup of diffs.

cleanup_efficiency/2

cleanup_efficiency(Diffs, EditCost) -> any()

cleanup_merge/1

cleanup_merge(Diffs::diffs()) -> diffs()

cleanup_semantic/1

cleanup_semantic(Diffs::diffs()) -> diffs()

Do semantic cleanup of diffs

destination_text/1

destination_text(Diffs) -> any()

Compute the destination text from a list of diffs.

diff/2

diff(Text1::unicode:unicode_binary(), Text2::unicode:unicode_binary()) -> diffs()

Compute the difference between two binary texts

diff_bisect/2

diff_bisect(A, B) -> any()

diff_linemode/2

diff_linemode(Text1, Text2) -> any()

levenshtein/1

levenshtein(Diffs) -> any()

Compute the Levenshtein distance, the number of inserted, deleted or substituted characters.

make_patch/1

make_patch(Diffs) -> any()

create a patch from a list of diffs

make_patch/2

make_patch(SourceText, DestinationText) -> any()

create a patch from the source and destination texts

pretty_html/1

pretty_html(Diffs::diffs()) -> iolist()

Convert the diffs into a pretty html report

source_text/1

source_text(Diffs) -> any()

Compute the source text from a list of diffs.

split_pre_and_suffix/2

split_pre_and_suffix(Text1, Text2) -> any()

text_size/1

text_size(Text) -> any()

Count the number of characters in a utf8 binary.

unique_match/2

unique_match(Pattern, Text) -> any()

Returns true iff Pattern is a unique match inside Text.


Generated by EDoc