# automatically generated by the FlatBuffers compiler, do not modify

# namespace: spacy

import flatbuffers

class NERSpacyResponse(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAsNERSpacyResponse(cls, buf, offset):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = NERSpacyResponse()
        x.Init(buf, n + offset)
        return x

    # NERSpacyResponse
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # NERSpacyResponse
    def Text(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # NERSpacyResponse
    def StartChar(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # NERSpacyResponse
    def EndChar(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # NERSpacyResponse
    def Label(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

def NERSpacyResponseStart(builder): builder.StartObject(4)
def NERSpacyResponseAddText(builder, text): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(text), 0)
def NERSpacyResponseAddStartChar(builder, startChar): builder.PrependInt32Slot(1, startChar, 0)
def NERSpacyResponseAddEndChar(builder, endChar): builder.PrependInt32Slot(2, endChar, 0)
def NERSpacyResponseAddLabel(builder, label): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(label), 0)
def NERSpacyResponseEnd(builder): return builder.EndObject()
