开发者

How to determine a match between 2 JSONs?

I have two data sources, and both of them return JSONs.

I want to ensure that there is some perce开发者_运维百科ntage of match (overlap of data, if you will) in the two JSONs, so as to collate them and store in a single record.

Is comparing the entropy of the two strings the best way? Are there any other solutions? I use Java, and could also use scala for the same.


You can convert them to xml and then use xdiff algorithm, or put every json record to a single line, and use unix diff. Or convert it to an internal tree representation, and apply parallel tree difference algorithm. That depends on what kind of difference are you looking for and doesn't depend on the implementation language.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜