Just going through the online docs with 0m03_046.
Chapter 3 talks about (collect words)
and states in the code
%% By default, include any words mentioned in the name rule:
(dict $Obj) (name $Obj)
That all makes sense to me, given what I’ve learned so far and my dabblings in Prolog. However, the generated $List
contains redundant words.
As per docs, I am expecting
The green apple can be referred to using the words [yummy green apple].
The mysterious door can be referred to using the words [oaken oak mysteriou door].
and I actually get
The green apple can be referred to using the words [yummy green apple green apple].
The mysterious door can be referred to using the words [oaken oak mysteriou door mysteriou door].
Removing the aforementioned (dict $Obj)
predicate produces expected results, but I don’t know why. Code was copy to clipboard
from the docs and built to .z5, but the same duplicated words occur in .z5, .z8, and .aastory.
I don’t see anything in the documentation code that looks like it would trigger an extra call to name #apple
(for example) which would then include those words twice in the final list. The code appears correct to me; plus even after removing the dict $Obj
predicate name #x
words are still being included, so something is adding those words to the list, but I don’t know if it’s intentional (and so, a bug in the docs) or a code bug.