congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Slot
Code IndexAdd Tabnine to your IDE (free)

How to use
Slot
in
com.amazon.speech.slu

Best Java code snippets using com.amazon.speech.slu.Slot (Showing top 20 results out of 315)

origin: alexa/skill-samples-java

protected boolean slotsContainNumberSlotWithValue(Map<String, Slot> slots, String value) {
  Slot slot = slots.get(SlotNames.NUMBER_SLOT_NAME);
  return (slot != null) && slot.getValue().equals(value);
}
origin: KayLerch/alexa-skills-kit-tester-java

public AlexaIntentRequest withSlot(final String slotName, final Object slotValue) {
  return withSlots(Collections.singletonList(
      Slot.builder()
          .withName(slotName)
          .withValue(String.valueOf(slotValue))
          .build()));
}
origin: KayLerch/alexa-skills-kit-tester-java

public String getSlotSummary() {
  final List<String> slotValues = slots.values().stream().map(slot -> slot.getName() + ": " + slot.getValue()).collect(Collectors.toList());
  return slotValues.isEmpty() ? "" : "{ " + String.join(", ", slotValues) + " }";
}
origin: KayLerch/alexa-skills-kit-tester-java

public AlexaIntentRequest withSlots(final List<Slot> slots) {
  slots.forEach(slot -> this.slots.putIfAbsent(slot.getName(), slot));
  return this;
}
origin: alexa/skill-samples-java

protected boolean slotsContainNumberSlotWithValue(Map<String, Slot> slots, String value) {
  Slot slot = slots.get(SlotNames.NUMBER_SLOT_NAME);
  return (slot != null) && slot.getValue().equals(value);
}
origin: KayLerch/alexa-skills-kit-tester-java

/**
 * Fires an intent with zero to many slots
 * @param intentName name of the intent
 * @param slots collection of slots
 * @return skill's response
 */
public AlexaResponse intent(final String intentName, final Map<String, Object> slots) {
  final Map<String, Slot> slots2 = new HashMap<>();
  slots.forEach((k,v) -> {
    slots2.putIfAbsent(k, v instanceof Slot ? (Slot)v : Slot.builder().withName(k).withValue(v.toString()).build());
  });
  return intent(new AlexaIntentRequest(this, intentName).withSlots(slots2));
}
origin: alexa/skill-samples-java

/**
 * Function to accept an intent containing a Day slot (date object) and return the Calendar
 * representation of that slot value. If the user provides a date, then use that, otherwise use
 * today. The date is in server time, not in the user's time zone. So "today" for the user may
 * actually be tomorrow.
 *
 * @param intent
 *            the intent object containing the day slot
 * @return the Calendar representation of that date
 */
private Calendar getCalendar(Intent intent) {
  Slot daySlot = intent.getSlot(SLOT_DAY);
  Date date;
  Calendar calendar = Calendar.getInstance();
  if (daySlot != null && daySlot.getValue() != null) {
    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-d");
    try {
      date = dateFormat.parse(daySlot.getValue());
    } catch (ParseException e) {
      date = new Date();
    }
  } else {
    date = new Date();
  }
  calendar.setTime(date);
  return calendar;
}
origin: KayLerch/alexa-meets-polly

public String translate(final String testPhrase, final String language) {
  final Map<String, Slot> slots = new HashMap<>();
  slots.put("termA", Slot.builder().withName("termA").withValue(testPhrase).build());
  slots.put("termB", Slot.builder().withName("termB").build());
  slots.put("language", Slot.builder().withName("language").withValue(language).build());
  final SpeechletRequestEnvelope envelope = givenIntentSpeechletRequestEnvelope("Translate", slots);
  final ObjectMapper mapper = new ObjectMapper();
  String response = null;
  try {
    final AWSLambdaClient awsLambda = new AWSLambdaClient();
    final InvokeRequest invokeRequest = new InvokeRequest()
        .withInvocationType(InvocationType.RequestResponse)
        .withFunctionName(lambdaName)
        .withPayload(mapper.writeValueAsString(envelope));
    final InvokeResult invokeResult = awsLambda.invoke(invokeRequest);
    response = new String(invokeResult.getPayload().array());
  } catch (JsonProcessingException e) {
    log.error(e.getMessage());
  }
  return response;
}
origin: alexa/skill-samples-java

if (categorySlot != null && categorySlot.getValue() != null) {
          .getValue()
          .toLowerCase()
          .replaceAll("\\s", "")
origin: alexa/skill-samples-java

Slot.builder()
    .withValue(slotValue)
    .withName(slotName)
origin: alexa/skill-samples-java

if (categorySlot != null && categorySlot.getValue() != null) {
          .getValue()
          .toLowerCase()
          .replaceAll("\\s", "")
origin: alexa/skill-samples-java

Slot.builder()
    .withValue(slotValue)
    .withName(slotName)
origin: alexa/skill-samples-java

@Override
public SpeechletResponse handle(final SkillRequestInformation skillRequestInformation) {
  Map<String,Slot> slots = skillRequestInformation.getSlots();
  String intentName = skillRequestInformation.getIntentName();
  Slot templateKindSlot = slots.get(SlotNames.TEMPLATE_KIND_SLOT_NAME);
  Slot numberSlot = slots.get(SlotNames.NUMBER_SLOT_NAME);
  TemplateNames name;
  if (IntentNames.INDIVIDUAL_TEMPLATE_INTENT.equals(intentName)) {
    name = TemplateNames.getNameFromKindAndNumber(templateKindSlot.getValue(), numberSlot.getValue());
  } else if (IntentNames.SELECT_ITEM_INTENT.equals(intentName)) {
    name = TemplateNames.getNameFromNumber(numberSlot.getValue());
  } else {
    throw new UnhandledRequestException(String.format("IndividualTemplateScreen could not handle intent: %s", intentName));
  }
  return getIndividualTemplateScreenResponse(name);
}
origin: alexa/skill-samples-java

@Override
public SpeechletResponse handle(final SkillRequestInformation skillRequestInformation) {
  Map<String,Slot> slots = skillRequestInformation.getSlots();
  String intentName = skillRequestInformation.getIntentName();
  Slot templateKindSlot = slots.get(SlotNames.TEMPLATE_KIND_SLOT_NAME);
  Slot numberSlot = slots.get(SlotNames.NUMBER_SLOT_NAME);
  TemplateNames name;
  if (IntentNames.INDIVIDUAL_TEMPLATE_INTENT.equals(intentName)) {
    name = TemplateNames.getNameFromKindAndNumber(templateKindSlot.getValue(), numberSlot.getValue());
  } else if (IntentNames.SELECT_ITEM_INTENT.equals(intentName)) {
    name = TemplateNames.getNameFromNumber(numberSlot.getValue());
  } else {
    throw new UnhandledRequestException(String.format("IndividualTemplateScreen could not handle intent: %s", intentName));
  }
  return getIndividualTemplateScreenResponse(name);
}
origin: alexa/skill-samples-java

if (citySlot == null || citySlot.getValue() == null) {
  if (!assignDefault) {
    throw new Exception("");
  String cityName = citySlot.getValue();
  if (STATIONS.containsKey(cityName.toLowerCase())) {
    cityObject =
origin: alexa/skill-samples-java

if (citySlot == null || citySlot.getValue() == null) {
  if (!assignDefault) {
    throw new Exception("");
  String cityName = citySlot.getValue();
  if (STATIONS.containsKey(cityName.toLowerCase())) {
    cityObject =
origin: alexa/skill-samples-java

if (dateSlot == null || dateSlot.getValue() == null) {
  Date date;
  try {
    date = dateFormat.parse(dateSlot.getValue());
  } catch (ParseException e) {
    date = new Date();
origin: alexa/skill-samples-java

if (dateSlot == null || dateSlot.getValue() == null) {
  Date date;
  try {
    date = dateFormat.parse(dateSlot.getValue());
  } catch (ParseException e) {
    date = new Date();
origin: alexa/skill-samples-java

String favoriteColor = favoriteColorSlot.getValue();
session.setAttribute(COLOR_KEY, favoriteColor);
speechText =
origin: vqtran/EchoQuery

List<ColumnName> axes = new ArrayList<>();
if (intent.getSlot(SlotUtil.PLOT_COLUMN_1).getValue() != null) {
 axes.add(SlotUtil.parseColumnSlot(
   intent.getSlot(SlotUtil.PLOT_COLUMN_1).getValue()));
if (intent.getSlot(SlotUtil.PLOT_COLUMN_2).getValue() != null) {
 axes.add(SlotUtil.parseColumnSlot(
   intent.getSlot(SlotUtil.PLOT_COLUMN_2).getValue()));
com.amazon.speech.sluSlot

Most used methods

  • getValue
  • builder
  • getName

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • addToBackStack (FragmentTransaction)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now