-3

I am required to include a plagiarism detection feature in my final year project: A final year projects portal for my school.

I am using PHP/MySQL and I need code that will help me check this by comparing the content of two text boxes.

RohitWagh
  • 1,853
  • 3
  • 22
  • 41
prinsobed
  • 9
  • 4
  • 7
    Hi. Stackoverflow isn't really intended to be a "Please write some code for me" site. Get started on your project, and then if you have difficulties with your code along the way this is a great place to ask specific programming questions! – Pointy Dec 15 '11 at 17:16
  • You're probably not going to get a good answer to this question. Most of us write projects like this for a living. – Brian Hoover Dec 15 '11 at 17:17
  • What have you tried so far? I doubt anyone is going to simply do your homework for you, but if you show a bit of effort you might pick up some help. – graphicdivine Dec 15 '11 at 17:17
  • 1
    Shouldn't you at least be trying you final year project before asking others to do it for you? – Indranil Dec 15 '11 at 17:23
  • Levenshtein_distance :: http://en.wikipedia.org/wiki/Levenshtein_distance – Mob Dec 15 '11 at 17:24
  • 1
    When your question is homework related please ensure you use the 'homework' tag also. – Ryan Dec 15 '11 at 17:24
  • Think about your problem scope. Detection of code plagiarism is different than detection of written text plagiarism. Google "moss plagiarism" for an example of the former. For scoping the latter: I could plagiarize an entire essay via the internet, and unless someone else in your class turns in the same essay, how do you propose to catch me? Are you only interested in pair-wise detection within a class? – ccoakley Dec 15 '11 at 17:42

3 Answers3

2

I down vote your answer, to be fair. But i will help you anyway.

What @Robert told you is good, but in my opinion, in today web 2.0 world, do an ajax request everytime the user type something in a form to check if two strings are similar, is a no go.

So you can use similar_text ported by the php.js project and do it using javascript (i saw the tag in your question).

But here you are talking about plagiarism so maybe you are talkin more about papers/works than just "two text boxes". Maybe you will need more complex algorithms, if so, take a look to the stackoverflow question Algorithm to find similar text

Good luck

Community
  • 1
  • 1
Gonza
  • 380
  • 2
  • 12
1

Check out this answer: Any easy way to check if two or more characters are equal when comparing a four character string?

Using the similar_text() function in PHP will give you a percentage and you can use that to evaluate if they are similar.

Here is the reference for the method: http://php.net/manual/en/function.similar-text.php

Community
  • 1
  • 1
Robert
  • 3,066
  • 3
  • 23
  • 32
1

You can use the levenshtein method of comparing two strings (there's a native PHP function of the same name). It returns the number of substitutions required to convert string A to string B, therefore the lower the number the higher the similarity.

Graham
  • 6,306
  • 2
  • 34
  • 38