public interface SearchQuery
Here is an example of how to build a search query using concepts and phrases.
{
@code
Concept greeting = SpeechFactory.createConcept()
.setOperator(new AnyOperator())
.setName("Greeting")
.setThreshold(45.0f)
.addPhrase("1111", "Good Morning", 45.0f)
.addPhrase("2222", "Hello", 45.0f);
Concept introduction = SpeechFactory.createConcept()
.setOperator(new AnyOperator())
.setName("Introduction of Agent and Department")
.setThreshold(45.0f)
.addPhrase("3333", "Welcome to", 45.0f)
.addPhrase("4444", "My name is", 45.0f);
Concept opening = SpeechFactory.createConcept()
.setOperator(new AllOperator())
.setName("Opening")
.setThreshold(45.0f)
.setSubConcepts(greeting, introduction);
Concept selling = SpeechFactory.createConcept()
.setOperator(new AllOperator())
.setName("Selling")
.setThreshold(45.0f)
.addPhrase("5555", "Would you like to buy", 45.0f)
.addPhrase("6666", "Could I offer you", 45.0f);
Concept closing = SpeechFactory.createConcept()
.setOperator(new AllOperator())
.setName("closing")
.setThreshold(45.0f)
.addPhrase("7777", "Thank you for calling", 45.0f)
.addPhrase("8888", "We appreciate your call", 45.0f);
SearchQuery searchQuery = SpeechFactory.createSearchQuery()
.setLangauge("en_US")
.setConcepts(opening, selling, closing);*
}
Here is another example of how to build a search query using only a phrase and no concept.
{
@code
SearchQuery searchQuery = SpeechFactory.createSearchQuery()
.setLangauge("en_US")
.addPhrase("123", "Our special promotion today is", 45.0f);
}
Concept| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_LANGUAGE
Deprecated.
The default language.
|
| Modifier and Type | Method and Description |
|---|---|
SearchQuery |
addPhrase(String phrase,
float threshold)
Deprecated.
Add a phrase and threshold to the search query
|
SearchQuery |
addPhrase(String id,
String phrase,
float threshold)
Deprecated.
Add a phrase with a unique identifier and threshold to the search query.
|
List |
getConcepts()
Deprecated.
The search concepts of the search query.
|
UUID |
getId()
Deprecated.
The identification of the search query.
|
String |
getLanguage()
Deprecated.
The language of the search query.
|
String |
getName()
Deprecated.
The name of the search query.
|
List |
getPhrases()
Deprecated.
The search phrases of the search query.
|
SearchQuery |
setConcepts(Concept[] concepts)
Deprecated.
Set the concepts for the search query.
|
SearchQuery |
setId(UUID id)
Deprecated.
Set the identifier for the search query.
|
SearchQuery |
setLangauge(String language)
Deprecated.
Set the language of the search query.
|
SearchQuery |
setName(String name)
Deprecated.
Set the name of the search query.
|
static final String DEFAULT_LANGUAGE
UUID getId()
String getName()
String getLanguage()
List getConcepts()
List getPhrases()
SearchQuery setName(String name)
name - of the search querySearchQuery setLangauge(String language)
Well-formed language values have the form comprising of a ISO 639 alpha-2 or alpha-3 language code and the possibility of a ISO 3166 alpha-2 country code.
The following are all examples of well-formed language codes:
The IANA Language Subtag Registry maintains an active directory of valid language and country codes.
language - the language used for the speech search .SearchQuery setConcepts(Concept[] concepts)
concepts - to setSearchQuery addPhrase(String phrase, float threshold)
phrase - the phase to add to the conceptthreshold - the value the confidence level must exceed for a matchSearchQuery addPhrase(String id, String phrase, float threshold)
id - the unique identifier for the search phrasephrase - the phase to add to the conceptthreshold - the value the confidence level must exceed for a matchSearchQuery setId(UUID id)
id - the identifier for the search queryCopyright © 2021 Avaya. All rights reserved.