Hello,
I wanted to know how do we compare a sentence from a file with links obtained from the internet.
I have already done the following things:
1. Upload a file
2. File is stored on hard disk
3. Use the file
4. Read the file
5. Extract the sentences
6. Send them to google
7. Return the links (results)
Now , i want to compare the sentences with the links obtained so as to determine plagiarism.
i.e if the sentence matches the link exactly
then plagarism
store those links
else no plagiarism
discard the other links
Can anyone help plz? Provide some ideas of how to implement this part.
Best Regards,
Natasha
Loading
kiran kumarPosted Feb 17, 2010, 3:28 AM
Sam HobbsPosted Feb 17, 2010, 3:09 AM
For each document, create an array of words, so that you can quickly move from a word to the next and/or previous word. Then create a map of words to a list of index values for the appearances of the word. For words in the suspected (student's) document, find the occurences in the potentially matching document(s) and then check for matches of surrounding words.
I think that will work. You will want to ignore some words, such as "a" and "the", at least for the beginning of matching sequences, but I assume you can figure that out.