TextClassifier.EntityConfig


public final class TextClassifier.EntityConfig


Configuration object for specifying what entities to identify. Configs are initially based on a predefined preset, and can be modified from there.

Summary

Nested types

This class is deprecated.

Use android.view.textclassifier.TextClassifier.EntityConfig.Builder instead.

Public methods

static @NonNull TextClassifier.EntityConfig

Extracts an EntityConfig from a bundle that was added using toBundle.

@NonNull Collection<String>

Retrieves the list of hints.

Collection<String>
resolveTypes(@Nullable Collection<String> typesFromTextClassifier)

Returns a final list of entity types that the text classifier should look for.

boolean

Return whether the client allows the text classifier to include its own list of default entity types.

@NonNull Bundle

Adds this EntityConfig to a Bundle that can be read back with the same parameters to createFromBundle.

Public methods

createFromBundle

public static @NonNull TextClassifier.EntityConfig createFromBundle(@NonNull Bundle bundle)

Extracts an EntityConfig from a bundle that was added using toBundle.

getHints

public @NonNull Collection<StringgetHints()

Retrieves the list of hints.

Returns
@NonNull Collection<String>

An unmodifiable collection of the hints.

resolveTypes

public Collection<StringresolveTypes(@Nullable Collection<String> typesFromTextClassifier)

Returns a final list of entity types that the text classifier should look for.

NOTE: This method is intended for use by text classifier.

Parameters
@Nullable Collection<String> typesFromTextClassifier

entity types the text classifier thinks should be included before factoring in the included/excluded entity types given by the client.

shouldIncludeTypesFromTextClassifier

public boolean shouldIncludeTypesFromTextClassifier()

Return whether the client allows the text classifier to include its own list of default entity types. If this functions returns true, text classifier can consider to specify its own list in resolveTypes.

NOTE: This method is intended for use by text classifier.

See also
resolveTypes

toBundle

public @NonNull Bundle toBundle()

Adds this EntityConfig to a Bundle that can be read back with the same parameters to createFromBundle.