Ok so here is what you want my recommendation would be
Instead of having text files have 1 XML file. The structure can be something like this:
xml code:
<AutoResponder>
<Word>
<Trigger>hey</Trigger>
<Response>hi</Response>
<!--
Number between 1 - 10
10 being takes precedence over all others
1 being last one selected
-->
<Priority>9</Priority>
</Word>
<Word>
<Trigger>hey mate</Trigger>
<Response>hey mate how are you?</Response>
<Priority>10</Priority>
</Word>
</AutoResponder>
What that would allow you to do is have hey mate take priority over hey so if someone were to say hey mate you would say hey how are you instead of hi.
That would be how I would develop such a feature.