| | |
| |
|
| | |
| |
|
| | import flatbuffers |
| | from flatbuffers.compat import import_numpy |
| | np = import_numpy() |
| |
|
| | class CapturingGroup(object): |
| | __slots__ = ['_tab'] |
| |
|
| | @classmethod |
| | def GetRootAsCapturingGroup(cls, buf, offset): |
| | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) |
| | x = CapturingGroup() |
| | x.Init(buf, n + offset) |
| | return x |
| |
|
| | @classmethod |
| | def CapturingGroupBufferHasIdentifier(cls, buf, offset, size_prefixed=False): |
| | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x43\x32\x20", size_prefixed=size_prefixed) |
| |
|
| | |
| | def Init(self, buf, pos): |
| | self._tab = flatbuffers.table.Table(buf, pos) |
| |
|
| | |
| | def ExtendSelection(self): |
| | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) |
| | if o != 0: |
| | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) |
| | return True |
| |
|
| | |
| | def EntityFieldPath(self): |
| | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) |
| | if o != 0: |
| | x = self._tab.Indirect(o + self._tab.Pos) |
| | from libtextclassifier3.FlatbufferFieldPath import FlatbufferFieldPath |
| | obj = FlatbufferFieldPath() |
| | obj.Init(self._tab.Bytes, x) |
| | return obj |
| | return None |
| |
|
| | |
| | def SerializedEntityData(self): |
| | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| | if o != 0: |
| | return self._tab.String(o + self._tab.Pos) |
| | return None |
| |
|
| | |
| | def NormalizationOptions(self): |
| | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) |
| | if o != 0: |
| | x = self._tab.Indirect(o + self._tab.Pos) |
| | from libtextclassifier3.NormalizationOptions import NormalizationOptions |
| | obj = NormalizationOptions() |
| | obj.Init(self._tab.Bytes, x) |
| | return obj |
| | return None |
| |
|
| | |
| | def EntityData(self): |
| | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) |
| | if o != 0: |
| | x = self._tab.Indirect(o + self._tab.Pos) |
| | from libtextclassifier3.EntityData import EntityData |
| | obj = EntityData() |
| | obj.Init(self._tab.Bytes, x) |
| | return obj |
| | return None |
| |
|
| | def CapturingGroupStart(builder): builder.StartObject(5) |
| | def CapturingGroupAddExtendSelection(builder, extendSelection): builder.PrependBoolSlot(0, extendSelection, 1) |
| | def CapturingGroupAddEntityFieldPath(builder, entityFieldPath): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(entityFieldPath), 0) |
| | def CapturingGroupAddSerializedEntityData(builder, serializedEntityData): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(serializedEntityData), 0) |
| | def CapturingGroupAddNormalizationOptions(builder, normalizationOptions): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(normalizationOptions), 0) |
| | def CapturingGroupAddEntityData(builder, entityData): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(entityData), 0) |
| | def CapturingGroupEnd(builder): return builder.EndObject() |
| |
|