Coder Social home page Coder Social logo

diff.match.patch's People

Contributors

pocketberserker avatar smoothdeveloper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

diff.match.patch's Issues

Need sample for pretty printing

I'd like to use this great library to help with failing unit tests comparing expected/actual string values.

I'd like the diff to be pretty printed pretty much like github shows with each line prefixed with + and - and few lines of context around each diff.

I figured out how to use the library to get the list of diff but couldn't figure out how to implement the appropriate pretty-printing to do what I described.

I'd appreciate minimal code sample to do that!

comparing two textbox string issue

I am comparing two string

problem is that not get expected output

when I enter run time:

This is my testing for matching algoritham - first string

This is my testing for matchings algoritham for application by website - second string

see my output:

image

when I remove the is keyword then I dont want to display in param1:

what I want to:

testing matching
testings matchings

WebForm1.aspx.cs

       protected void Button1_Click(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                Label1.Text = "";
                Label2.Text = "";
            }
     
            var slist = stextbox.Text.Split(' ');
            var flist = ftextbox.Text.Split(' ');

            int minWordCount = Math.Min(slist.Length, flist.Length);

            var diffWords = slist.Take(minWordCount).Where(x => flist.Contains(x) == false).ToList();

            var diffWordsf = flist.Take(minWordCount).Where(x => slist.Contains(x) == false).ToList();

           Label2.Text = "param2:" + string.Join("  ", diffWords);

            Label1.Text = "param1:" + string.Join("  ", diffWordsf);
        } 
     }

.aspx

<asp:TextBox ID="ftextbox" runat="server" TextMode="MultiLine" Width="500px" Height="200px"></asp:TextBox>
<asp:TextBox ID="stextbox" runat="server" TextMode="MultiLine" Width="500px" Height="200px"></asp:TextBox>

please help

FSharp.Core dependency

The code requires the FSharp.Core library which hasn't been referenced after adding Diff.Match.Patch to my project using NuGet.

There might be a missing dependency information in the .nuspec file.

PatchFromText fails to round trip

This example throws an exception. Version is 2.0.1 from NuGet. The exception is System.ArgumentException: Invalid patch string: @@ -5,12 +5,18 @@

const string text1 = "this is some example text";
const string text2 = "this is not really example text";

var patches = DiffMatchPatchModule.Default.PatchMake(text1, text2);
var patchString = DiffMatchPatchModule.Default.PatchToText(patches);
var roundtrip = DiffMatchPatchModule.Default.PatchFromText(patchString);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.