use of org.openhab.ui.habot.nlp.IntentInterpretation in project habot by ghys.
the class GetStatusSkill method interpret.
@Override
public IntentInterpretation interpret(Intent intent, String language) {
IntentInterpretation interpretation = new IntentInterpretation();
Set<Item> matchedItems = findItems(intent);
if (matchedItems == null || matchedItems.isEmpty()) {
interpretation.setAnswer(answerFormatter.getRandomAnswer("answer_nothing_found"));
interpretation.setHint(answerFormatter.getStandardTagHint(intent.getEntities()));
} else {
interpretation.setMatchedItems(matchedItems);
interpretation.setCard(cardBuilder.buildCard(intent, matchedItems));
interpretation.setAnswer(answerFormatter.getRandomAnswer("info_found_simple"));
}
return interpretation;
}
use of org.openhab.ui.habot.nlp.IntentInterpretation in project habot by ghys.
the class HistoryHourlyGraphSkill method interpret.
@Override
public IntentInterpretation interpret(Intent intent, String language) {
IntentInterpretation interpretation = new IntentInterpretation();
Set<Item> matchedItems = findItems(intent);
if (matchedItems == null || matchedItems.isEmpty()) {
interpretation.setAnswer(answerFormatter.getRandomAnswer("answer_nothing_found"));
interpretation.setHint(answerFormatter.getStandardTagHint(intent.getEntities()));
} else {
interpretation.setMatchedItems(matchedItems);
String period = "h";
if (intent.getEntities().containsKey("period")) {
period = intent.getEntities().get("period").concat(period);
}
interpretation.setCard(this.cardBuilder.buildChartCard(intent, matchedItems, period));
}
interpretation.setAnswer(answerFormatter.getRandomAnswer("info_found_simple"));
return interpretation;
}
Aggregations