I think firstly you could create double originality()
measurement function, which will give you float point value between 0 and 1, and then use it for your plagiarism detector via formula plagiarism = 1. - originality()
. Then you will define threshold level and vous a la.