Skip to content

Commit

Permalink
fix codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
ksyeo1010 committed Nov 22, 2023
1 parent ae60dd5 commit f44c643
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public class Leopard {
* @param accessKey AccessKey obtained from Picovoice Console
* @param modelPath Absolute path to the file containing Leopard model parameters.
* @param enableAutomaticPunctuation Set to `true` to enable automatic punctuation insertion.
* @param enableDiarization Set to `true` to enable speaker diarization, which allows Leopard to differentiate speakers
* as part of the transcription process. Word metadata will include a `speaker_tag` to
* identify unique speakers.
* @param enableDiarization Set to `true` to enable speaker diarization, which allows Leopard to
* differentiate speakers as part of the transcription process. Word
* metadata will include a `speaker_tag` to identify unique speakers.
* @throws LeopardException if there is an error while initializing Leopard.
*/
private Leopard(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

package ai.picovoice.leopard;

/**
* LeopardTranscript Class.
*/
public class LeopardTranscript {

private final String transcriptString;
Expand Down Expand Up @@ -46,6 +49,9 @@ public Word[] getWordArray() {
return wordArray;
}

/**
* LeopardTranscript.Word class
*/
public static class Word {
private final String word;
private final float confidence;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ protected static short[] readAudioFile(String audioFile) throws Exception {
}

protected void validateMetadata(
LeopardTranscript.Word[] words,
LeopardTranscript.Word[] expectedWords,
boolean enableDiarization
LeopardTranscript.Word[] words,
LeopardTranscript.Word[] expectedWords,
boolean enableDiarization
) {
for (int i = 0; i < words.length; i++) {
assertEquals(words[i].getWord(), expectedWords[i].getWord());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ public void testTranscribeAudioFileWithPunctuation() throws Exception {
boolean useCER = language.equals("ja");

LeopardTranscript result = leopard.processFile(audioFile.getAbsolutePath());
assertTrue(getWordErrorRate(result.getTranscriptString(), expectedTranscriptWithPunctuation, useCER) < errorRate);
assertTrue(getWordErrorRate(
result.getTranscriptString(), expectedTranscriptWithPunctuation, useCER) < errorRate);

validateMetadata(
result.getWordArray(),
Expand Down
2 changes: 1 addition & 1 deletion resources/.lint/java/suppress.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<suppress files=".*(Test|Exception|Callback|demo|Module|Plugin|Package).*\.java" checks="MissingJavadocType"/>
<suppress files=".*(Test|Exception|Error|demo).*\.java" checks="OneTopLevelClass"/>
<suppress files=".*(Test).*\.java" checks="MethodName"/>
<suppress files=".*(demo|Module|Plugin).*\.java" checks="MissingJavadocMethod"/>
<suppress files=".*(demo|Module|Plugin|Exception).*\.java" checks="MissingJavadocMethod"/>
<suppress files=".*generated-sources.*" checks="[a-zA-Z0-9]*"/>
<suppress files=".*build.*" checks="[a-zA-Z0-9]*"/>
<suppress files=".*" checks="CustomImportOrder"/>
Expand Down

0 comments on commit f44c643

Please sign in to comment.