dejanseo's picture
Upload 51 files
4c8c729 verified
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: libtextclassifier3
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)
# CapturingGroup
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# CapturingGroup
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
# CapturingGroup
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
# CapturingGroup
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
# CapturingGroup
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
# CapturingGroup
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()