aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ComparisonBox.tsx
diff options
context:
space:
mode:
authoralyssaf16 <alyssa_feinberg@brown.edu>2024-10-06 15:11:20 -0400
committeralyssaf16 <alyssa_feinberg@brown.edu>2024-10-06 15:11:20 -0400
commitfa54fdf2bf9bf8523da393a81ec1ac1cd4fa0f4c (patch)
tree02290e2210d5a539f24e1059f66144a945bd1c1f /src/client/views/nodes/ComparisonBox.tsx
parent0d34ea8ab82be1140916a48df4e46ef15c7b23db (diff)
comments
Diffstat (limited to 'src/client/views/nodes/ComparisonBox.tsx')
-rw-r--r--src/client/views/nodes/ComparisonBox.tsx13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/client/views/nodes/ComparisonBox.tsx b/src/client/views/nodes/ComparisonBox.tsx
index 9ac8d7c52..461a65c27 100644
--- a/src/client/views/nodes/ComparisonBox.tsx
+++ b/src/client/views/nodes/ComparisonBox.tsx
@@ -340,6 +340,10 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
ContextMenu.Instance.setLangIndex(ind);
};
+ /**
+ * Determine which language the speech to text tool is in.
+ * @returns
+ */
convertAbr = () => {
switch (this.recognition.lang) {
case 'en-US': return 'English'; //prettier-ignore
@@ -364,6 +368,9 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
ContextMenu.Instance.displayMenu(x, y);
};
+ /**
+ * Creates an AudioBox to record a user's audio.
+ */
evaluatePronunciation = () => {
const newAudio = Docs.Create.AudioDocument(nullAudio, { _width: 200, _height: 100 });
this.Document.audio = newAudio[DocData];
@@ -386,6 +393,11 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
this.Document.phoneticTranscription = response.data['transcription'];
};
+ /**
+ * Extracts the id of the youtube video url.
+ * @param url
+ * @returns
+ */
getYouTubeVideoId = (url: string) => {
const regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=|\?v=)([^#\&\?]*).*/;
const match = url.match(regExp);
@@ -510,7 +522,6 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
} else if (callType === GPTCallType.FLASHCARD) {
this._loading = false;
return res;
- } else if (callType === GPTCallType.STACK) {
}
this._loading = false;
return res;