Closed yhamoudi closed 9 years ago
There is dead code after the line 119 in processQuestionInfo.
Moreover, you do not use the constructors of the operators correctly in this function (and maybe somewhere else, I did not check).
List
, Intersection
, Union
, And
and Or
expect as argument a list of trees (for instance, Intersection([Resource('foo'), Missing()])
).Exists
, Last
, First
and Sort
expect as argument a single tree (for instance, First(Resource('foo'))
.There is dead code after the line 119 in processQuestionInfo.
I forgot to remove line 119 after I was looking for the bug.
Moreover, you do not use the constructors of the operators correctly in this function (and maybe somewhere else, I did not check).
How do we access to the subtree of a Sort node nf
for instance. This is not correct (?):
for u in nf.list:
...
How do we access to the subtree of a Sort node nf for instance.
nf.list
is a python list of trees if nf
is: Intersection
, Union
, And
, Or
, List
.
In this case, it is ok to iterate on nf.list
like you are doing.
nf.list
is a tree if nf
is: First
, Last
, Sort
.
In this case, you cannot iterate on nf.list
.
If I understood well what you want to do, you can simply call processQuestionInfo(nf.list, w)
.
This come from the fact that each tree represents a list of entities (for instance, (France, president, ?)
represents the list of all the presidents of France).
Thus, you give a tree to operators which take as input one list (First
, Last
, Sort
).
You give a list of trees to operators which take as input several list (Intersection
, Union
, Or
, And
).
I got really confused with this when I coded assertIncluded
...
It works! Thanks :)
Another error that i cannot solve:
List the fastest animals in the world
(test ondemo6.py
, branchreverse_predicates
):