use of org.openhab.ui.habot.nlp.internal.IntentTrainer in project habot by ghys.
the class TrainerDeTest method testGetStatus.
@Test
public void testGetStatus() throws Exception {
Intent actual;
this.trainer = new IntentTrainer("de", skills);
actual = interpret("Heizung in der Küche");
assertEquals(Skills.GET_STATUS, actual.getName());
assertEquals(2, actual.getEntities().size());
assertEquals("heizung", actual.getEntities().get("object"));
assertEquals("küche", actual.getEntities().get("location"));
actual = interpret("wie hoch ist die Temperatur im Wohnzimmer");
assertEquals(Skills.GET_STATUS, actual.getName());
assertEquals(2, actual.getEntities().size());
assertEquals("temperatur", actual.getEntities().get("object"));
assertEquals("wohnzimmer", actual.getEntities().get("location"));
actual = interpret("wie hoch ist die Temperatur im Keller");
assertEquals(Skills.GET_STATUS, actual.getName());
assertEquals(2, actual.getEntities().size());
assertEquals("temperatur", actual.getEntities().get("object"));
assertEquals("keller", actual.getEntities().get("location"));
}
use of org.openhab.ui.habot.nlp.internal.IntentTrainer in project habot by ghys.
the class TrainerDeTest method testHistoryWeekly.
@Test
public void testHistoryWeekly() throws Exception {
Intent actual;
this.trainer = new IntentTrainer("de", skills, null, "alphanumeric");
actual = interpret("Verlauf der Temperatur der letzten Woche");
assertEquals(Skills.GET_HISTORY_WEEKLY, actual.getName());
assertEquals(1, actual.getEntities().size());
assertEquals("temperatur", actual.getEntities().get("object"));
actual = interpret("Verlauf der Luftfeuchtigkeit der letzten Woche");
assertEquals(Skills.GET_HISTORY_WEEKLY, actual.getName());
assertEquals(1, actual.getEntities().size());
assertEquals("luftfeuchtigkeit", actual.getEntities().get("object"));
actual = interpret("zeige die Wochenübersicht der Temperatur für die Küche");
assertEquals(Skills.GET_HISTORY_WEEKLY, actual.getName());
assertEquals(2, actual.getEntities().size());
assertEquals("temperatur", actual.getEntities().get("object"));
assertEquals("küche", actual.getEntities().get("location"));
}
use of org.openhab.ui.habot.nlp.internal.IntentTrainer in project habot by ghys.
the class TrainerDeTest method testHistoryDaily.
@Test
public void testHistoryDaily() throws Exception {
Intent actual;
this.trainer = new IntentTrainer("de", skills, null, "alphanumeric");
actual = interpret("Verlauf der Temperatur der letzten 24 Stunden");
assertEquals(Skills.GET_HISTORY_DAILY, actual.getName());
assertEquals(1, actual.getEntities().size());
assertEquals("temperatur", actual.getEntities().get("object"));
actual = interpret("Verlauf der Luftfeuchtigkeit der letzten 24 Stunden");
assertEquals(Skills.GET_HISTORY_DAILY, actual.getName());
assertEquals(1, actual.getEntities().size());
assertEquals("luftfeuchtigkeit", actual.getEntities().get("object"));
}
use of org.openhab.ui.habot.nlp.internal.IntentTrainer in project habot by ghys.
the class TrainerDeTest method testActivateObjects.
@Test
public void testActivateObjects() throws Exception {
Intent actual;
this.trainer = new IntentTrainer("de", skills);
actual = interpret("mach den Fernseher an");
assertEquals(Skills.ACTIVATE_OBJECT, actual.getName());
assertEquals(1, actual.getEntities().size());
assertEquals("fernseher", actual.getEntities().get("object"));
actual = interpret("bitte mache das Licht an");
assertEquals(Skills.ACTIVATE_OBJECT, actual.getName());
assertEquals(1, actual.getEntities().size());
assertEquals("licht", actual.getEntities().get("object"));
}
use of org.openhab.ui.habot.nlp.internal.IntentTrainer in project habot by ghys.
the class TrainerDeTest method testHistoryMonthly.
@Test
public void testHistoryMonthly() throws Exception {
Intent actual;
this.trainer = new IntentTrainer("de", skills, null, "alphanumeric");
actual = interpret("Verlauf der Temperatur des letzten Monats");
assertEquals(Skills.GET_HISTORY_MONTHLY, actual.getName());
assertEquals(1, actual.getEntities().size());
assertEquals("temperatur", actual.getEntities().get("object"));
actual = interpret("Verlauf der Luftfeuchtigkeit des letzten Monats");
assertEquals(Skills.GET_HISTORY_MONTHLY, actual.getName());
assertEquals(1, actual.getEntities().size());
assertEquals("luftfeuchtigkeit", actual.getEntities().get("object"));
actual = interpret("Monatsübersicht der Temperatur für die Küche");
assertEquals(Skills.GET_HISTORY_MONTHLY, actual.getName());
assertEquals(2, actual.getEntities().size());
assertEquals("temperatur", actual.getEntities().get("object"));
assertEquals("küche", actual.getEntities().get("location"));
}
Aggregations