MCPcopy Create free account
hub / github.com/LHRLAB/ChatKBQA / CompNode

Class CompNode

components/expr_parser.py:153–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151
152# lt le gt ge
153class CompNode(ASTNode):
154 PROMPT_DICT = {
155 'gt': 'greater than',
156 'ge': 'greater equal',
157 'lt': 'less than',
158 'le': 'less equal',
159 }
160
161 def __init__(self, val, data_type, fields):
162 super().__init__('COMP', val, data_type, fields)
163
164 def textual_form_core(self):
165 prompt = CompNode.PROMPT_DICT[self.val]
166 return ' '.join([self.fields[0].textual_form(), prompt, self.fields[1].textual_form()])
167
168class EntityNode(ASTNode):
169 def __init__(self, val, data_type, fields):

Callers 1

buildMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected