Download 19/libtextclassifier3/CapturingGroup.py from dejanseo/chrome_models: direct link, hf CLI and curl.
- Browser
- Download file 3.43 kB
-
https://huggingface.co/dejanseo/chrome_models/resolve/refs%2Fpr%2F13/19/libtextclassifier3/CapturingGroup.py
- Command line
-
hf download hf://dejanseo/chrome_models@refs/pr/13/19/libtextclassifier3/CapturingGroup.py
-
curl -L -o CapturingGroup.py https://huggingface.co/dejanseo/chrome_models/resolve/refs%2Fpr%2F13/19/libtextclassifier3/CapturingGroup.py
3.43 kB
| # 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'] | |
| def GetRootAsCapturingGroup(cls, buf, offset): | |
| n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) | |
| x = CapturingGroup() | |
| x.Init(buf, n + offset) | |
| return x | |
| 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() | |