Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

TextClassifier.EntityConfig

public static final class TextClassifier.EntityConfig
extends Object

java.lang.Object
   ↳ 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

class TextClassifier.EntityConfig.Builder

Builder class to construct the TextClassifier.EntityConfig object. 

Public methods

static TextClassifier.EntityConfig createFromBundle(Bundle bundle)

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

Collection<String> getHints()

Retrieves the list of hints.

Collection<String> resolveEntityTypes(Collection<String> defaultEntityTypes)

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

boolean shouldIncludeDefaultEntityTypes()

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

Bundle toBundle()

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

Inherited methods

Public methods

createFromBundle

public static TextClassifier.EntityConfig createFromBundle (Bundle bundle)

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

Parameters
bundle Bundle

Returns
TextClassifier.EntityConfig

getHints

public Collection<String> getHints ()

Retrieves the list of hints.

Returns
Collection<String> An unmodifiable collection of the hints.

resolveEntityTypes

public Collection<String> resolveEntityTypes (Collection<String> defaultEntityTypes)

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
defaultEntityTypes Collection: entity types the text classifier thinks should be included before factoring in the included/excluded entity types given by the client.

Returns
Collection<String>

shouldIncludeDefaultEntityTypes

public boolean shouldIncludeDefaultEntityTypes ()

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

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

Returns
boolean

toBundle

public Bundle toBundle ()

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

Returns
Bundle