Share via


TranslationResponseValue.ExtraDefinitions Field

Definition

Name in the result of #getExtras() to pass dictionary definitions of the text categorized by parts of speech.

[Android.Runtime.Register("EXTRA_DEFINITIONS", ApiSince=31)]
public const string ExtraDefinitions;
[<Android.Runtime.Register("EXTRA_DEFINITIONS", ApiSince=31)>]
val mutable ExtraDefinitions : string

Field Value

Implements

Attributes

Remarks

Name in the result of #getExtras() to pass dictionary definitions of the text categorized by parts of speech.

The dictionary definitions consists of groups of terms keyed by their corresponding parts of speech. This map-like structure is stored in a Bundle. The individual parts of speech can be traversed by Bundle#keySet() and used to get the corresponding list of terms as CharSequences.

<ul> <li>"noun" -> ["def1", "def2", ...]</li> <li>"verb" -> ["def3", "def4", ...]</li> <li>...</li> </ul>

The set of parts of speech can then be used by Bundle#getCharSequenceArrayList(String) to get the list of terms.

<b>Example</b>:

for (String partOfSpeech : extras.getBundle(EXTRA_DEFINITIONS).keySet()) { ArrayList<CharSequence> terms = extras.getBundle(EXTRA_DEFINITIONS).getCharSequenceArrayList(partOfSpeech); ...}

Java documentation for android.view.translation.TranslationResponseValue.EXTRA_DEFINITIONS.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to