简体   繁体   English

我的Alexa技能给了我一个困难的错误,我不知道该错误的出处

[英]My Alexa Skill is giving me a difficult error, which I do not know the source of

I am making a project for my school in JavaScript. 我正在用JavaScript为我的学校做一个项目。 I am trying to code an Alexa skill which allows for students to receive information about their teacher's availabilities. 我正在尝试编写一种Alexa技能,使学生可以接收有关其老师的可用性的信息。 I am a novice, and I am trying to resolve an error in which it is saying "Expected "," but saw "i" right before the if statement on Line 423. When I try to add a comma on line 421, it moves the error to that line. I cannot remove the error unless I delete the entire if statement. The if statement is to test where my skill will allow for an emission of a response from Alexa. Thank you for any help I receive! 我是新手,我正在尝试解决一个错误,它说“ Expected”,但在第423行的if语句之前看到了“ i”。当我尝试在第421行添加逗号时,它会移动该行的错误。除非删除整个if语句,否则我无法删除该错误。if语句用于测试我的技能将允许Alexa发出响应。在此感谢您提供的任何帮助!

Below is the code. 下面是代码。

    {
  "languageModel": {
    "types": [
      {
        "name": "teacher",
        "values": [
          {
            "id": "teacherTyrrell",
            "name": {
              "value": "Dr. Tyrrell",
              "synonyms": [
                "Mrs. Tee-Rull",
                "Ms. Tee-Rull",
                "Maygrace Tee-Rull",
                "Dr. Tee-rull",
                "Ms. Tyrrell",
                "Miss Tyrrell",
                "Mrs. Tyrrell",
                "Marygrace Tyrrell"
              ]
            }
          },
          {
            "id": "teacherTwyford",
            "name": {
              "value": "Mr. Twyford",
              "synonyms": [
                "Marcus Twyford"
              ]
            }
          },
          {
            "id": "teacherThornberry",
            "name": {
              "value": "Miss Thornberry",
              "synonyms": [
                "Chantal Thornberry",
                "Mrs. Thornberry",
                "Chantal"
              ]
            }
          },
          {
            "id": "teacherSuarez",
            "name": {
              "value": "Mrs. Suarez",
              "synonyms": [
                "Miss Suarez",
                "Angela Suarez",
                "Señora Suarez"
              ]
            }
          },
          {
            "id": "teacherRobtaille",
            "name": {
              "value": "Mrs. Robataille",
              "synonyms": [
                "Señora Robitaille",
                "Patricia Robe-a-tye",
                "Patricia Robitaille",
                "Señora Robe-a-tye",
                "Mrs. Robe-a-tye"
              ]
            }
          },
          {
            "id": "teacherPhillips",
            "name": {
              "value": "Miss Phillips",
              "synonyms": [
                "Catherine Phillips",
                "Ms. Phillips",
                "Mrs. Phillips"
              ]
            }
          },
          {
            "id": "teacherPeterson",
            "name": {
              "value": "Mr. Peterson",
              "synonyms": [
                "Eric Peterson"
              ]
            }
          },
          {
            "id": "teacherNeugebauer",
            "name": {
              "value": "Mr. Neugebauer",
              "synonyms": [
                "Dan Noogabower",
                "Dan Neugebauer",
                "Mr. Noogabower"
              ]
            }
          },
          {
            "id": "teacherMiller",
            "name": {
              "value": "Mr. Miller",
              "synonyms": [
                "Brock Miller"
              ]
            }
          },
          {
            "id": "teacherMcGivern",
            "name": {
              "value": "Mr. McGivern",
              "synonyms": [
                "Chucky Mcgivern",
                "Charles McGivern",
                "Chucky",
                "McGivern"
              ]
            }
          },
          {
            "id": "teacherMcCall",
            "name": {
              "value": "Dr. McCall",
              "synonyms": [
                "Jeremiah McCall",
                "Mr. McCall",
                "D-Mac"
              ]
            }
          },
          {
            "id": "teacherLichtySmith",
            "name": {
              "value": "Miss Lichty-Smith",
              "synonyms": [
                "Carole Lichty-Smith",
                "Mrs. Lichty-Smith",
                "Ms. L",
                "Mrs. L"
              ]
            }
          },
          {
            "id": "teacherKim",
            "name": {
              "value": "Miss Kim",
              "synonyms": [
                "Jesse Kim",
                "The health teacher",
                "Mrs. Kim"
              ]
            }
          },
          {
            "id": "teacherKairet",
            "name": {
              "value": "Dr. Kairet",
              "synonyms": [
                "mrs. curray",
                "miss curray",
                "mrs. kairet",
                "Miss kairet",
                "madame kairet",
                "madame curray",
                "Madame currae"
              ]
            }
          },
          {
            "id": "teacherHecker",
            "name": {
              "value": "Dr. Hecker",
              "synonyms": [
                "Jeanette Hecker",
                "Miss Hecker",
                "Madame Hecker",
                "Mrs. Hecker"
              ]
            }
          },
          {
            "id": "teacherFranzosa",
            "name": {
              "value": "Dr. Franzosa",
              "synonyms": [
                "Mr. Franzosa",
                "Jonathon Franzosa",
                "D-Fran"
              ]
            }
          },
          {
            "id": "teacherFossett",
            "name": {
              "value": "Mr. Fossett",
              "synonyms": [
                "Peter Fossett"
              ]
            }
          },
          {
            "id": "tecaherFloyd",
            "name": {
              "value": "Miss Floyd",
              "synonyms": [
                "Deborah Floyd",
                "Ms. Floyd",
                "Mrs. Floyd"
              ]
            }
          },
          {
            "id": "teacherFaulhaber",
            "name": {
              "value": "Mr. Faulhaber",
              "synonyms": [
                "Gregory Faulhaber",
                "G-Faul"
              ]
            }
          },
          {
            "id": "teacherTDunn",
            "name": {
              "value": "Mr. Dunn",
              "synonyms": [
                "The GOAT",
                "Timothy Dunn",
                "T-Dunn"
              ]
            }
          },
          {
            "id": "teacherPDunn",
            "name": {
              "value": "Mrs. Dunn",
              "synonyms": [
                "P-Dunn",
                "Miss Dunn",
                "Patricia Dunn"
              ]
            }
          },
          {
            "id": "teacherDestin",
            "name": {
              "value": "Dr. Destin",
              "synonyms": [
                "Yven Destin",
                "Mr. Destin"
              ]
            }
          },
          {
            "id": "teacherDahl",
            "name": {
              "value": "Mr. Dahl",
              "synonyms": [
                "Matthew Dahl"
              ]
            }
          },
          {
            "id": "teacherLChristiansen",
            "name": {
              "value": "Mrs. Christiansen",
              "synonyms": [
                "Laura Christiansen"
              ]
            }
          },
          {
            "id": "teacherJChristiansen",
            "name": {
              "value": "Mr. Christiansen",
              "synonyms": [
                "John Christiansen"
              ]
            }
          },
          {
            "id": "teacherCastro",
            "name": {
              "value": "Mrs. Castro",
              "synonyms": [
                "Mrs. Castro",
                "Malena Castro",
                "Señora Castro"
              ]
            }
          },
          {
            "id": "teacherButler",
            "name": {
              "value": "Mrs. Butler",
              "synonyms": [
                "Miss Butler",
                "Paula Butler"
              ]
            }
          },
          {
            "id": "teacherBrand",
            "name": {
              "value": "Ms. Brand",
              "synonyms": [
                "Amy Brand",
                "Mrs. Brand",
                "Miss Brand"
              ]
            }
          },
          {
            "id": "teacherBodollo",
            "name": {
              "value": "Mrs. Bodollo",
              "synonyms": [
                "Lisa Bodollo",
                "Miss Bodollo"
              ]
            }
          },
          {
            "id": "teacherBlack",
            "name": {
              "value": "Mr. Black",
              "synonyms": [
                "Merle Black",
                "Merle"
              ]
            }
          },
          {
            "id": "teacherBack",
            "name": {
              "value": "Mrs. Back",
              "synonyms": [
                "Jamie Back"
              ]
            }
          }
        ]
      }
    ],
    "intents": [
      {
        "name": "AMAZON.CancelIntent",
        "samples": []
      },
      {
        "name": "AMAZON.HelpIntent",
        "samples": []
      },
      {
        "name": "AMAZON.StopIntent",
        "samples": []
      },
      {
        "name": "dailySchedule",
        "samples": [
          "What is the bell schedule",
          "What's the schedule today",
          "What is the schedule today"
        ],
        "slots": []
      },
      {
        "name": "teacherFreeBell",
        "samples": [
          "Is {teacher} free ",
          "Is {teacher} free right now",
          "What free bells does {teacher} have today",
          "What free bells does {teacher} have",
          "When is {teacher} free"
        ],
        "slots": [
          {
            "name": "teacher",
            "type": "teacher"
          }
        ]
      },
      {
        "name": "whatBell",
        "samples": [
          "What bell is it",
          "What bell is right now"
        ],
        "slots": []
      }
    ],
    "invocationName": "country day"
  },
  "prompts": [
    {
      "id": "Elicit.Intent-teacherFreeBell.IntentSlot-teacher",
      "variations": [
        {
          "type": "PlainText",
          "value": "Which teacher are you asking about?"
        },
        {
          "type": "PlainText",
          "value": "Who is the teacher?"
        }
      ]
    }
  ],
  "dialog": {
    "intents": [
      {
        "name": "teacherFreeBell",
        "confirmationRequired": false,
        "prompts": {},
        "slots": [
          {
            "name": "teacher",
            "type": "teacher",
            "elicitationRequired": true,
            "confirmationRequired": false,
            "prompts": {
              "elicitation": "Elicit.Intent-teacherFreeBell.IntentSlot-teacher"
            }
            if IntentSlot(teacher) = teacherBack
            {
              this.emit("this is working")
            }
          }
        ]
      }
    ]
  }
}

https://pastebin.com/VyctHsbS https://pastebin.com/VyctHsbS

You cannot have an if statement inside the schema json 模式json中不能包含if语句

If you'd like to test where the skill will allow for an emission do it in the skill code. 如果您想测试技能可以在何处发射,请在技能代码中进行测试。 Your skill needs to have an end point for you to send a reponse to the user, you can do that with your own service , or use a lambda function 您的技能需要有一个端点来向用户发送响应,您可以使用自己的服务或使用lambda函数

** for more information on skill schemas check the alexa documentation **有关技能模式的更多信息,请查看alexa文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM