use of ai.saiy.android.nlu.NLUCoerce in project Saiy-PS by brandall76.
the class ResolveAPIAI method unpack.
public void unpack(@NonNull final String gsonResponse) {
if (DEBUG) {
MyLog.i(CLS_NAME, "unpacking");
}
final Gson gson = new GsonBuilder().disableHtmlEscaping().create();
final AIResponse response = gson.fromJson(gsonResponse, new TypeToken<AIResponse>() {
}.getType());
nluAPIAI = new NLUAPIAI(confidenceArray, resultsArray, response.getResult().getMetadata().getIntentName(), response.getResult().getParameters());
new NLUCoerce(getNLUAPIAI(), getContext(), getSupportedLanguage(), getVRLocale(), getTTSLocale(), getConfidenceArray(), getResultsArray()).coerce();
}
use of ai.saiy.android.nlu.NLUCoerce in project Saiy-PS by brandall76.
the class ResolveNuance method unpack.
public void unpack(@NonNull final JSONObject payload) {
if (DEBUG) {
MyLog.i(CLS_NAME, "unpacking");
}
final GsonBuilder builder = new GsonBuilder();
builder.disableHtmlEscaping();
builder.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES);
final Gson gson = builder.create();
nluNuance = gson.fromJson(payload.toString(), new TypeToken<NLUNuance>() {
}.getType());
new NLUCoerce(getNLUNuance(), getContext(), getSupportedLanguage(), getVRLocale(), getTTSLocale(), getConfidenceArray(), getResultsArray()).coerce();
}
use of ai.saiy.android.nlu.NLUCoerce in project Saiy-PS by brandall76.
the class ResolveBluemix method unpack.
public void unpack(@NonNull final NLUBluemix nluBluemix) {
if (DEBUG) {
MyLog.i(CLS_NAME, "unpacking");
}
this.nluBluemix = nluBluemix;
new NLUCoerce(getNLUBluemix(), getContext(), getSupportedLanguage(), getVRLocale(), getTTSLocale(), getConfidenceArray(), getResultsArray()).coerce();
}
use of ai.saiy.android.nlu.NLUCoerce in project Saiy-PS by brandall76.
the class ResolveMicrosoft method unpack.
public void unpack(@NonNull final String payload) {
if (DEBUG) {
MyLog.i(CLS_NAME, "unpacking");
}
final Gson gson = new GsonBuilder().disableHtmlEscaping().create();
nluMicrosoft = gson.fromJson(payload, NLUMicrosoft.class);
new NLUCoerce(getNLUMicrosoft(), getContext(), getSupportedLanguage(), getVRLocale(), getTTSLocale(), getConfidenceArray(), getResultsArray()).coerce();
}
use of ai.saiy.android.nlu.NLUCoerce in project Saiy-PS by brandall76.
the class ResolveWit method unpack.
public void unpack(@NonNull final NLUWit nluWit) {
if (DEBUG) {
MyLog.i(CLS_NAME, "unpacking");
}
this.nluWit = nluWit;
new NLUCoerce(getNLUWit(), getContext(), getSupportedLanguage(), getVRLocale(), getTTSLocale(), getConfidenceArray(), getResultsArray()).coerce();
}
Aggregations