HERE Android SDK Developer's Guide

Intention

The class Intention is a member of com.here.android.mpa.nlp .

Class Summary

public final class Intention

extends java.lang.Object

Natural language processor intention object, an abstract description of an operation from voice input.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in Intention
Nested Classes

public static final enumeration Intention.Field

Intention parameters names

public static final enumeration Intention.Function

Function values for FUNCTION.

public static final enumeration Intention.Value

values for Intention.Field

Method Summary

Table 2. Methods in Intention
Methods

public boolean containsFieldValue (Field fieldId, String subString)

Check if the intention has the specified Intention.Field with the specified substring value.

public boolean equals (Object other)

For documentation, see java.lang.Object

public String getDeducedText ()

Get the value for text after deduction, which may be different from the original text from getOriginalText().

public String getDomain ()

Get knowledge domain

public int getFieldCount ()

Get number of Intention.Field in the intention

public List getFieldValues (Field fieldId)

Get values for the specified Intention.Field.

public java.util.Set <Field> getFields ()

Get Intention.Fields in the intention

public java.util.List <Function> getFunctions ()

Get the value for FUNCTION

public String getLanguage ()

Get language of the NLP parser applied to the speech

public String getOriginalText ()

Get value of the original text

public String getVendor ()

Get the value for VENDOR from the deduced intention

public String getVersion ()

Get the value for VERSION from the deduced intention

public boolean has (Field fieldId)

Check if the intention has the specified Intention.Field

public boolean has (Field fieldId, String value)

Check if the intention has the specified Intention.Field with the specified string.

public boolean has (Field fieldId, Value valueId)

Check if the intention has the specified Intention.Field with the specified Intention.Value.

public boolean has (Function id)

Checks whether this intention has contains the specified function.

public boolean hasOnly (Field target)

Check if the intention only has the specified Intention.Field aside from the following:

public int hashCode ()

For documentation, see java.lang.Object

Class Details

Natural language processor intention object, an abstract description of an operation from voice input. This object is represented in a formalized JSON, for example:

      
      {
   "vendor":["HERE"],
   "version":["1.0.2"],
   "language":["eng"],
   "duration":["0ms"],
   "text":["Where is Seattle?"],
   "func":["POI"],
   "target":["Seattle"]
 }           

IMPORTANT: Natural language processor is a Beta feature. The related classes are subject to change without notice.

Method Details

public boolean containsFieldValue (Field fieldId, String subString)

Check if the intention has the specified Intention.Field with the specified substring value. For example, checking "kilometer" against "kilometers" will result in true.

Parameters:

Returns:

true if the intention has the specified Intention.Field with the specified substring.

public boolean equals (Object other)

For documentation, see java.lang.Object

Parameters:

  • other

public String getDeducedText ()

Get the value for text after deduction, which may be different from the original text from getOriginalText().

Returns:

the value for TEXT, all in lower case.

public String getDomain ()

Get knowledge domain

Returns:

the value for DOMAIN. null if it does not exist.

public int getFieldCount ()

Get number of Intention.Field in the intention

Returns:

the number of Intention.Field in the intention

public List getFieldValues (Field fieldId)

Get values for the specified Intention.Field.

Parameters:

Returns:

An array of value corresponding to the specified Intention.Field name; null if no match found or if it doesn't contain any value.

public java.util.Set <Field> getFields ()

Get Intention.Fields in the intention

Returns:

a set of enums in Intention.Field

public java.util.List <Function> getFunctions ()

Get the value for FUNCTION

Returns:

an array of enums in Intention.Function

public String getLanguage ()

Get language of the NLP parser applied to the speech

Returns:

the value for LANGUAGE. null if it does not exist.

public String getOriginalText ()

Get value of the original text

Returns:

the value of the original text. null if it does not exist.

public String getVendor ()

Get the value for VENDOR from the deduced intention

Returns:

the value for VENDOR. null if it does not exist.

public String getVersion ()

Get the value for VERSION from the deduced intention

Returns:

the value for VERSION. null if it does not exist.

public boolean has (Field fieldId)

Check if the intention has the specified Intention.Field

Parameters:

Returns:

true if the intention has the specified Intention.Field; otherwise false.

public boolean has (Field fieldId, String value)

Check if the intention has the specified Intention.Field with the specified string.

Parameters:

Returns:

true if the intention has the specified Intention.Field with the specified string.

public boolean has (Field fieldId, Value valueId)

Check if the intention has the specified Intention.Field with the specified Intention.Value.

Parameters:

Returns:

true if the intention has the specified Intention.Field with the specified Intention.Value.

public boolean has (Function id)

Checks whether this intention has contains the specified function. e.g. intention.has(Function.POI)

Parameters:

Returns:

true if this intention has the specified function; otherwise false.

public boolean hasOnly (Field target)

Check if the intention only has the specified Intention.Field aside from the following:

Parameters:

Returns:

true if this intention has only the specified Intention.Field aside from the ones noted; false otherwise.

public int hashCode ()

For documentation, see java.lang.Object