Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/lu/src/parser/lubuild/multi-language-recognizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
* Licensed under the MIT License.
*/

const path = require('path')

export class MultiLanguageRecognizer {
public recognizers: any
private readonly id: string
private readonly dialogPath: string
private readonly $schema: string | undefined

constructor(dialogPath: string, recognizers: any, schema?: string) {
this.id = `LUIS_${path.basename(dialogPath).split('.')[0]}`
this.dialogPath = dialogPath
this.recognizers = recognizers
this.$schema = schema
Expand All @@ -17,6 +21,7 @@ export class MultiLanguageRecognizer {
save(): string {
let output: any = {
$kind: 'Microsoft.MultiLanguageRecognizer',
id: this.id,
recognizers: this.recognizers
}

Expand Down
3 changes: 3 additions & 0 deletions packages/lu/src/parser/lubuild/recognizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class Recognizer {
}

versionId: string
private readonly id: string
private readonly applicationId: string | undefined
private readonly endpoint: string | undefined
private readonly endpointKey: string | undefined
Expand All @@ -33,6 +34,7 @@ export class Recognizer {

constructor(private readonly luFile: string, targetFileName: string, schema?: string) {
this.appId = ''
this.id = `LUIS_${targetFileName.split('.')[0]}`
this.applicationId = `=settings.luis.${targetFileName.split('.').join('_').replace(/-/g, '_')}`
this.endpoint = '=settings.luis.endpoint'
this.endpointKey = '=settings.luis.endpointKey'
Expand All @@ -43,6 +45,7 @@ export class Recognizer {
save(): string {
let output: any = {
$kind: 'Microsoft.LuisRecognizer',
id: this.id,
applicationId: this.applicationId,
endpoint: this.endpoint,
endpointKey: this.endpointKey
Expand Down
5 changes: 5 additions & 0 deletions packages/lu/src/parser/qnabuild/multi-language-recognizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
* Licensed under the MIT License.
*/

const path = require('path')

export class MultiLanguageRecognizer {
public recognizers: any
private readonly id: string
private readonly dialogPath: string
private readonly $schema: string | undefined

constructor(dialogPath: string, recognizers: any, schema?: string) {
this.id = `QnA_${path.basename(dialogPath).split('.')[0]}`
this.dialogPath = dialogPath
this.recognizers = recognizers
this.$schema = schema
Expand All @@ -17,6 +21,7 @@ export class MultiLanguageRecognizer {
save(): string {
let output: any = {
$kind: 'Microsoft.MultiLanguageRecognizer',
id: this.id,
recognizers: this.recognizers
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.LuisRecognizer",
"id": "LUIS_foo",
"applicationId": "=settings.luis.foo_en_us_lu",
"endpoint": "=settings.luis.endpoint",
"endpointKey": "=settings.luis.endpointKey"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.LuisRecognizer",
"id": "LUIS_foo",
"applicationId": "=settings.luis.foo_fr_fr_lu",
"endpoint": "=settings.luis.endpoint",
"endpointKey": "=settings.luis.endpointKey"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.MultiLanguageRecognizer",
"id": "LUIS_foo",
"recognizers": {
"fr-fr": "foo.fr-fr.lu",
"en-us": "foo.en-us.lu",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.LuisRecognizer",
"id": "LUIS_foo",
"applicationId": "=settings.luis.foo_zh_cn_lu",
"endpoint": "=settings.luis.endpoint",
"endpointKey": "=settings.luis.endpointKey"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.LuisRecognizer",
"id": "LUIS_foo",
"applicationId": "f8c64e2a-2222-3a09-8f78-39d7adc76ec5",
"endpoint": "yyy",
"endpointKey": "zzz"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.LuisRecognizer",
"id": "LUIS_foo",
"applicationId": "f8c64e2a-1111-3a09-8f78-39d7adc76ec5",
"endpoint": "yyy",
"endpointKey": "zzz"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.MultiLanguageRecognizer",
"id": "LUIS_foo",
"recognizers": {
"en-us": "foo.en-us.lu",
"": "foo.en-us.lu",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.LuisRecognizer",
"id": "LUIS_foo",
"applicationId": "=settings.luis.foo_zh_cn_lu",
"endpoint": "=settings.luis.endpoint",
"endpointKey": "=settings.luis.endpointKey"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.LuisRecognizer",
"id": "LUIS_foo",
"applicationId": "f8c64e2a-2222-3a09-8f78-39d7adc76ec5",
"endpoint": "yyy",
"endpointKey": "zzz"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.LuisRecognizer",
"id": "LUIS_foo",
"applicationId": "f8c64e2a-1111-3a09-8f78-39d7adc76ec5",
"endpoint": "yyy",
"endpointKey": "zzz"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.MultiLanguageRecognizer",
"id": "LUIS_foo",
"recognizers": {
"en-us": "foo.en-us.lu",
"": "foo.en-us.lu",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.LuisRecognizer",
"id": "LUIS_test",
"applicationId": "=settings.luis.test_en_us_lu",
"endpoint": "=settings.luis.endpoint",
"endpointKey": "=settings.luis.endpointKey"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.MultiLanguageRecognizer",
"id": "LUIS_test",
"recognizers": {
"en-us": "test.en-us.lu",
"": "test.en-us.lu"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/BotFramework-Composer/stable/Composer/packages/server/schemas/sdk.schema",
"$kind": "Microsoft.LuisRecognizer",
"id": "LUIS_sandwich",
"applicationId": "=settings.luis.sandwich_en_us_lu",
"endpoint": "=settings.luis.endpoint",
"endpointKey": "=settings.luis.endpointKey"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/BotFramework-Composer/stable/Composer/packages/server/schemas/sdk.schema",
"$kind": "Microsoft.MultiLanguageRecognizer",
"id": "LUIS_sandwich",
"recognizers": {
"en-us": "sandwich.en-us.lu",
"": "sandwich.en-us.lu"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.LuisRecognizer",
"id": "LUIS_sandwich",
"applicationId": "=settings.luis.sandwich_en_us_lu",
"endpoint": "=settings.luis.endpoint",
"endpointKey": "=settings.luis.endpointKey"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.MultiLanguageRecognizer",
"id": "LUIS_sandwich",
"recognizers": {
"en-us": "sandwich.en-us.lu",
"": "sandwich.en-us.lu"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.MultiLanguageRecognizer",
"id": "QnA_test",
"recognizers": {
"en-us": "test.en-us.qna",
"": "test.en-us.qna",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/BotFramework-Composer/stable/Composer/packages/server/schemas/sdk.schema",
"$kind": "Microsoft.MultiLanguageRecognizer",
"id": "QnA_test",
"recognizers": {
"en-us": "test.en-us.qna",
"": "test.en-us.qna"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$kind": "Microsoft.MultiLanguageRecognizer",
"id": "QnA_test",
"recognizers": {
"en-us": "test.en-us.qna",
"": "test.en-us.qna"
Expand Down