Wednesday, April 16, 2014

Attatching endings to words, with SMUP

(w1#(NN)) (w1#(w1 & "ing")) (eval(w1)) 

This tiny piece of code shows you how you can turn a NOUN (NN) into a GERUND (VBG).

The first line: (w1#(NN))

w1 is our variable. We assign with the # operator. NN is the function which generates a random noun from the dictionary.

Then we reassign w1 = w1 + "ing" which in SMUP is..

(w1#(w1 & "ing"))

No comments:

Post a Comment