From fa54fdf2bf9bf8523da393a81ec1ac1cd4fa0f4c Mon Sep 17 00:00:00 2001 From: alyssaf16 Date: Sun, 6 Oct 2024 15:11:20 -0400 Subject: comments --- src/client/views/nodes/ComparisonBox.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/client/views/nodes/ComparisonBox.tsx') 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() 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() 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() 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() } else if (callType === GPTCallType.FLASHCARD) { this._loading = false; return res; - } else if (callType === GPTCallType.STACK) { } this._loading = false; return res; -- cgit v1.2.3-70-g09d2