Update Java docs

This commit is contained in:
Reuben Morais 2020-07-07 15:18:30 +02:00
parent 417b8e4fe3
commit 16f89dff9e
6 changed files with 17 additions and 107 deletions

View File

@ -13,17 +13,17 @@ Metadata
.. doxygenclass:: org::mozilla::deepspeech::libdeepspeech::Metadata
:project: deepspeech-java
:members: getTranscripts, getNum_transcripts, getTranscript
:members: getNumTranscripts, getTranscript
CandidateTranscript
-------------------
.. doxygenclass:: org::mozilla::deepspeech::libdeepspeech::CandidateTranscript
:project: deepspeech-java
:members: getTokens, getNum_tokens, getConfidence, getToken
:members: getNumTokens, getConfidence, getToken
TokenMetadata
-------------
.. doxygenclass:: org::mozilla::deepspeech::libdeepspeech::TokenMetadata
:project: deepspeech-java
:members: getText, getTimestep, getStart_time
:members: getText, getTimestep, getStartTime

View File

@ -35,19 +35,11 @@ public class CandidateTranscript {
}
}
/**
* Array of TokenMetadata objects
*/
public TokenMetadata getTokens() {
long cPtr = implJNI.CandidateTranscript_tokens_get(swigCPtr, this);
return (cPtr == 0) ? null : new TokenMetadata(cPtr, false);
}
/**
* Size of the tokens array
*/
public long getNum_tokens() {
return implJNI.CandidateTranscript_num_tokens_get(swigCPtr, this);
public long getNumTokens() {
return implJNI.CandidateTranscript_NumTokens_get(swigCPtr, this);
}
/**
@ -56,7 +48,7 @@ public class CandidateTranscript {
* contributed to the creation of this transcript.
*/
public double getConfidence() {
return implJNI.CandidateTranscript_confidence_get(swigCPtr, this);
return implJNI.CandidateTranscript_Confidence_get(swigCPtr, this);
}
/**

View File

@ -16,6 +16,11 @@ public enum DeepSpeech_Error_Codes {
ERR_INVALID_SCORER(0x2002),
ERR_MODEL_INCOMPATIBLE(0x2003),
ERR_SCORER_NOT_ENABLED(0x2004),
ERR_SCORER_UNREADABLE(0x2005),
ERR_SCORER_INVALID_LM(0x2006),
ERR_SCORER_NO_TRIE(0x2007),
ERR_SCORER_INVALID_TRIE(0x2008),
ERR_SCORER_VERSION_MISMATCH(0x2009),
ERR_FAIL_INIT_MMAP(0x3000),
ERR_FAIL_INIT_SESS(0x3001),
ERR_FAIL_INTERPRETER(0x3002),

View File

@ -39,19 +39,11 @@ public class Metadata {
}
}
/**
* Array of CandidateTranscript objects
*/
public CandidateTranscript getTranscripts() {
long cPtr = implJNI.Metadata_transcripts_get(swigCPtr, this);
return (cPtr == 0) ? null : new CandidateTranscript(cPtr, false);
}
/**
* Size of the transcripts array
*/
public long getNum_transcripts() {
return implJNI.Metadata_num_transcripts_get(swigCPtr, this);
public long getNumTranscripts() {
return implJNI.Metadata_NumTranscripts_get(swigCPtr, this);
}
/**

View File

@ -1,79 +0,0 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.0.2
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package org.mozilla.deepspeech.libdeepspeech;
/**
* Stores each individual character, along with its timing information
*/
public class MetadataItem {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected MetadataItem(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(MetadataItem obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
throw new UnsupportedOperationException("C++ destructor does not have public access");
}
swigCPtr = 0;
}
}
/**
* The character generated for transcription
*/
public void setCharacter(String value) {
implJNI.MetadataItem_character_set(swigCPtr, this, value);
}
/**
* The character generated for transcription
*/
public String getCharacter() {
return implJNI.MetadataItem_character_get(swigCPtr, this);
}
/**
* Position of the character in units of 20ms
*/
public void setTimestep(int value) {
implJNI.MetadataItem_timestep_set(swigCPtr, this, value);
}
/**
* Position of the character in units of 20ms
*/
public int getTimestep() {
return implJNI.MetadataItem_timestep_get(swigCPtr, this);
}
/**
* Position of the character in seconds
*/
public void setStart_time(float value) {
implJNI.MetadataItem_start_time_set(swigCPtr, this, value);
}
/**
* Position of the character in seconds
*/
public float getStart_time() {
return implJNI.MetadataItem_start_time_get(swigCPtr, this);
}
}

View File

@ -38,21 +38,21 @@ public class TokenMetadata {
* The text corresponding to this token
*/
public String getText() {
return implJNI.TokenMetadata_text_get(swigCPtr, this);
return implJNI.TokenMetadata_Text_get(swigCPtr, this);
}
/**
* Position of the token in units of 20ms
*/
public long getTimestep() {
return implJNI.TokenMetadata_timestep_get(swigCPtr, this);
return implJNI.TokenMetadata_Timestep_get(swigCPtr, this);
}
/**
* Position of the token in seconds
*/
public float getStart_time() {
return implJNI.TokenMetadata_start_time_get(swigCPtr, this);
public float getStartTime() {
return implJNI.TokenMetadata_StartTime_get(swigCPtr, this);
}
}