How to determine the kind of mistake in a list in Prolog?
I am reaching a deadline at one of my projects and I am kind of stuck so I will need your help. The homework is all about making a spell checker in **Prolog** which will use an input of lists with letters and output the corrected lists. I will be given the correct words in a format like this:

    word([t,h,e]).
    word([h,e,l,l,o]).
    word([w,o,r,l,d]).

The errors I should check about are

 1. One letter error. Example: [t,h,a] -> [t,h,e].
 2. One letter missing. Example: [h,e,l,l] -> [h,e,l,l,o].
 3. One letter extra. Example: [w,o,l,r,l,d] -> [w,o,r,l,d]

I already have the code for each kind of correction but I have to run every single rule for each word and get multiple results of which only 1 is the correct one. Is there any way to determine what the error is in the word given and run only the appropriate rule in order to correct it?
How to determine the kind of mistake in a list in Prolog?
===

I am reaching a deadline at one of my projects and I am kind of stuck so I will need your help. The homework is all about making a spell checker in **Prolog** which will use an input of lists with letters and output the corrected lists. I will be given the correct words in a format like this:

    word([t,h,e]).
    word([h,e,l,l,o]).
    word([w,o,r,l,d]).

The errors I should check about are

 1. One letter error. Example: [t,h,a] -> [t,h,e].
 2. One letter missing. Example: [h,e,l,l] -> [h,e,l,l,o].
 3. One letter extra. Example: [w,o,l,r,l,d] -> [w,o,r,l,d]

I already have the code for each kind of correction but I have to run every single rule for each word and get multiple results of which only 1 is the correct one. Is there any way to determine what the error is in the word given and run only the appropriate rule in order to correct it?