Google is committed to advancing racial equity for Black communities. See how.

EntityConfig

class EntityConfig
kotlin.Any
   ↳ androidx.textclassifier.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 classes

Builder class to construct the EntityConfig object.

Public methods

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

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

MutableCollection<String!>

Retrieves the list of hints.

MutableCollection<String!>!
resolveTypes(@Nullable typesFromTextClassifier: MutableCollection<String!>?)

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.

Bundle

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

Public methods

createFromBundle

@NonNull static fun createFromBundle(@NonNull bundle: Bundle): TextClassifier.EntityConfig

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

getHints

@NonNull fun getHints(): MutableCollection<String!>

Retrieves the list of hints.

Return
MutableCollection<String!> An unmodifiable collection of the hints.

resolveTypes

fun resolveTypes(@Nullable typesFromTextClassifier: MutableCollection<String!>?): MutableCollection<String!>!

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
typesFromTextClassifier MutableCollection<String!>?: entity types the text classifier thinks should be included before factoring in the included/excluded entity types given by the client.

shouldIncludeTypesFromTextClassifier

fun shouldIncludeTypesFromTextClassifier(): Boolean

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(Collection).

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

toBundle

@NonNull fun toBundle(): Bundle

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