ANSWER TO EXERCISE 59 | |
Create a new property adjective, and move names which are adjectives to it: for instance, name "tomato" "vegetable", adjective 'fried' 'green' 'cooked',(Recall that dictionary words can only be written in " quotes for the name property.) Then (using the same IsAWordIn routine), [ ParseNoun obj n m; while (IsAWordIn(NextWord(),obj,adjective) == 1) n++; wn--; while (IsAWordIn(NextWord(),obj,noun) == 1) m++; if (m==0) return 0; return n+m; ]; |