Skip to content

Commit

Permalink
feat: add nlu languages (CV3-235) (#450)
Browse files Browse the repository at this point in the history
<!-- You can erase any parts of this template not applicable to your Pull Request. -->

**Fixes or implements CV3-235**

### Brief description. What is this change?

 - Add new nlu languages
  • Loading branch information
viniciusdacal committed Aug 9, 2023
1 parent de59138 commit 61f4f06
Show file tree
Hide file tree
Showing 5 changed files with 752 additions and 23 deletions.
29 changes: 22 additions & 7 deletions packages/alexa-types/src/constants/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,38 @@ export const AmazonToVoiceflowLocaleMap: Record<Locale, VoiceflowConstants.Local
};

export const VoiceflowToAmazonLocaleMap: Record<VoiceflowConstants.Locale, Locale> = {
[VoiceflowConstants.Locale.EN_US]: Locale.EN_US,
[VoiceflowConstants.Locale.AR_AR]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.ZH_CN]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.NL_NL]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.FR_FR]: Locale.FR_FR,
[VoiceflowConstants.Locale.FR_CA]: Locale.FR_CA,
[VoiceflowConstants.Locale.BG_BG]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.CA_ES]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.CS_CZ]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.DA_DK]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.DE_DE]: Locale.DE_DE,
[VoiceflowConstants.Locale.EN_US]: Locale.EN_US,
[VoiceflowConstants.Locale.ES_ES]: Locale.ES_ES,
[VoiceflowConstants.Locale.ES_MX]: Locale.ES_MX,
[VoiceflowConstants.Locale.ET_EE]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.FR_CA]: Locale.FR_CA,
[VoiceflowConstants.Locale.FR_FR]: Locale.FR_FR,
[VoiceflowConstants.Locale.GU_IN]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.HE_IL]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.HI_IN]: Locale.HI_IN,
[VoiceflowConstants.Locale.HU_HU]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.IT_IT]: Locale.IT_IT,
[VoiceflowConstants.Locale.JA_JP]: Locale.JA_JP,
[VoiceflowConstants.Locale.KO_KR]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.MR_IN]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.NL_BE]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.NL_NL]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.PL_PL]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.PT_BR]: Locale.PT_BR,
[VoiceflowConstants.Locale.ES_ES]: Locale.ES_ES,
[VoiceflowConstants.Locale.ES_MX]: Locale.ES_MX,
[VoiceflowConstants.Locale.PT_PT]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.RO_RO]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.RU_RU]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.TA_IN]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.TE_IN]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.TR_TR]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.UK_UA]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.VI_VN]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.ZH_CN]: Locale.EN_US, // FIXME: Unsupported language by Alexa
[VoiceflowConstants.Locale.ZH_TW]: Locale.EN_US, // FIXME: Unsupported language by Alexa
};
29 changes: 22 additions & 7 deletions packages/google-dfes-types/src/constants/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,40 @@ export const DIALOGFLOW_TO_VOICEFLOW_LOCALE_MAP: Record<Locale, VoiceflowConstan
};

export const VOICEFLOW_TO_DIALOGFLOW_LOCALE_MAP: Record<VoiceflowConstants.Locale, Locale> = {
[VoiceflowConstants.Locale.EN_US]: Locale.EN_US,
[VoiceflowConstants.Locale.AR_AR]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.ZH_CN]: Locale.ZH_TW,
[VoiceflowConstants.Locale.NL_NL]: Locale.NL,
[VoiceflowConstants.Locale.FR_FR]: Locale.FR_FR,
[VoiceflowConstants.Locale.FR_CA]: Locale.FR_CA,
[VoiceflowConstants.Locale.BG_BG]: Locale.EN_US, // FIXME: Unsupported language by Google,
[VoiceflowConstants.Locale.CA_ES]: Locale.EN_US, // FIXME: Unsupported language by Google,
[VoiceflowConstants.Locale.CS_CZ]: Locale.EN_US, // FIXME: Unsupported language by Google,
[VoiceflowConstants.Locale.DA_DK]: Locale.EN_US, // FIXME: Unsupported language by Google,
[VoiceflowConstants.Locale.DE_DE]: Locale.DE,
[VoiceflowConstants.Locale.EN_US]: Locale.EN_US,
[VoiceflowConstants.Locale.ES_ES]: Locale.ES_ES,
[VoiceflowConstants.Locale.ES_MX]: Locale.ES_419,
[VoiceflowConstants.Locale.ET_EE]: Locale.EN_US, // FIXME: Unsupported language by Google,
[VoiceflowConstants.Locale.FR_CA]: Locale.FR_CA,
[VoiceflowConstants.Locale.FR_FR]: Locale.FR_FR,
[VoiceflowConstants.Locale.GU_IN]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.HE_IL]: Locale.EN_US, // FIXME: Unsupported language by Google,
[VoiceflowConstants.Locale.HI_IN]: Locale.HI,
[VoiceflowConstants.Locale.HU_HU]: Locale.EN_US, // FIXME: Unsupported language by Google,
[VoiceflowConstants.Locale.IT_IT]: Locale.IT,
[VoiceflowConstants.Locale.JA_JP]: Locale.JA,
[VoiceflowConstants.Locale.KO_KR]: Locale.KO,
[VoiceflowConstants.Locale.MR_IN]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.NL_BE]: Locale.EN_US, // FIXME: Unsupported language by Google,
[VoiceflowConstants.Locale.NL_NL]: Locale.NL,
[VoiceflowConstants.Locale.PL_PL]: Locale.EN_US, // FIXME: Unsupported language by Google,
[VoiceflowConstants.Locale.PT_BR]: Locale.PT_BR,
[VoiceflowConstants.Locale.ES_ES]: Locale.ES_ES,
[VoiceflowConstants.Locale.ES_MX]: Locale.ES_419,
[VoiceflowConstants.Locale.PT_PT]: Locale.EN_US, // FIXME: Unsupported language by Google,
[VoiceflowConstants.Locale.RO_RO]: Locale.EN_US, // FIXME: Unsupported language by Google,
[VoiceflowConstants.Locale.RU_RU]: Locale.EN_US, // FIXME: Unsupported language by Google,
[VoiceflowConstants.Locale.TA_IN]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.TE_IN]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.TR_TR]: Locale.TR,
[VoiceflowConstants.Locale.UK_UA]: Locale.EN_US, // FIXME: Unsupported language by Google,
[VoiceflowConstants.Locale.VI_VN]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.ZH_CN]: Locale.ZH_TW,
[VoiceflowConstants.Locale.ZH_TW]: Locale.EN_US, // FIXME: Unsupported language by Google,
};

export const GOOGLE_TO_DIALOGFLOW_LOCALE_MAP: Record<GoogleConstants.Locale, Locale> = {
Expand Down
30 changes: 23 additions & 7 deletions packages/google-types/src/constants/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,41 @@ export const GOOGLE_TO_VOICEFLOW_LOCALE_MAP: Record<Locale, VoiceflowConstants.L
};

export const VOICEFLOW_TO_GOOGLE_LOCALE_MAP: Record<VoiceflowConstants.Locale, Locale> = {
[VoiceflowConstants.Locale.EN_US]: Locale.EN_US,
[VoiceflowConstants.Locale.AR_AR]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.ZH_CN]: Locale.ZH_TW,
[VoiceflowConstants.Locale.NL_NL]: Locale.NL_NL,
[VoiceflowConstants.Locale.FR_FR]: Locale.FR_FR,
[VoiceflowConstants.Locale.FR_CA]: Locale.FR_CA,
[VoiceflowConstants.Locale.BG_BG]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.CA_ES]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.CS_CZ]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.DA_DK]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.DE_DE]: Locale.DE_DE,
[VoiceflowConstants.Locale.EN_US]: Locale.EN_US,
[VoiceflowConstants.Locale.ES_ES]: Locale.ES_ES,
[VoiceflowConstants.Locale.ES_MX]: Locale.ES_419,
[VoiceflowConstants.Locale.ET_EE]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.FR_CA]: Locale.FR_CA,
[VoiceflowConstants.Locale.FR_FR]: Locale.FR_FR,
[VoiceflowConstants.Locale.GU_IN]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.HE_IL]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.HI_IN]: Locale.HI_IN,
[VoiceflowConstants.Locale.HU_HU]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.IT_IT]: Locale.IT_IT,
[VoiceflowConstants.Locale.JA_JP]: Locale.JA_JP,
[VoiceflowConstants.Locale.KO_KR]: Locale.KO_KR,
[VoiceflowConstants.Locale.MR_IN]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.NL_BE]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.NL_NL]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.NL_NL]: Locale.NL_NL,
[VoiceflowConstants.Locale.PL_PL]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.PT_BR]: Locale.PT_BR,
[VoiceflowConstants.Locale.ES_ES]: Locale.ES_ES,
[VoiceflowConstants.Locale.ES_MX]: Locale.ES_419,
[VoiceflowConstants.Locale.PT_PT]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.RO_RO]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.RU_RU]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.TA_IN]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.TE_IN]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.TR_TR]: Locale.TR_TR,
[VoiceflowConstants.Locale.UK_UA]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.VI_VN]: Locale.EN_US, // FIXME: Unsupported language by Google
[VoiceflowConstants.Locale.ZH_CN]: Locale.ZH_TW,
[VoiceflowConstants.Locale.ZH_TW]: Locale.EN_US, // FIXME: Unsupported language by Google
};

export const GOOGLE_TO_VOICEFLOW_SLOT_TYPE_MAP: Record<SlotType, VoiceflowConstants.SlotType> = {
Expand Down
79 changes: 77 additions & 2 deletions packages/voiceflow-types/src/constants/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,28 @@ export enum Locale {
// Arabic
AR_AR = 'ar-AR',

// Bulgarian
BG_BG = 'bg-BG',

// Catalan
CA_ES = 'ca-ES',

// Czech
CS_CZ = 'cs-CZ',

// Chinese
ZH_CN = 'zh-CN',
ZH_TW = 'zh-TW',

// Dutch
// Danish
DA_DK = 'da-DK',

// Dutch / Flemish
NL_NL = 'nl-NL',
NL_BE = 'nl-BE',

// Estonian
ET_EE = 'et-EE',

// French
FR_FR = 'fr-FR',
Expand All @@ -23,6 +40,12 @@ export enum Locale {
// German
DE_DE = 'de-DE',

// Hebrew
HE_IL = 'he-IL',

// Hungarian
HU_HU = 'hu-HU',

// Gujarati
GU_IN = 'gu-IN',

Expand All @@ -41,9 +64,19 @@ export enum Locale {
// Marathi
MR_IN = 'mr-IN',

// Polish
PL_PL = 'pl-PL',

// Portugese
PT_PT = 'pt-PT',
PT_BR = 'pt-BR',

// Romanian
RO_RO = 'ro-RO',

// Russian
RU_RU = 'ru-RU',

// Spanish
ES_ES = 'es-ES',
ES_MX = 'es-MX',
Expand All @@ -56,6 +89,12 @@ export enum Locale {

// Turkish
TR_TR = 'tr-TR',

// Ukrainian
UK_UA = 'uk-UA',

// Vietnamese
VI_VN = 'vi-VN',
}

export enum Language {
Expand All @@ -65,12 +104,27 @@ export enum Language {
// Arabic
AR = 'ar',

// Bulgarian
BG = 'bg',

// Catalan
CA = 'ca',

// Czech
CS = 'cs',

// Chinese
ZH = 'zh',

// Dutch
// Danish
DA = 'da',

// Dutch / Flemish
NL = 'nl',

// Estonian
ET = 'et',

// French
FR = 'fr',

Expand All @@ -80,9 +134,15 @@ export enum Language {
// Gujarati
GU = 'gu',

// Hebrew
HE = 'he',

// Hindi
HI = 'hi',

// Hungarian
HU = 'hu',

// Italian
IT = 'it',

Expand All @@ -95,9 +155,18 @@ export enum Language {
// Marathi
MR = 'mr',

// Polish
PL = 'pl',

// Portugese
PT = 'pt',

// Romanian
RO = 'ro',

// Russian
RU = 'ru',

// Spanish
ES = 'es',

Expand All @@ -109,6 +178,12 @@ export enum Language {

// Turkish
TR = 'tr',

// Ukrainian
UK = 'uk',

// Vietnamese
VI = 'vi',
}

const LanguageValues: ReadonlySet<Language> = new Set(Object.values(Language));
Expand Down
Loading

0 comments on commit 61f4f06

Please sign in to comment.