Skip to content

Combined vs SideBySide #85

Open
Open
@stekky81

Description

@stekky81

Hi, first of all thanks for the great library, I'm finding strange differences in some paragraphs between SideBySide mode and Combined mode. Given that I am using the same configuration parameters, in Combined mode the texts are aligned in the correct way ('detailLevel' => 'word'); while in SideBySide mode no. The strange thing is that this only happens in some blocks of lines (like the one in the example below), while in others it works correctly.
The problem can be seen clearly in the third to last and penultimate lines which are not even placed side by side; however, more generally, in the rest of the paragraph the words that differ are not marked.
I'm using the last version of the library.

Screenshot 2024-07-03 at 00-32-54 Dan 001 - Dan 002

// options
$diffOptions = [
    'context' => 1,
    'ignoreCase' => true,
    'ignoreLineEnding' => true,
    'ignoreWhitespace' => true,
    'lengthLimit' => 2000,
    'fullContextIfIdentical' => true,
];

$rendererOptions = [
    'detailLevel' => 'word',
    'language' => 'eng',
    'lineNumbers' => false,
    'separateBlock' => true,
    'showHeader' => false,
    'spaceToHtmlTag' => false,
    'spacesToNbsp' => false,
    'tabSize' => 4,
    'mergeThreshold' => 0.8,
    'cliColorization' => RendererConstant::CLI_COLOR_AUTO,
    'outputTagAsString' => false,
    'jsonEncodeFlags' => \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE,
    'wordGlues' => [' ', '-'],
    'resultForIdenticals' => null,
    'wrapperClasses' => ['diff-wrapper'],
];

== Text 1 ==
Reduc’d vnto th’extreameſt miſery.
Am I the woman, whoſe inuentiue pride,
(Adorn’d like Isis,) ſcornd mortalitie?
Iſt I that left my ſence ſo without guide,
That flattery would not let him know twas I?
Ah, now I ſee, they ſcarce tell truth, that praiſe vs,
Crownes are beguild, proſperity betraies vs.
What is become of all that ſtatelie traine,
Thoſe troopes that wont attend proſperitie?
See what is left, what number doth remaine,
A tombe, two maydes, and miſerable I.
And I t’adorne their tryumphes, am reſeru’d
A captiue kept to beautifie their ſpoyles:
Whom Cæſar labours, ſo to haue preſeru’d,
And ſeekes to entertaine my life with wiles.

== Text 2 ==
Reduc’d vnto th’extreameſt miſerie?
Am I the woman whoſe inuentiue pride,
Adorn’d like Iſis, skornd mortalitie?
Is’t I would haue my frailty ſo belide
That flattery could perſwade I was not I?
Well now I ſee they but delude that praiſe vs,
Greatneſſe is mockt, proſperity betraies vs.
And we are but our ſelues, although this clowd
Of interpoſed ſmokes make vs ſeeme more:
Witneſſe theſe gallant fortune-followng traines,
Theſe Summer Swallowes of felicitie
Gone with the heate, of all see what remaines,
This monument, two maydes, and wretched I.
And I t’adorne their triumphs, am reſeru’d
A captiue kept to honor others ſpoyles,
Whom Cæſar labors ſo to haue preſeru’d,
And ſeekes to entertaine my life with wiles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionJust asking some questions

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions