:param value: Content for this specific node (also the deduction of the children). :param children: The children for this node. :param operator: Should the children be "And"ed or "Or"ed to create the deduction (the content of this node). :param fact_type: Explicit or
(
self,
value: str = '',
children: List['LogicNode'] = None,
operator: str = LogicNodeOperatorType.OR,
fact_type: str = LogicNodeFactType.EXPLICIT,
constraints: List[str] = (),
deduction_type: str = None,
prunable: bool = True,
can_be_leaf: bool = False,
frozen: bool = False,
)
| 67 | can_be_leaf: bool |
| 68 | |
| 69 | def __init__( |
| 70 | self, |
| 71 | value: str = '', |
| 72 | children: List['LogicNode'] = None, |
| 73 | operator: str = LogicNodeOperatorType.OR, |
| 74 | fact_type: str = LogicNodeFactType.EXPLICIT, |
| 75 | constraints: List[str] = (), |
| 76 | deduction_type: str = None, |
| 77 | prunable: bool = True, |
| 78 | can_be_leaf: bool = False, |
| 79 | frozen: bool = False, |
| 80 | ): |
| 81 | """ |
| 82 | :param value: Content for this specific node (also the deduction of the children). |
| 83 | :param children: The children for this node. |
| 84 | :param operator: Should the children be "And"ed or "Or"ed to create the deduction (the content of this node). |
| 85 | :param fact_type: Explicit or commonsense |
| 86 | :param constraints: Not used anymore (see LogicNodeConstraints) |
| 87 | :param deduction_type: Not used anymore (see LogicNodeDeductionType) |
| 88 | :param prunable: Can this node be removed from the tree (we don't prune in our datasets) |
| 89 | :param can_be_leaf: Can this node be a leaf node (usually false for nodes that you are injecting manually) |
| 90 | :param frozen: Should we add/prune children in the populate function (if frozen, no children will be added or removed, but the children may have children appended/pruned from them). |
| 91 | """ |
| 92 | self.value = value |
| 93 | if children is None: |
| 94 | children = [] |
| 95 | self.children = children |
| 96 | self.operator = operator |
| 97 | self.fact_type = fact_type |
| 98 | self.constraints = constraints |
| 99 | self.deduction_type = deduction_type |
| 100 | self.prunable = prunable |
| 101 | self.can_be_leaf = can_be_leaf |
| 102 | self.frozen = frozen |
| 103 | self.parent = None |
| 104 | |
| 105 | @property |
| 106 | def children(self): |