{"id":13799234,"url":"https://github.com/miguelmota/intent-utterance-file-parser","last_synced_at":"2025-05-13T06:32:38.938Z","repository":{"id":57275159,"uuid":"42503678","full_name":"miguelmota/intent-utterance-file-parser","owner":"miguelmota","description":"Parse an intent utterance file, like the Alexa Skills Kit Sample Utterance file.","archived":true,"fork":false,"pushed_at":"2015-09-18T07:46:57.000Z","size":136,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-12T07:56:30.397Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/miguelmota/intent-utterance-file-parser","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miguelmota.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-15T07:57:35.000Z","updated_at":"2024-09-18T11:13:18.000Z","dependencies_parsed_at":"2022-09-15T19:11:41.568Z","dependency_job_id":null,"html_url":"https://github.com/miguelmota/intent-utterance-file-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelmota%2Fintent-utterance-file-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelmota%2Fintent-utterance-file-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelmota%2Fintent-utterance-file-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelmota%2Fintent-utterance-file-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miguelmota","download_url":"https://codeload.github.com/miguelmota/intent-utterance-file-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225183827,"owners_count":17434194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:01:00.175Z","updated_at":"2024-11-18T13:32:03.885Z","avatar_url":"https://github.com/miguelmota.png","language":"JavaScript","funding_links":[],"categories":["NPM Modules"],"sub_categories":[],"readme":"# Intent Utterance File Parser\n\n\u003e Parse an intent utterance file, like the [Alexa Skills Kit Sample Utterance file](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/defining-the-voice-interface).\n\nThe parser extracts words and slots from each intent.\n\n# Install\n\n```bash\nnpm install intent-utterance-file-parser\n```\n\n# Usage\n\n`IntentUtterances.txt`\n\n```text\nGetHoroscope what is the horoscope for {pisces|Sign}\nGetHoroscope what will the horoscope for {leo|Sign} be {next tuesday|Date}\nGetHoroscope get me my horoscope\nGetHoroscope {gemini|Sign}\n\nGetLuckyNumbers what are my lucky numbers\nGetLuckyNumbers tell me my lucky numbers\n```\n\nFile parsing\n\n```javascript\nconst fs = require('fs');\nconst IntentUtteranceParser = require('intent-utterance-file-parser');\n\nconst fileStream = fs.createReadStream(__dirname + '/IntentUtterances.txt');\n\nIntentUtteranceParser(fileStream, function(error, response) {\n  if (error) {\n    console.error(error);\n    return false;\n  }\n\n  console.log(response);\n  /*\n    [\n      {\n        \"intent\": \"GetHoroscope\",\n        \"slots\": [\n          {\n            \"name\": \"Sign\",\n            \"type\": \"LITERAL\"\n          },\n          {\n            \"name\": \"Date\",\n            \"type\": \"LITERAL\"\n          }\n        ],\n        \"utterances\": [\n          [\n            \"what\",\n            \"is\",\n            \"the\",\n            \"horoscope\",\n            \"for\",\n            \"pisces\"\n          ],\n          [\n            \"what\",\n            \"will\",\n            \"the\",\n            \"horoscope\",\n            \"for\",\n            \"be\",\n            \"leo\",\n            \"next\",\n            \"tuesday\"\n          ],\n          [\n            \"get\",\n            \"me\",\n            \"my\",\n            \"horoscope\"\n          ],\n          [\n            \"gemini\"\n          ]\n        ]\n      },\n      {\n        \"intent\": \"GetLuckyNumbers\",\n        \"slots\": [],\n        \"utterances\": [\n          [\n            \"what\",\n            \"are\",\n            \"my\",\n            \"lucky\",\n            \"numbers\"\n          ],\n          [\n            \"tell\",\n            \"me\",\n            \"my\",\n            \"lucky\",\n            \"numbers\"\n          ]\n        ]\n      }\n    ]\n  */\n\n  console.log(IntentUtteranceParser.getUniqueWords(response));\n  /*\n    [\n      \"what\",\n      \"is\",\n      \"the\",\n      \"horoscope\",\n      \"for\",\n      \"pisces\",\n      \"will\",\n      \"be\",\n      \"leo\",\n      \"next\",\n      \"tuesday\",\n      \"get\",\n      \"me\",\n      \"my\",\n      \"gemini\",\n      \"are\",\n      \"lucky\",\n      \"numbers\",\n      \"tell\"\n    ]\n  */\n});\n```\n\n# Test\n\n```bash\nnpm test\n```\n\n# License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelmota%2Fintent-utterance-file-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiguelmota%2Fintent-utterance-file-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelmota%2Fintent-utterance-file-parser/lists"}