kpdecker / jsdiff

A javascript text differencing implementation.
BSD 3-Clause "New" or "Revised" License
8.17k stars 503 forks source link

Diffword function is no longer able to find similar excerpts already found when I add text #527

Closed Philrobots closed 3 months ago

Philrobots commented 5 months ago

I have 2 text that I want to compare with the diffWord function

Old text :

The General Court, informally known as the European General Court (EGC), is a constituent court of the [Court of Justice of the European Union](https://en.wikipedia.org/wiki/Court_of_Justice_of_the_European_Union). It hears actions taken against the institutions of the European Union by individuals and member states, although certain matters are reserved for the [European Court of Justice](https://en.wikipedia.org/wiki/European_Court_of_Justice). Decisions of the General Court can be appealed to the Court of Justice, but only on a point of law. Prior to the coming into force of the [Lisbon Treaty](https://en.wikipedia.org/wiki/Lisbon_Treaty) on 1 December 2009, it was known as the Court of First Instance.

New text

The court also acts as an administrative and constitutional court between the other EU institutions and the Member States and can annul or invalidate unlawful acts of EU institutions, bodies, offices and agencies.The General Court is a constituent court of the European Union. It hears actions taken against the institutions of the European Union by individuals and member states, although certain matters are reserved for the Court of Justice. Decisions of the General Court can be appealed to the Court of Justice, but only on a point of law. Prior to the coming into force of the Lisbon Treaty on 1 December 2009, it was known as the Court of First Instance.Additional branchesThe European Central Bank (ECB) is one of the institutions of the monetary branch of the European Union, the prime component of the Eurosystem and the European System of Central Banks. It is one of the world's most important central banks. The ECB Governing Council makes monetary policy for the Eurozone and the European Union, administers the foreign exchange reserves of EU member states, engages in foreign exchange operations, and defines the intermediate monetary objectives and key interest rate of the EU.

Now, when I add a lot of text in the first text, I add nearly 20,000 characters, it no longer finds the same similarities ...

Does it have an explanation?

ExplodingCabbage commented 3 months ago

Sounds like the issue I fixed in https://github.com/kpdecker/jsdiff/pull/497; fix just isn't released yet.