word_freq($t2,$sample) ? $analyser[0]++ : $analyser[1]++; word_freq($t1,$sample) > word_freq($t2,$sample) ? $analyser2[0]++ : $analyser2[1]++; for($i = 2; $i <= $num_funcs; $i++){ calculate_point ($stats[0][$i], $stats[1][$i], $stats[2][$i], $analyser); calculate_point2($stats[0][$i], $stats[1][$i], $stats[2][$i], $analyser2); } ?>
This was done as a school assignment (Applied Artificial Intelligence at Blekinge Institute of Technology).
The idea is to load two texts and save the characteristics. You then provide a sample from one of the texts. I then should be able to decide from which one of the two text your sample comes from.
Text | Word count | Name | Word length | Sentence length | Commas | Newlines | Similiarity | Semicolons | words/ line | Quote length | Colons | Words t1 | Words t2 | $value | "; echo ""; }?>
---|
Algorithm 1: One point for the closest match.
Algorithm 2: The assigned score is the ratio between the difference of the closest and not.