b._patiencediff_py : module documentation

Part of bzrlib

No module docstring
Function unique_lcs_py Find the longest common subset for unique lines.
Function recurse_matches_py Find all of the matching text in the lines of a and b.
Function _collapse_sequences Find sequences of lines.
Function _check_consistency Undocumented
def unique_lcs_py(a, b):
Find the longest common subset for unique lines.

This only matches lines which are unique on both sides. This helps prevent common lines from over influencing match results. The longest common subset uses the Patience Sorting algorithm: http://en.wikipedia.org/wiki/Patience_sorting

ParametersaAn indexable object (such as string or list of strings)
bAnother indexable object (such as string or list of strings)
ReturnsA list of tuples, one for each line which is matched. [(line_in_a, line_in_b), ...]
def recurse_matches_py(a, b, alo, blo, ahi, bhi, answer, maxrecursion):
Find all of the matching text in the lines of a and b.
ParametersaA sequence
bAnother sequence
aloThe start location of a to check, typically 0
ahiThe start location of b to check, typically 0
ahiThe maximum length of a to check, typically len(a)
bhiThe maximum length of b to check, typically len(b)
answerThe return array. Will be filled with tuples indicating [(line_in_a, line_in_b)]
maxrecursionThe maximum depth to recurse. Must be a positive integer.
ReturnsNone, the return value is in the parameter answer, which should be a list
def _collapse_sequences(matches):
Find sequences of lines.

Given a sequence of [(line_in_a, line_in_b),] find regions where they both increment at the same time

def _check_consistency(answer):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.