Closed khituras closed 3 years ago
The test https://github.com/JULIELab/semedico/blob/121b30f69f500448bd90cff6875e7c7fe839451f/semedico-core/src/test/java/de/julielab/scicopia/core/parsing/ParserLogicalTests.java#L24 expects the correct outcome for the query blood or death and cancer to be (logical (logical (part (term blood)) or (part (term death))) and (part (term cancer))).
blood or death and cancer
(logical (logical (part (term blood)) or (part (term death))) and (part (term cancer)))
However, in boolean algebra, the conjunction has a higher operator precedence than the disjunction. Thus, death and cancer should first be engaged in the disjunction and this complex expression should then be disjuncted with blood.
death
cancer
blood
I refactored the grammar. This works now.
The test https://github.com/JULIELab/semedico/blob/121b30f69f500448bd90cff6875e7c7fe839451f/semedico-core/src/test/java/de/julielab/scicopia/core/parsing/ParserLogicalTests.java#L24 expects the correct outcome for the query
blood or death and cancer
to be(logical (logical (part (term blood)) or (part (term death))) and (part (term cancer)))
.However, in boolean algebra, the conjunction has a higher operator precedence than the disjunction. Thus,
death
andcancer
should first be engaged in the disjunction and this complex expression should then be disjuncted withblood
.