Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS library gives wrong result. #110

Open
GoogleCodeExporter opened this issue Aug 4, 2015 · 0 comments
Open

JS library gives wrong result. #110

GoogleCodeExporter opened this issue Aug 4, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

var context = "It's easy as pie to use Mathjax. You just need to study and 
remember how to use $$ and $$$. As you can see, it's not that hard. So, let's 
try something a bit more complicated.\nHere was a line break with two spaces. 
Not that hard, right, grandpa?";
var anchorText = "just need to study and remember how to use $$ and";
var dmp = new diff_match_patch();
dmp.Match_MaxBits = 100;
var offset = dmp.match_main(context, anchorText, 60);
// offset = 69
// meaning: the match starts with "how to use $$ and $$$. As you can see,"

What is the expected output? What do you see instead?

I think offset should be 37, since that'll result in a perfect match. I also 
can't figure out a way to change Distance or Threshold parameters to cause that 
to happen. The only thing that works is changing the guess parameter ("60") to 
be smaller / closer to "37", but I unfortunately don't have that information 
for a generic case.

What version of the product are you using? On what operating system?
JavaScript; latest version

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 19 Jul 2015 at 8:35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant