MCPcopy
hub / github.com/nltk/nltk / get_next_token_variable

Method get_next_token_variable

nltk/sem/logic.py:362–373  ·  view source on GitHub ↗
(self, description)

Source from the content-addressed store, hash-verified

360 return accum
361
362 def get_next_token_variable(self, description):
363 try:
364 tok = self.token()
365 except ExpectedMoreTokensException as e:
366 raise ExpectedMoreTokensException(e.index, "Variable expected.") from e
367 if isinstance(self.make_VariableExpression(tok), ConstantExpression):
368 raise LogicalExpressionException(
369 self._currentIndex,
370 "'%s' is an illegal variable name. "
371 "Constants may not be %s." % (tok, description),
372 )
373 return Variable(tok)
374
375 def handle_lambda(self, tok, context):
376 # Expression is a lambda expression

Callers 3

handle_lambdaMethod · 0.95
handle_quantMethod · 0.95
handle_refsMethod · 0.45

Calls 5

tokenMethod · 0.95
VariableClass · 0.85

Tested by

no test coverage detected