@c4t4/heyamigo 0.11.1 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gateway/triggers.js +1 -9
- package/package.json +1 -1
package/dist/gateway/triggers.js
CHANGED
|
@@ -90,14 +90,6 @@ function phraseMatches(normalizedText, phrase) {
|
|
|
90
90
|
const re = new RegExp(`(^| )${escapeRegex(normalizedPhrase)}($| )`, 'i');
|
|
91
91
|
return re.test(normalizedText);
|
|
92
92
|
}
|
|
93
|
-
function wakePhraseMatches(normalizedText, phrase) {
|
|
94
|
-
const normalizedPhrase = normalizeAudioText(phrase);
|
|
95
|
-
if (!normalizedPhrase)
|
|
96
|
-
return false;
|
|
97
|
-
const wake = '(hey|hi|hello|yo|ok|okay|oye|hola)';
|
|
98
|
-
const re = new RegExp(`(^| )${wake} ${escapeRegex(normalizedPhrase)}($| )`, 'i');
|
|
99
|
-
return re.test(normalizedText);
|
|
100
|
-
}
|
|
101
93
|
function audioAliasMatches(transcript, aliases) {
|
|
102
94
|
const normalizedTranscript = normalizeAudioText(transcript);
|
|
103
95
|
if (!normalizedTranscript)
|
|
@@ -111,7 +103,7 @@ function audioAliasMatches(transcript, aliases) {
|
|
|
111
103
|
...(AUDIO_ALIAS_VARIANTS[normalizedAlias] ?? []),
|
|
112
104
|
]);
|
|
113
105
|
for (const variant of variants) {
|
|
114
|
-
if (
|
|
106
|
+
if (phraseMatches(normalizedTranscript, variant)) {
|
|
115
107
|
return { alias, variant: normalizeAudioText(variant) };
|
|
116
108
|
}
|
|
117
109
|
}
|
package/package.json
CHANGED