org.tensorflow.metadata.v0.FeatureCoverageConstraints Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow_metadata/proto/v0/schema.proto
// Protobuf Java Version: 3.25.4
package org.tensorflow.metadata.v0;
/**
*
* Encodes vocabulary coverage constraints.
*
*
* Protobuf type {@code tensorflow.metadata.v0.FeatureCoverageConstraints}
*/
public final class FeatureCoverageConstraints extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:tensorflow.metadata.v0.FeatureCoverageConstraints)
FeatureCoverageConstraintsOrBuilder {
private static final long serialVersionUID = 0L;
// Use FeatureCoverageConstraints.newBuilder() to construct.
private FeatureCoverageConstraints(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private FeatureCoverageConstraints() {
excludedStringTokens_ =
com.google.protobuf.LazyStringArrayList.emptyList();
excludedIntTokens_ = emptyLongList();
oovStringTokens_ =
com.google.protobuf.LazyStringArrayList.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new FeatureCoverageConstraints();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.tensorflow.metadata.v0.SchemaOuterClass.internal_static_tensorflow_metadata_v0_FeatureCoverageConstraints_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.tensorflow.metadata.v0.SchemaOuterClass.internal_static_tensorflow_metadata_v0_FeatureCoverageConstraints_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.tensorflow.metadata.v0.FeatureCoverageConstraints.class, org.tensorflow.metadata.v0.FeatureCoverageConstraints.Builder.class);
}
private int bitField0_;
public static final int MIN_COVERAGE_FIELD_NUMBER = 1;
private float minCoverage_ = 0F;
/**
*
* Fraction of feature values that map to a vocab entry (i.e. are not oov).
*
*
* optional float min_coverage = 1;
* @return Whether the minCoverage field is set.
*/
@java.lang.Override
public boolean hasMinCoverage() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* Fraction of feature values that map to a vocab entry (i.e. are not oov).
*
*
* optional float min_coverage = 1;
* @return The minCoverage.
*/
@java.lang.Override
public float getMinCoverage() {
return minCoverage_;
}
public static final int MIN_AVG_TOKEN_LENGTH_FIELD_NUMBER = 2;
private float minAvgTokenLength_ = 0F;
/**
*
* Average length of tokens. Used for cases such as wordpiece that fallback
* to character-level tokenization.
*
*
* optional float min_avg_token_length = 2;
* @return Whether the minAvgTokenLength field is set.
*/
@java.lang.Override
public boolean hasMinAvgTokenLength() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* Average length of tokens. Used for cases such as wordpiece that fallback
* to character-level tokenization.
*
*
* optional float min_avg_token_length = 2;
* @return The minAvgTokenLength.
*/
@java.lang.Override
public float getMinAvgTokenLength() {
return minAvgTokenLength_;
}
public static final int EXCLUDED_STRING_TOKENS_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList excludedStringTokens_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
* String tokens to exclude when calculating min_coverage and
* min_avg_token_length. Useful for tokens such as [PAD].
*
*
* repeated string excluded_string_tokens = 3;
* @return A list containing the excludedStringTokens.
*/
public com.google.protobuf.ProtocolStringList
getExcludedStringTokensList() {
return excludedStringTokens_;
}
/**
*
* String tokens to exclude when calculating min_coverage and
* min_avg_token_length. Useful for tokens such as [PAD].
*
*
* repeated string excluded_string_tokens = 3;
* @return The count of excludedStringTokens.
*/
public int getExcludedStringTokensCount() {
return excludedStringTokens_.size();
}
/**
*
* String tokens to exclude when calculating min_coverage and
* min_avg_token_length. Useful for tokens such as [PAD].
*
*
* repeated string excluded_string_tokens = 3;
* @param index The index of the element to return.
* @return The excludedStringTokens at the given index.
*/
public java.lang.String getExcludedStringTokens(int index) {
return excludedStringTokens_.get(index);
}
/**
*
* String tokens to exclude when calculating min_coverage and
* min_avg_token_length. Useful for tokens such as [PAD].
*
*
* repeated string excluded_string_tokens = 3;
* @param index The index of the value to return.
* @return The bytes of the excludedStringTokens at the given index.
*/
public com.google.protobuf.ByteString
getExcludedStringTokensBytes(int index) {
return excludedStringTokens_.getByteString(index);
}
public static final int EXCLUDED_INT_TOKENS_FIELD_NUMBER = 4;
@SuppressWarnings("serial")
private com.google.protobuf.Internal.LongList excludedIntTokens_ =
emptyLongList();
/**
*
* Integer tokens to exclude when calculating min_coverage and
* min_avg_token_length.
*
*
* repeated int64 excluded_int_tokens = 4 [packed = true];
* @return A list containing the excludedIntTokens.
*/
@java.lang.Override
public java.util.List
getExcludedIntTokensList() {
return excludedIntTokens_;
}
/**
*
* Integer tokens to exclude when calculating min_coverage and
* min_avg_token_length.
*
*
* repeated int64 excluded_int_tokens = 4 [packed = true];
* @return The count of excludedIntTokens.
*/
public int getExcludedIntTokensCount() {
return excludedIntTokens_.size();
}
/**
*
* Integer tokens to exclude when calculating min_coverage and
* min_avg_token_length.
*
*
* repeated int64 excluded_int_tokens = 4 [packed = true];
* @param index The index of the element to return.
* @return The excludedIntTokens at the given index.
*/
public long getExcludedIntTokens(int index) {
return excludedIntTokens_.getLong(index);
}
private int excludedIntTokensMemoizedSerializedSize = -1;
public static final int OOV_STRING_TOKENS_FIELD_NUMBER = 5;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList oovStringTokens_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
* String tokens to treat as oov tokens (e.g. [UNK]). These tokens are also
* excluded when calculating avg token length.
*
*
* repeated string oov_string_tokens = 5;
* @return A list containing the oovStringTokens.
*/
public com.google.protobuf.ProtocolStringList
getOovStringTokensList() {
return oovStringTokens_;
}
/**
*
* String tokens to treat as oov tokens (e.g. [UNK]). These tokens are also
* excluded when calculating avg token length.
*
*
* repeated string oov_string_tokens = 5;
* @return The count of oovStringTokens.
*/
public int getOovStringTokensCount() {
return oovStringTokens_.size();
}
/**
*
* String tokens to treat as oov tokens (e.g. [UNK]). These tokens are also
* excluded when calculating avg token length.
*
*
* repeated string oov_string_tokens = 5;
* @param index The index of the element to return.
* @return The oovStringTokens at the given index.
*/
public java.lang.String getOovStringTokens(int index) {
return oovStringTokens_.get(index);
}
/**
*
* String tokens to treat as oov tokens (e.g. [UNK]). These tokens are also
* excluded when calculating avg token length.
*
*
* repeated string oov_string_tokens = 5;
* @param index The index of the value to return.
* @return The bytes of the oovStringTokens at the given index.
*/
public com.google.protobuf.ByteString
getOovStringTokensBytes(int index) {
return oovStringTokens_.getByteString(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) != 0)) {
output.writeFloat(1, minCoverage_);
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeFloat(2, minAvgTokenLength_);
}
for (int i = 0; i < excludedStringTokens_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, excludedStringTokens_.getRaw(i));
}
if (getExcludedIntTokensList().size() > 0) {
output.writeUInt32NoTag(34);
output.writeUInt32NoTag(excludedIntTokensMemoizedSerializedSize);
}
for (int i = 0; i < excludedIntTokens_.size(); i++) {
output.writeInt64NoTag(excludedIntTokens_.getLong(i));
}
for (int i = 0; i < oovStringTokens_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, oovStringTokens_.getRaw(i));
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeFloatSize(1, minCoverage_);
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeFloatSize(2, minAvgTokenLength_);
}
{
int dataSize = 0;
for (int i = 0; i < excludedStringTokens_.size(); i++) {
dataSize += computeStringSizeNoTag(excludedStringTokens_.getRaw(i));
}
size += dataSize;
size += 1 * getExcludedStringTokensList().size();
}
{
int dataSize = 0;
for (int i = 0; i < excludedIntTokens_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeInt64SizeNoTag(excludedIntTokens_.getLong(i));
}
size += dataSize;
if (!getExcludedIntTokensList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
excludedIntTokensMemoizedSerializedSize = dataSize;
}
{
int dataSize = 0;
for (int i = 0; i < oovStringTokens_.size(); i++) {
dataSize += computeStringSizeNoTag(oovStringTokens_.getRaw(i));
}
size += dataSize;
size += 1 * getOovStringTokensList().size();
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.tensorflow.metadata.v0.FeatureCoverageConstraints)) {
return super.equals(obj);
}
org.tensorflow.metadata.v0.FeatureCoverageConstraints other = (org.tensorflow.metadata.v0.FeatureCoverageConstraints) obj;
if (hasMinCoverage() != other.hasMinCoverage()) return false;
if (hasMinCoverage()) {
if (java.lang.Float.floatToIntBits(getMinCoverage())
!= java.lang.Float.floatToIntBits(
other.getMinCoverage())) return false;
}
if (hasMinAvgTokenLength() != other.hasMinAvgTokenLength()) return false;
if (hasMinAvgTokenLength()) {
if (java.lang.Float.floatToIntBits(getMinAvgTokenLength())
!= java.lang.Float.floatToIntBits(
other.getMinAvgTokenLength())) return false;
}
if (!getExcludedStringTokensList()
.equals(other.getExcludedStringTokensList())) return false;
if (!getExcludedIntTokensList()
.equals(other.getExcludedIntTokensList())) return false;
if (!getOovStringTokensList()
.equals(other.getOovStringTokensList())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasMinCoverage()) {
hash = (37 * hash) + MIN_COVERAGE_FIELD_NUMBER;
hash = (53 * hash) + java.lang.Float.floatToIntBits(
getMinCoverage());
}
if (hasMinAvgTokenLength()) {
hash = (37 * hash) + MIN_AVG_TOKEN_LENGTH_FIELD_NUMBER;
hash = (53 * hash) + java.lang.Float.floatToIntBits(
getMinAvgTokenLength());
}
if (getExcludedStringTokensCount() > 0) {
hash = (37 * hash) + EXCLUDED_STRING_TOKENS_FIELD_NUMBER;
hash = (53 * hash) + getExcludedStringTokensList().hashCode();
}
if (getExcludedIntTokensCount() > 0) {
hash = (37 * hash) + EXCLUDED_INT_TOKENS_FIELD_NUMBER;
hash = (53 * hash) + getExcludedIntTokensList().hashCode();
}
if (getOovStringTokensCount() > 0) {
hash = (37 * hash) + OOV_STRING_TOKENS_FIELD_NUMBER;
hash = (53 * hash) + getOovStringTokensList().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.tensorflow.metadata.v0.FeatureCoverageConstraints parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.metadata.v0.FeatureCoverageConstraints parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.tensorflow.metadata.v0.FeatureCoverageConstraints parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.metadata.v0.FeatureCoverageConstraints parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.tensorflow.metadata.v0.FeatureCoverageConstraints parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.metadata.v0.FeatureCoverageConstraints parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.tensorflow.metadata.v0.FeatureCoverageConstraints parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.tensorflow.metadata.v0.FeatureCoverageConstraints parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static org.tensorflow.metadata.v0.FeatureCoverageConstraints parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.tensorflow.metadata.v0.FeatureCoverageConstraints parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static org.tensorflow.metadata.v0.FeatureCoverageConstraints parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.tensorflow.metadata.v0.FeatureCoverageConstraints parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(org.tensorflow.metadata.v0.FeatureCoverageConstraints prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Encodes vocabulary coverage constraints.
*
*
* Protobuf type {@code tensorflow.metadata.v0.FeatureCoverageConstraints}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:tensorflow.metadata.v0.FeatureCoverageConstraints)
org.tensorflow.metadata.v0.FeatureCoverageConstraintsOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.tensorflow.metadata.v0.SchemaOuterClass.internal_static_tensorflow_metadata_v0_FeatureCoverageConstraints_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.tensorflow.metadata.v0.SchemaOuterClass.internal_static_tensorflow_metadata_v0_FeatureCoverageConstraints_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.tensorflow.metadata.v0.FeatureCoverageConstraints.class, org.tensorflow.metadata.v0.FeatureCoverageConstraints.Builder.class);
}
// Construct using org.tensorflow.metadata.v0.FeatureCoverageConstraints.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
minCoverage_ = 0F;
minAvgTokenLength_ = 0F;
excludedStringTokens_ =
com.google.protobuf.LazyStringArrayList.emptyList();
excludedIntTokens_ = emptyLongList();
oovStringTokens_ =
com.google.protobuf.LazyStringArrayList.emptyList();
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.tensorflow.metadata.v0.SchemaOuterClass.internal_static_tensorflow_metadata_v0_FeatureCoverageConstraints_descriptor;
}
@java.lang.Override
public org.tensorflow.metadata.v0.FeatureCoverageConstraints getDefaultInstanceForType() {
return org.tensorflow.metadata.v0.FeatureCoverageConstraints.getDefaultInstance();
}
@java.lang.Override
public org.tensorflow.metadata.v0.FeatureCoverageConstraints build() {
org.tensorflow.metadata.v0.FeatureCoverageConstraints result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public org.tensorflow.metadata.v0.FeatureCoverageConstraints buildPartial() {
org.tensorflow.metadata.v0.FeatureCoverageConstraints result = new org.tensorflow.metadata.v0.FeatureCoverageConstraints(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(org.tensorflow.metadata.v0.FeatureCoverageConstraints result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.minCoverage_ = minCoverage_;
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.minAvgTokenLength_ = minAvgTokenLength_;
to_bitField0_ |= 0x00000002;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
excludedStringTokens_.makeImmutable();
result.excludedStringTokens_ = excludedStringTokens_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
excludedIntTokens_.makeImmutable();
result.excludedIntTokens_ = excludedIntTokens_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
oovStringTokens_.makeImmutable();
result.oovStringTokens_ = oovStringTokens_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.tensorflow.metadata.v0.FeatureCoverageConstraints) {
return mergeFrom((org.tensorflow.metadata.v0.FeatureCoverageConstraints)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.tensorflow.metadata.v0.FeatureCoverageConstraints other) {
if (other == org.tensorflow.metadata.v0.FeatureCoverageConstraints.getDefaultInstance()) return this;
if (other.hasMinCoverage()) {
setMinCoverage(other.getMinCoverage());
}
if (other.hasMinAvgTokenLength()) {
setMinAvgTokenLength(other.getMinAvgTokenLength());
}
if (!other.excludedStringTokens_.isEmpty()) {
if (excludedStringTokens_.isEmpty()) {
excludedStringTokens_ = other.excludedStringTokens_;
bitField0_ |= 0x00000004;
} else {
ensureExcludedStringTokensIsMutable();
excludedStringTokens_.addAll(other.excludedStringTokens_);
}
onChanged();
}
if (!other.excludedIntTokens_.isEmpty()) {
if (excludedIntTokens_.isEmpty()) {
excludedIntTokens_ = other.excludedIntTokens_;
excludedIntTokens_.makeImmutable();
bitField0_ |= 0x00000008;
} else {
ensureExcludedIntTokensIsMutable();
excludedIntTokens_.addAll(other.excludedIntTokens_);
}
onChanged();
}
if (!other.oovStringTokens_.isEmpty()) {
if (oovStringTokens_.isEmpty()) {
oovStringTokens_ = other.oovStringTokens_;
bitField0_ |= 0x00000010;
} else {
ensureOovStringTokensIsMutable();
oovStringTokens_.addAll(other.oovStringTokens_);
}
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 13: {
minCoverage_ = input.readFloat();
bitField0_ |= 0x00000001;
break;
} // case 13
case 21: {
minAvgTokenLength_ = input.readFloat();
bitField0_ |= 0x00000002;
break;
} // case 21
case 26: {
com.google.protobuf.ByteString bs = input.readBytes();
ensureExcludedStringTokensIsMutable();
excludedStringTokens_.add(bs);
break;
} // case 26
case 32: {
long v = input.readInt64();
ensureExcludedIntTokensIsMutable();
excludedIntTokens_.addLong(v);
break;
} // case 32
case 34: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
ensureExcludedIntTokensIsMutable();
while (input.getBytesUntilLimit() > 0) {
excludedIntTokens_.addLong(input.readInt64());
}
input.popLimit(limit);
break;
} // case 34
case 42: {
com.google.protobuf.ByteString bs = input.readBytes();
ensureOovStringTokensIsMutable();
oovStringTokens_.add(bs);
break;
} // case 42
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private float minCoverage_ ;
/**
*
* Fraction of feature values that map to a vocab entry (i.e. are not oov).
*
*
* optional float min_coverage = 1;
* @return Whether the minCoverage field is set.
*/
@java.lang.Override
public boolean hasMinCoverage() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* Fraction of feature values that map to a vocab entry (i.e. are not oov).
*
*
* optional float min_coverage = 1;
* @return The minCoverage.
*/
@java.lang.Override
public float getMinCoverage() {
return minCoverage_;
}
/**
*
* Fraction of feature values that map to a vocab entry (i.e. are not oov).
*
*
* optional float min_coverage = 1;
* @param value The minCoverage to set.
* @return This builder for chaining.
*/
public Builder setMinCoverage(float value) {
minCoverage_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* Fraction of feature values that map to a vocab entry (i.e. are not oov).
*
*
* optional float min_coverage = 1;
* @return This builder for chaining.
*/
public Builder clearMinCoverage() {
bitField0_ = (bitField0_ & ~0x00000001);
minCoverage_ = 0F;
onChanged();
return this;
}
private float minAvgTokenLength_ ;
/**
*
* Average length of tokens. Used for cases such as wordpiece that fallback
* to character-level tokenization.
*
*
* optional float min_avg_token_length = 2;
* @return Whether the minAvgTokenLength field is set.
*/
@java.lang.Override
public boolean hasMinAvgTokenLength() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* Average length of tokens. Used for cases such as wordpiece that fallback
* to character-level tokenization.
*
*
* optional float min_avg_token_length = 2;
* @return The minAvgTokenLength.
*/
@java.lang.Override
public float getMinAvgTokenLength() {
return minAvgTokenLength_;
}
/**
*
* Average length of tokens. Used for cases such as wordpiece that fallback
* to character-level tokenization.
*
*
* optional float min_avg_token_length = 2;
* @param value The minAvgTokenLength to set.
* @return This builder for chaining.
*/
public Builder setMinAvgTokenLength(float value) {
minAvgTokenLength_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* Average length of tokens. Used for cases such as wordpiece that fallback
* to character-level tokenization.
*
*
* optional float min_avg_token_length = 2;
* @return This builder for chaining.
*/
public Builder clearMinAvgTokenLength() {
bitField0_ = (bitField0_ & ~0x00000002);
minAvgTokenLength_ = 0F;
onChanged();
return this;
}
private com.google.protobuf.LazyStringArrayList excludedStringTokens_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureExcludedStringTokensIsMutable() {
if (!excludedStringTokens_.isModifiable()) {
excludedStringTokens_ = new com.google.protobuf.LazyStringArrayList(excludedStringTokens_);
}
bitField0_ |= 0x00000004;
}
/**
*
* String tokens to exclude when calculating min_coverage and
* min_avg_token_length. Useful for tokens such as [PAD].
*
*
* repeated string excluded_string_tokens = 3;
* @return A list containing the excludedStringTokens.
*/
public com.google.protobuf.ProtocolStringList
getExcludedStringTokensList() {
excludedStringTokens_.makeImmutable();
return excludedStringTokens_;
}
/**
*
* String tokens to exclude when calculating min_coverage and
* min_avg_token_length. Useful for tokens such as [PAD].
*
*
* repeated string excluded_string_tokens = 3;
* @return The count of excludedStringTokens.
*/
public int getExcludedStringTokensCount() {
return excludedStringTokens_.size();
}
/**
*
* String tokens to exclude when calculating min_coverage and
* min_avg_token_length. Useful for tokens such as [PAD].
*
*
* repeated string excluded_string_tokens = 3;
* @param index The index of the element to return.
* @return The excludedStringTokens at the given index.
*/
public java.lang.String getExcludedStringTokens(int index) {
return excludedStringTokens_.get(index);
}
/**
*
* String tokens to exclude when calculating min_coverage and
* min_avg_token_length. Useful for tokens such as [PAD].
*
*
* repeated string excluded_string_tokens = 3;
* @param index The index of the value to return.
* @return The bytes of the excludedStringTokens at the given index.
*/
public com.google.protobuf.ByteString
getExcludedStringTokensBytes(int index) {
return excludedStringTokens_.getByteString(index);
}
/**
*
* String tokens to exclude when calculating min_coverage and
* min_avg_token_length. Useful for tokens such as [PAD].
*
*
* repeated string excluded_string_tokens = 3;
* @param index The index to set the value at.
* @param value The excludedStringTokens to set.
* @return This builder for chaining.
*/
public Builder setExcludedStringTokens(
int index, java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensureExcludedStringTokensIsMutable();
excludedStringTokens_.set(index, value);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* String tokens to exclude when calculating min_coverage and
* min_avg_token_length. Useful for tokens such as [PAD].
*
*
* repeated string excluded_string_tokens = 3;
* @param value The excludedStringTokens to add.
* @return This builder for chaining.
*/
public Builder addExcludedStringTokens(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensureExcludedStringTokensIsMutable();
excludedStringTokens_.add(value);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* String tokens to exclude when calculating min_coverage and
* min_avg_token_length. Useful for tokens such as [PAD].
*
*
* repeated string excluded_string_tokens = 3;
* @param values The excludedStringTokens to add.
* @return This builder for chaining.
*/
public Builder addAllExcludedStringTokens(
java.lang.Iterable values) {
ensureExcludedStringTokensIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, excludedStringTokens_);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* String tokens to exclude when calculating min_coverage and
* min_avg_token_length. Useful for tokens such as [PAD].
*
*
* repeated string excluded_string_tokens = 3;
* @return This builder for chaining.
*/
public Builder clearExcludedStringTokens() {
excludedStringTokens_ =
com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);;
onChanged();
return this;
}
/**
*
* String tokens to exclude when calculating min_coverage and
* min_avg_token_length. Useful for tokens such as [PAD].
*
*
* repeated string excluded_string_tokens = 3;
* @param value The bytes of the excludedStringTokens to add.
* @return This builder for chaining.
*/
public Builder addExcludedStringTokensBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
ensureExcludedStringTokensIsMutable();
excludedStringTokens_.add(value);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
private com.google.protobuf.Internal.LongList excludedIntTokens_ = emptyLongList();
private void ensureExcludedIntTokensIsMutable() {
if (!excludedIntTokens_.isModifiable()) {
excludedIntTokens_ = makeMutableCopy(excludedIntTokens_);
}
bitField0_ |= 0x00000008;
}
/**
*
* Integer tokens to exclude when calculating min_coverage and
* min_avg_token_length.
*
*
* repeated int64 excluded_int_tokens = 4 [packed = true];
* @return A list containing the excludedIntTokens.
*/
public java.util.List
getExcludedIntTokensList() {
excludedIntTokens_.makeImmutable();
return excludedIntTokens_;
}
/**
*
* Integer tokens to exclude when calculating min_coverage and
* min_avg_token_length.
*
*
* repeated int64 excluded_int_tokens = 4 [packed = true];
* @return The count of excludedIntTokens.
*/
public int getExcludedIntTokensCount() {
return excludedIntTokens_.size();
}
/**
*
* Integer tokens to exclude when calculating min_coverage and
* min_avg_token_length.
*
*
* repeated int64 excluded_int_tokens = 4 [packed = true];
* @param index The index of the element to return.
* @return The excludedIntTokens at the given index.
*/
public long getExcludedIntTokens(int index) {
return excludedIntTokens_.getLong(index);
}
/**
*
* Integer tokens to exclude when calculating min_coverage and
* min_avg_token_length.
*
*
* repeated int64 excluded_int_tokens = 4 [packed = true];
* @param index The index to set the value at.
* @param value The excludedIntTokens to set.
* @return This builder for chaining.
*/
public Builder setExcludedIntTokens(
int index, long value) {
ensureExcludedIntTokensIsMutable();
excludedIntTokens_.setLong(index, value);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* Integer tokens to exclude when calculating min_coverage and
* min_avg_token_length.
*
*
* repeated int64 excluded_int_tokens = 4 [packed = true];
* @param value The excludedIntTokens to add.
* @return This builder for chaining.
*/
public Builder addExcludedIntTokens(long value) {
ensureExcludedIntTokensIsMutable();
excludedIntTokens_.addLong(value);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* Integer tokens to exclude when calculating min_coverage and
* min_avg_token_length.
*
*
* repeated int64 excluded_int_tokens = 4 [packed = true];
* @param values The excludedIntTokens to add.
* @return This builder for chaining.
*/
public Builder addAllExcludedIntTokens(
java.lang.Iterable extends java.lang.Long> values) {
ensureExcludedIntTokensIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, excludedIntTokens_);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* Integer tokens to exclude when calculating min_coverage and
* min_avg_token_length.
*
*
* repeated int64 excluded_int_tokens = 4 [packed = true];
* @return This builder for chaining.
*/
public Builder clearExcludedIntTokens() {
excludedIntTokens_ = emptyLongList();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
private com.google.protobuf.LazyStringArrayList oovStringTokens_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureOovStringTokensIsMutable() {
if (!oovStringTokens_.isModifiable()) {
oovStringTokens_ = new com.google.protobuf.LazyStringArrayList(oovStringTokens_);
}
bitField0_ |= 0x00000010;
}
/**
*
* String tokens to treat as oov tokens (e.g. [UNK]). These tokens are also
* excluded when calculating avg token length.
*
*
* repeated string oov_string_tokens = 5;
* @return A list containing the oovStringTokens.
*/
public com.google.protobuf.ProtocolStringList
getOovStringTokensList() {
oovStringTokens_.makeImmutable();
return oovStringTokens_;
}
/**
*
* String tokens to treat as oov tokens (e.g. [UNK]). These tokens are also
* excluded when calculating avg token length.
*
*
* repeated string oov_string_tokens = 5;
* @return The count of oovStringTokens.
*/
public int getOovStringTokensCount() {
return oovStringTokens_.size();
}
/**
*
* String tokens to treat as oov tokens (e.g. [UNK]). These tokens are also
* excluded when calculating avg token length.
*
*
* repeated string oov_string_tokens = 5;
* @param index The index of the element to return.
* @return The oovStringTokens at the given index.
*/
public java.lang.String getOovStringTokens(int index) {
return oovStringTokens_.get(index);
}
/**
*
* String tokens to treat as oov tokens (e.g. [UNK]). These tokens are also
* excluded when calculating avg token length.
*
*
* repeated string oov_string_tokens = 5;
* @param index The index of the value to return.
* @return The bytes of the oovStringTokens at the given index.
*/
public com.google.protobuf.ByteString
getOovStringTokensBytes(int index) {
return oovStringTokens_.getByteString(index);
}
/**
*
* String tokens to treat as oov tokens (e.g. [UNK]). These tokens are also
* excluded when calculating avg token length.
*
*
* repeated string oov_string_tokens = 5;
* @param index The index to set the value at.
* @param value The oovStringTokens to set.
* @return This builder for chaining.
*/
public Builder setOovStringTokens(
int index, java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensureOovStringTokensIsMutable();
oovStringTokens_.set(index, value);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
* String tokens to treat as oov tokens (e.g. [UNK]). These tokens are also
* excluded when calculating avg token length.
*
*
* repeated string oov_string_tokens = 5;
* @param value The oovStringTokens to add.
* @return This builder for chaining.
*/
public Builder addOovStringTokens(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensureOovStringTokensIsMutable();
oovStringTokens_.add(value);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
* String tokens to treat as oov tokens (e.g. [UNK]). These tokens are also
* excluded when calculating avg token length.
*
*
* repeated string oov_string_tokens = 5;
* @param values The oovStringTokens to add.
* @return This builder for chaining.
*/
public Builder addAllOovStringTokens(
java.lang.Iterable values) {
ensureOovStringTokensIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, oovStringTokens_);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
* String tokens to treat as oov tokens (e.g. [UNK]). These tokens are also
* excluded when calculating avg token length.
*
*
* repeated string oov_string_tokens = 5;
* @return This builder for chaining.
*/
public Builder clearOovStringTokens() {
oovStringTokens_ =
com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000010);;
onChanged();
return this;
}
/**
*
* String tokens to treat as oov tokens (e.g. [UNK]). These tokens are also
* excluded when calculating avg token length.
*
*
* repeated string oov_string_tokens = 5;
* @param value The bytes of the oovStringTokens to add.
* @return This builder for chaining.
*/
public Builder addOovStringTokensBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
ensureOovStringTokensIsMutable();
oovStringTokens_.add(value);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:tensorflow.metadata.v0.FeatureCoverageConstraints)
}
// @@protoc_insertion_point(class_scope:tensorflow.metadata.v0.FeatureCoverageConstraints)
private static final org.tensorflow.metadata.v0.FeatureCoverageConstraints DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.tensorflow.metadata.v0.FeatureCoverageConstraints();
}
public static org.tensorflow.metadata.v0.FeatureCoverageConstraints getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public FeatureCoverageConstraints parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public org.tensorflow.metadata.v0.FeatureCoverageConstraints getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy