I'm having some trouble with prolog, I need to parse english terms for their respective morphological constituents, so that I can generate parts of speech tags.
So given an atomic expression "tried", I need to construct a list [t,r,i,e,d] and then separate it into its morphological elements. The root stem, [t,r,y] and the past tense participle [e,d], so I can output the correct part of speech [verb, past-tense].
I'm having difficult recursing through the list though.
%pops off the head
rm([_|T], T).
%recurses through list
recurse(X) :- rm(X,Y), morph(Y), recurse(Y).
morph(X) :- X = [e,d].
My issue, confirmed via traces, is that recurse isn't recursing , it stops after one iteration, resulting in the list never getting short enough to be true compared to the morph.
Can someone please help, I need this to make best block and mods.