Ignore:
Timestamp:
2021-08-11T16:03:52+12:00 (3 years ago)
Author:
davidb
Message:

Add failed transcription to TestServlet response

Location:
gs3-extensions/atea-nlp-tools/trunk/src/koreromaori-proxy
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/atea-nlp-tools/trunk/src/koreromaori-proxy/src/main/java/org/atea/nlptools/koreromaoriproxy/TestServlet.java

    r35260 r35283  
    9696            }
    9797
     98            AudioFilePart failedTranscription = new AudioFilePart("id10t.wav", null);
     99            failedTranscription.setTranscriptionResult(new TranscriptionResult("Ruh roh!"));
     100            audioFileParts.add(failedTranscription);
     101
    98102            // Transform the Tuhituhi response into our own format
    99103            List<TranscriptionResultDto> responses = new ArrayList<TranscriptionResultDto>(audioFileParts.size());
     
    116120    {
    117121        ArrayList<TranscriptionResultMetadata> metadata = new ArrayList<TranscriptionResultMetadata>(7);
    118         for (int i = 0; i < 4; i++)
     122        String transcription = "";
     123
     124        for (int i = 0; i < 8; i++)
    119125        {
     126            transcription += "ngā tama a rangi | ";
    120127            metadata.add(new TranscriptionResultMetadata('ŋ', 0.5, 0.44));
    121128            metadata.add(new TranscriptionResultMetadata('ā', 0.5, 0.46));
     
    132139            metadata.add(new TranscriptionResultMetadata('ŋ', 0.5, 1.6));
    133140            metadata.add(new TranscriptionResultMetadata('i', 0.5, 1.62));
     141            metadata.add(new TranscriptionResultMetadata(' ', 0.5, 1.62));
    134142            metadata.add(new TranscriptionResultMetadata('|', 0.5, 1.62));
     143            metadata.add(new TranscriptionResultMetadata(' ', 0.5, 1.62));
    135144        }
    136145       
    137         return new TranscriptionResult("Generated a mock transcription of akl_mi_pk_0001.wav", metadata, "1.0-fake", true, "ngā tama a rangi");
     146        return new TranscriptionResult("Generated a mock transcription of akl_mi_pk_0001.wav", metadata, "1.0-fake", true, transcription);
    138147    }
    139148}
Note: See TracChangeset for help on using the changeset viewer.