MCPcopy Create free account
hub / github.com/RingBDStack/GDAP / get_constraint_decoder

Function get_constraint_decoder

extraction/extract_constraint.py:59–73  ·  view source on GitHub ↗
(tokenizer, type_schema, decoding_schema, source_prefix=None)

Source from the content-addressed store, hash-verified

57
58
59def get_constraint_decoder(tokenizer, type_schema, decoding_schema, source_prefix=None):
60
61 decoding_format_dict = {
62 'role': RoleConstraintDecoder,
63 'et': ETConstraintDecoder,
64 'tri': TriConstraintDecoder,
65 }
66
67 if decoding_schema in decoding_format_dict:
68 return decoding_format_dict[decoding_schema](tokenizer=tokenizer, type_schema=type_schema, source_prefix=source_prefix)
69 else:
70 raise NotImplementedError(
71 'Type Schema %s, Decoding Schema %s do not map to constraint decoder.' % (
72 decoding_schema, decoding_schema)
73 )
74
75
76class ConstraintDecoder:

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected