Changeset 35355 for main/trunk


Ignore:
Timestamp:
2021-09-09T17:33:51+12:00 (3 years ago)
Author:
cstephen
Message:

Add korero-maori-asr

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  
    2222# ASR Development TODO
    2323
    24 - Play audio at certain words, based on timestamps returned by tuhituhi API
    2524- Corrections interface
    2625- WebVTT download option
  • main/trunk/model-interfaces-dev/atea/js/asr/asr-controller.js

    r35321 r35355  
    3636        this.isDeleted = false;
    3737
    38         /** @type {{word: String, startTime: Number, endTime: Number, shouldHighlight: Boolean}[]} */
     38        /** @type {TranscriptionWord[]} */
    3939        this.words = [];
     40    }
     41}
     42
     43class 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;
    4066    }
    4167}
     
    273299            return chars;
    274300        },
    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            }
    276319            console.log(event);
    277             console.log(word);
     320            console.log(index);
    278321        }
    279322    },
  • main/trunk/model-interfaces-dev/atea/transform/pages/asr.xsl

    r35321 r35355  
    153153                                        </span>
    154154                                    </li>
    155                                     <li v-if="displayMode == 'editor'" v-for="word in transcription.words" class="transcription__word-container">
     155                                    <li v-if="displayMode == 'editor'" v-for="(word, index) in transcription.words" class="transcription__word-container">
    156156                                        <!-- <span class="transcription__word" v-on:input="onEditorWordInput($event, word.word)" contenteditable="true" v-text="word.word" /> -->
    157157                                        <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)" />
    159159                                        <span>&#x00A0;</span> <!-- nbsp -->
    160160                                    </li>
Note: See TracChangeset for help on using the changeset viewer.