Code:
on *:text:*:#: {
var %x = 1
while (%x <= $numtok($strip($1-),32)) {
var %y = 1
while (%y <= $lines(textfile.txt)) {
if ($read(textfile.txt, %y) == $gettok($strip($1-),%x,32)) || ($read(textfile.txt, %y) == $gettok($strip($1-),$+(%x,-,$numtok($read(textfile.txt, %y),32)),32)) {
msg $chan Test!!!
}
inc %y
}
inc %x
}
}

Tested. It works for sentences aswell.
I mean it will work if the textfile.txt line is test but it will also work if it is more than one word.