Re: Smart Recognition



2009/11/28 M. Bashir Al-Noimi <mbnoimi gmx com>
>
> Kai Willadsen wrote:
>
> Because I found that meld is smart I use it, but yesterday I faced something
> strange during comparing two XML files (see the attachments please).
>
> Although the first file (english.xml) is too different from the second file
> (arabic.xml) meld splits these differences in to huge blocks where they must
> be small blocks!!! (see the pic below).
>
> How I can deal with this problem? I want to make meld recognize these
> differences accurately.
>
>
> > Looking at your example comparison, I can't see the problem. It looks
> > to me like the changes between the files are correctly highlighted.
>
>
> Yep, highlighting works well but as you see in the following picture there are 11 differences in 8 lines + a fully new line
>
> I expected that meld will give me 11 blocks + a new block for the new line (<text id="RECITATION_ADDED"...) not putting all differences in single block!!!
>
> At least I expected from meld to put 2 blocks the first one for 11 modified lines and the second for the new line.

So Meld just uses existing diff algorithms to do the comparison, and
what you're seeing is what Python's difflib gives us. There are other
diff algorithms, but as far as I know none of them are going to give
you the results you want. Splitting into smaller blocks might help
comparison of translations, but I think it would be bad for other
types of comparison.

I think the only way this is likely to get fixed is to have pluggable
comparisons (or maybe just a post-comparison filtering plugin system)
to allow certain file types to be treated differently. However, I
don't think anyone is working on this at the moment.

cheers,
Kai


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]