PHP article similarity comparison, through Similar_text () comparison is a bit slow, can there be any good efficiency?

Source: Internet
Author: User
Tags xdiff
PHP article similarity comparison, through Similar_text () comparison is a bit slow, can there be any good efficiency?
If the content of the article is to be compared by storing it all in text,
Is this method feasible through Similar_text () comparisons?


Reply to discussion (solution)

This post was last edited by xuzuning on 2013-07-31 17:54:18

File difference commands that can be supplied with the operating system
Linux:diff
Window:fc
They're all done by line, and the more rows you report, the lower the natural similarity.

File difference commands that can be supplied with the operating system
Linux:diff
Window:fc
They are all processed by line, the more the number of rows reported, the lower the natural similarity is how to achieve it?

For example (window)

System ("FC 1.txt 2.txt > 3.txt"); ReadFile (' 3.txt ');

Linux also has the WC command to get the number of lines in the file

You can also use Exec to return an array of differential results directly

EXEC ("FC 1.txt 2.txt", $a);p rint_r ($a);


If you have the ability, you can also download and compile the Xdiff extension

You can also use Exec to return an array of differential results directly

EXEC ("FC 1.txt 2.txt", $a);p rint_r ($a);


If you have the ability, you can also download and compile the Xdiff extension

You can also use Exec to return an array of differential results directly
EXEC ("FC 1.txt 2.txt", $a);p rint_r ($a);


If you have the ability, you can also download and compile the Xdiff extension

You can also use Exec to return an array of differential results directly
EXEC ("FC 1.txt 2.txt", $a);p rint_r ($a);


If you have the ability, you can also download and compile the Xdiff extension

You can also use Exec to return an array of differential results directly
EXEC ("FC 1.txt 2.txt", $a);p rint_r ($a);


If you have the ability, you can also download and compile the Xdiff extension



You can also use Exec to return an array of differential results directly
EXEC ("FC 1.txt 2.txt", $a);p rint_r ($a);


If you have the ability, you can also download and compile the Xdiff extension
What should I do if I read the database table information directly, traverse the content, and compare it to the article content that needs to be compared?
If I first participle, in the comparison by similarity, write algorithm What, is it possible?
Because once the database article data volume, by the database content to deposit text, then compare, will not be too slow?

You can also use Exec to return an array of differential results directly

EXEC ("FC 1.txt 2.txt", $a);p rint_r ($a);


If you have the ability, you can also download and compile the Xdiff extension
I don't know how to do this.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.