operator: int-coeffs-to-word
description:
int-coeffs-to-word ket
apply the coefficient to the word
and map the word to plural as required
examples:
-- learn some simple plurals:
plural |*> #=> |_self> _ |s>
plural |mouse> => |mice>
plural |tooth> => |teeth>
-- now put it to use:
int-coeffs-to-word (3|apple> + 2|pear> + |orange> + 7|lemon> + 3|mouse> + 2|tooth> + 9|cat>)
|3 apples> + |2 pears> + |1 orange> + |7 lemons> + |3 mice> + |2 teeth> + |9 cats>
-- now apply the list-to-words operator:
list-to-words int-coeffs-to-word (3|apple> + 2|pear> + |orange> + 7|lemon> + 3|mouse> + 2|tooth> + 9|cat>)
|3 apples, 2 pears, 1 orange, 7 lemons, 3 mice, 2 teeth and 9 cats>
see also:
list-to-words, words-to-list
plurals.sw
Home