Changeset 35355 for main/trunk
- Timestamp:
- 2021-09-09T17:33:51+12:00 (3 years ago)
- Location:
- main/trunk/model-interfaces-dev/atea
- Files:
-
- 30 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/README.md
r35284 r35355 22 22 # ASR Development TODO 23 23 24 - Play audio at certain words, based on timestamps returned by tuhituhi API25 24 - Corrections interface 26 25 - WebVTT download option -
main/trunk/model-interfaces-dev/atea/js/asr/asr-controller.js
r35321 r35355 36 36 this.isDeleted = false; 37 37 38 /** @type { {word: String, startTime: Number, endTime: Number, shouldHighlight: Boolean}[]} */38 /** @type {TranscriptionWord[]} */ 39 39 this.words = []; 40 } 41 } 42 43 class TranscriptionWord 44 { 45 /** 46 * Initialises a new instance of the {@link TranscriptionWord} class. 47 * 48 * @param {String} word The word. 49 * @param {Number} startTime The start time of the word as seconds into the transcription. 50 * @param {Number} endTime The end time of the word as seconds into the transcription. 51 * @param {Boolean} shouldHighlight Gets or sets a value indicating if this transcription should be highlighted. 52 */ 53 constructor(word, startTime, endTime, shouldHighlight) 54 { 55 /** @type {String} The word. */ 56 this.word = word; 57 58 /** @type {Number} The start time of the word as seconds into the transcription. */ 59 this.startTime = startTime; 60 61 /** @type {Number} The end time of the word as seconds into the transcription. */ 62 this.endTime = endTime; 63 64 /** @type {Boolean} Gets or sets a value indicating if this transcription should be highlighted. */ 65 this.shouldHighlight = shouldHighlight; 40 66 } 41 67 } … … 273 299 return chars; 274 300 }, 275 onEditorWordInput(event, word) { 301 /** 302 * Invoked when the value of a word changes. 303 * @param {InputEvent} event An input event. 304 * @param {Number} index The index of the word that has changed. 305 * @param {String} id The ID of the transcription to which this word belongs. 306 */ 307 onEditorWordInput(event, index, id) { 308 console.log(id); 309 310 if (event.inputType == "insertText") { 311 if (event.data == " ") { 312 /** @type {TranscriptionViewModel} */ 313 let t = this.transcriptions.get(id); 314 t.words[index].word = t.words[index].word.replace(' ', ""); 315 t.words.push(new TranscriptionWord()); 316 //t.words.splice(index++, 0, new TranscriptionWord()); 317 } 318 } 276 319 console.log(event); 277 console.log( word);320 console.log(index); 278 321 } 279 322 }, -
main/trunk/model-interfaces-dev/atea/transform/pages/asr.xsl
r35321 r35355 153 153 </span> 154 154 </li> 155 <li v-if="displayMode == 'editor'" v-for=" wordin transcription.words" class="transcription__word-container">155 <li v-if="displayMode == 'editor'" v-for="(word, index) in transcription.words" class="transcription__word-container"> 156 156 <!-- <span class="transcription__word" v-on:input="onEditorWordInput($event, word.word)" contenteditable="true" v-text="word.word" /> --> 157 157 <input type="text" v-bind:size="word.word.length == 1 ? 1 : word.word.length - 1" v-model="word.word" 158 class="transcription__word" v-on:input="onEditorWordInput($event, word.word)" />158 class="transcription__word" v-on:input="onEditorWordInput($event, index, id)" /> 159 159 <span> </span> <!-- nbsp --> 160 160 </li>
Note:
See TracChangeset
for help on using the changeset viewer.