CHAPTER 5
Word Structure and Verb Endings
5.1 Word Stem and Verb Endings
In processing the input text it would be helpful to be able to recognise word stems within different versions of the same word. For example it would be helpful to be able to recognise move, moved, moving and moves as different versions of the same word stem (move). This would avoid needing to store explicit interpretations of all versions. In addition it would be helpful to be able to recognise the various endings which are tacked on to the word stem so that we can take account of the extra information provided by these word endings.
Irregular verbs are harder to deal with, but it would greatly reduce the volume of work if we could deal with regular verbs in a consistent way.
5.2 POPll Programs for Processing Stems
POP11 provides us with facilities for dealing with these problems.
destword(" Cred");
will place on the stack the individual characters of the word "fred", and in addition an integer giving the length of the word. Thus after execution of destword("fred") the status of the stack will be as shown on the illustration below:

The command destword("fred")- >n; will remove the integer 4 and assign it to n. Knowing the number of items on the stack we can then remove and test them in turn to detect the presence of the various word endings. What remains on the stack will be the word stem.
The function 'consword' reverses the operation of'destword' to create a word of given length from the individual characters stored on the stack. For example, if we have just completed the procedure:
destword(" fred ")- >n;
so that the stack contains the characters 'f' ,'r' ,'e' ,'d' (reading from the bottom upwards) then the call:
consword(3)- >w;
will assign to w the word "red", leaving behind the character 'f'. The requirements which are additional to these facilities consist of three functions. The function 'top_of_stack(n)' is similar to consword(n) except that it restores the stack to the condition it was in before the call by replacing the characters used from the stack. The function 'stem(n)' is also similar to consword(n) except that it discards the character 'e' if that is the top character on the stack. The function 'stem_end(w)', where w is a word, leaves two results on the stack. These are the word stem and the word ending (both formed into words). It works only ifw is more than 3 characters long. It recognises only the word endings's', 'ed' and 'ing'. It always removes a final 'e' from the word stem it creates. If the word w has no recognisable ending then the function creates for it the dummy ending 'none', and it still strips the fmal 'e' off the word itself.

The reader is invited to implement this function and to try it out on a number of verbs. The result left on the stack should be the verb stem with the verb ending above it, e.g.:

The (move,moved,moving) example illustrates a problem with this simpleminded approach. The endings are not simply tacked on to the end of verb stem but take into account the termination of the verb stem. One solution is to strip off the final 'e' on any verb stem and use this reduced version as the true stem. In this case the verb stem of "move" would be "mov" in all cases. If we did not strip off the final 'e' we would find that the stem of "move" = "move", while the stem of "moving" = "mov". The function stel1L.end is obviously fairly crude, and the reader is invited to develop more sophisticated functions to deal with more alternatives.
5.3 Irregular Verbs
The 'stel1L.end' function will, of course, only operate successfully on regular verbs. Irregular verbs could be dealt with by listing the stems and endings explicitly. In the table below we provide the 'regular' verb endings for the irregular verbs, and in this way force them into conformity with the regular verbs. Thus when the verb "ran" is used, our stel1L.end function will yield the result stem = "run", ending = "ed". This means that any function which makes use of the stel1L.end function will not need to make special provision for irregular verbs.
