зеркало из https://github.com/mozilla/marytts.git
commit fixing new errors in the javadoc file under marytts-builder
This commit is contained in:
Родитель
c1dbb8dc07
Коммит
97a0dd1194
|
@ -44,7 +44,12 @@ public class DrawHistogram extends javax.swing.JFrame {
|
|||
public JPlotLayout layout_;
|
||||
public Histogram histData;
|
||||
|
||||
/** Creates new form DarwHistogram */
|
||||
/**
|
||||
* Creates new form DarwHistogram
|
||||
*
|
||||
* @param data
|
||||
* data
|
||||
*/
|
||||
public DrawHistogram(double[] data) {
|
||||
initComponents();
|
||||
this.setHistogramData(data, 25);
|
||||
|
|
|
@ -40,6 +40,9 @@ public class ListenToPreselection {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ public class MaryTranscriptionAligner extends TranscriptionAligner {
|
|||
|
||||
/**
|
||||
* @param allophoneSet
|
||||
* allophoneSet
|
||||
*/
|
||||
public MaryTranscriptionAligner(AllophoneSet allophoneSet) {
|
||||
super(allophoneSet);
|
||||
|
@ -41,6 +42,7 @@ public class MaryTranscriptionAligner extends TranscriptionAligner {
|
|||
|
||||
/**
|
||||
* @param allophoneSet
|
||||
* allophoneSet
|
||||
* @param insertDummyDurations
|
||||
* if true, in any inserted items, a duration of 1 millisecond will be set.
|
||||
*/
|
||||
|
|
|
@ -101,6 +101,9 @@ public class SynthesizeToPitchTier {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
MaryClient mary = MaryClient.getMaryClient();
|
||||
|
|
|
@ -161,14 +161,15 @@ public class CoverageDefinition {
|
|||
* Build a new coverage definition and read in the config file
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param featDef
|
||||
* the feature definition for the vectors
|
||||
* @param cfProvider
|
||||
* coverage feature provider
|
||||
* @param configFile
|
||||
* optionally, the coverage config file name. if this is null, default settings will be used.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public CoverageDefinition(FeatureDefinition featDef, CoverageFeatureProvider cfProvider, String configFile) throws Exception {
|
||||
this.featDef = featDef;
|
||||
|
@ -181,8 +182,11 @@ public class CoverageDefinition {
|
|||
|
||||
/**
|
||||
* @param featDef
|
||||
* featDef
|
||||
* @param configFile
|
||||
* configFile
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void readConfigFile(FeatureDefinition featDef, String configFile) throws Exception {
|
||||
try {
|
||||
|
@ -335,9 +339,10 @@ public class CoverageDefinition {
|
|||
|
||||
/**
|
||||
* Compute the coverage of the corpus, build and fill the cover sets. This will iterate once through the entire corpus, to
|
||||
* compute the maximally achieveable coverage with this corpus.
|
||||
* compute the maximally achievable coverage with this corpus.
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public void initialiseCoverage() throws IOException {
|
||||
// stuff used for counting the phones and diphones
|
||||
|
@ -665,6 +670,8 @@ public class CoverageDefinition {
|
|||
*
|
||||
* @param out
|
||||
* the print writer to print to
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public void printTextCorpusStatistics(PrintWriter out) throws Exception {
|
||||
DecimalFormat df = new DecimalFormat("0.00000");
|
||||
|
@ -790,6 +797,7 @@ public class CoverageDefinition {
|
|||
* @param logDevelopment
|
||||
* if true, print development file
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public void printSelectionDistribution(String distributionFile, String developmentFile, boolean logDevelopment)
|
||||
throws Exception {
|
||||
|
@ -966,9 +974,9 @@ public class CoverageDefinition {
|
|||
/**
|
||||
* Get the usefulness of the given feature vectors Usefulness of a feature vector is defined as the sum of the score for the
|
||||
* feature vectors on all levels of the tree. On each level, the score is the product of the two weights of the node. The
|
||||
* first weight reflects the frequency/ inverted frequency of the value associated with the node in the corpus (=>
|
||||
* first weight reflects the frequency/ inverted frequency of the value associated with the node in the corpus (→
|
||||
* frequencyWeight). The second weight reflects how much an instance of a feature vector containing the associated value is
|
||||
* wanted in the cover (=> wantedWeight).
|
||||
* wanted in the cover (→ wantedWeight).
|
||||
*
|
||||
* @param featureVectors
|
||||
* the feature vectors
|
||||
|
@ -1042,6 +1050,8 @@ public class CoverageDefinition {
|
|||
*
|
||||
* @param filename
|
||||
* the file to print to
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public void writeCoverageBin(String filename) throws Exception {
|
||||
DataOutputStream out = new DataOutputStream(new FileOutputStream(new File(filename)));
|
||||
|
@ -1070,6 +1080,8 @@ public class CoverageDefinition {
|
|||
* the output stream to write to
|
||||
* @param cover
|
||||
* the tree to print
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private void writeTreeBin(DataOutputStream out, CoverNode cover) throws IOException {
|
||||
|
||||
|
@ -1116,9 +1128,8 @@ public class CoverageDefinition {
|
|||
* the file containing the cover sets
|
||||
* @param idSentenceList
|
||||
* the id of the sentence list
|
||||
*
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
// public void readCoverageBin(String filename, FeatureDefinition fDef, String[] basenames)throws Exception{
|
||||
public void readCoverageBin(String filename, int[] idSentenceList) throws Exception {
|
||||
|
@ -1150,6 +1161,7 @@ public class CoverageDefinition {
|
|||
* @param isSimpleCover
|
||||
* if true, build the cover tree fro simpleDiphones
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void readTreeBin(DataInputStream in) throws Exception {
|
||||
byte numChildren = in.readByte();
|
||||
|
|
|
@ -30,7 +30,7 @@ public interface CoverageFeatureProvider {
|
|||
/**
|
||||
* Get the total number of sentences provided by this provider.
|
||||
*
|
||||
*
|
||||
* @param return number of sentences
|
||||
*/
|
||||
public int getNumSentences();
|
||||
|
||||
|
@ -47,10 +47,11 @@ public interface CoverageFeatureProvider {
|
|||
|
||||
/**
|
||||
* Get the unique ID number of the i-th sentence. This may or may not be the same as i. However, it can be assumed that IDs
|
||||
* are ordered: if i > j, getID(i) > getID(j).
|
||||
* are ordered: if i > j, getID(i) > getID(j).
|
||||
*
|
||||
* @param i
|
||||
*
|
||||
* i
|
||||
* @return ID
|
||||
*/
|
||||
public int getID(int i);
|
||||
}
|
||||
|
|
|
@ -57,8 +57,11 @@ public class CoverageUtils {
|
|||
* Convert the given feature vectors to the coverage features format, containing all byte features in a single byte array.
|
||||
*
|
||||
* @param featureNames
|
||||
* featureNames
|
||||
* @param def
|
||||
* def
|
||||
* @param featureVectors
|
||||
* featureVectors
|
||||
* @return data
|
||||
*/
|
||||
public static byte[] toCoverageFeatures(String featureNames, FeatureDefinition def, FeatureVector[] featureVectors) {
|
||||
|
|
|
@ -108,6 +108,7 @@ public class DBHandler {
|
|||
* called before calling createDBConnection() because ther prepared statments for each table are initialised.
|
||||
*
|
||||
* @param name
|
||||
* name
|
||||
*/
|
||||
public void setSelectedSentencesTableName(String name) {
|
||||
if (name.contentEquals(""))
|
||||
|
@ -189,10 +190,15 @@ public class DBHandler {
|
|||
* @param lang
|
||||
* locale language
|
||||
* @param host
|
||||
* host
|
||||
* @param db
|
||||
* db
|
||||
* @param user
|
||||
* user
|
||||
* @param passwd
|
||||
* passwd
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public void loadPagesWithMWDumper(String xmlFile, String lang, String host, String db, String user, String passwd)
|
||||
throws Exception {
|
||||
|
@ -272,6 +278,8 @@ public class DBHandler {
|
|||
/***
|
||||
* Ask the user if the table should be deleted
|
||||
*
|
||||
* @param table
|
||||
* table
|
||||
* @return true if user answers false otherwise.
|
||||
*/
|
||||
public boolean askIfDeletingTable(String table) {
|
||||
|
@ -375,6 +383,12 @@ public class DBHandler {
|
|||
/***
|
||||
* Creates a selectedSentencesTable.
|
||||
*
|
||||
* @param stopCriterion
|
||||
* stopCriterion
|
||||
* @param featDefFileName
|
||||
* featDefFileName
|
||||
* @param covDefConfigFileName
|
||||
* covDefConfigFileName
|
||||
*/
|
||||
public void createSelectedSentencesTable(String stopCriterion, String featDefFileName, String covDefConfigFileName) {
|
||||
String selected = "CREATE TABLE " + selectedSentencesTableName + " ( id INT NOT NULL AUTO_INCREMENT, "
|
||||
|
@ -437,8 +451,11 @@ public class DBHandler {
|
|||
* This function creates text, page and revision tables loading them from text files.
|
||||
*
|
||||
* @param textFile
|
||||
* textFile
|
||||
* @param pageFile
|
||||
* pageFile
|
||||
* @param revisionFile
|
||||
* revisionFile
|
||||
*/
|
||||
public void createAndLoadWikipediaTables(String textFile, String pageFile, String revisionFile) {
|
||||
|
||||
|
@ -717,7 +734,7 @@ public class DBHandler {
|
|||
/***
|
||||
* check if tables: locale_text, locale_page and locale_revision exist.
|
||||
*
|
||||
* @return resText && resPage && resRevision
|
||||
* @return resText && resPage && resRevision
|
||||
*/
|
||||
public boolean checkWikipediaTables() {
|
||||
// wiki must be already created
|
||||
|
@ -800,6 +817,8 @@ public class DBHandler {
|
|||
/***
|
||||
*
|
||||
* @return true if TABLE=tableName exist.
|
||||
* @param tableName
|
||||
* tableName
|
||||
*/
|
||||
public boolean tableExist(String tableName) {
|
||||
// System.out.println(" Checking if the TABLE=" + tableName + " exist.");
|
||||
|
@ -825,7 +844,9 @@ public class DBHandler {
|
|||
* Get a list of ids from field in table.
|
||||
*
|
||||
* @param field
|
||||
* field
|
||||
* @param table
|
||||
* table
|
||||
* @return idSet
|
||||
*/
|
||||
public String[] getIds(String field, String table) {
|
||||
|
@ -888,7 +909,7 @@ public class DBHandler {
|
|||
/***
|
||||
* Get the list of tables for this locale
|
||||
*
|
||||
* @return ArrayList<String>
|
||||
* @return ArrayList<String>
|
||||
*/
|
||||
public ArrayList<String> getListOfTables() {
|
||||
ArrayList<String> tablesList = new ArrayList<String>();
|
||||
|
@ -989,7 +1010,9 @@ public class DBHandler {
|
|||
* With the dbselection_id get first the sentence and then insert it in the locale_selectedSentences table.
|
||||
*
|
||||
* @param dbselection_id
|
||||
* dbselection_id
|
||||
* @param unwanted
|
||||
* unwanted
|
||||
*/
|
||||
public void insertSelectedSentence(int dbselection_id, boolean unwanted) {
|
||||
|
||||
|
@ -1015,6 +1038,8 @@ public class DBHandler {
|
|||
/****
|
||||
* Creates a wordList table, if already exists deletes it and creates a new to insert current wordList.
|
||||
*
|
||||
* @param wordList
|
||||
* wordList
|
||||
*/
|
||||
public void insertWordList(HashMap<String, Integer> wordList) {
|
||||
String word;
|
||||
|
@ -1160,8 +1185,10 @@ public class DBHandler {
|
|||
* features.
|
||||
*
|
||||
* @param table
|
||||
* table
|
||||
* @param condition
|
||||
* @return Pair<int[], byte[][]>(idSet, features)
|
||||
* condition
|
||||
* @return Pair<int[], byte[][]>(idSet, features)
|
||||
*/
|
||||
public Pair<int[], byte[][]> getIdsAndFeatureVectors(String table, String condition) {
|
||||
int num, i, j;
|
||||
|
@ -1276,7 +1303,7 @@ public class DBHandler {
|
|||
* @return int number of words.
|
||||
* @param maxFrequency
|
||||
* max frequency of a word to be considered in the list, if maxFrequency=0 it will retrieve all the words with
|
||||
* frequency>=1.
|
||||
* frequency≥1.
|
||||
*/
|
||||
public int getNumberOfWords(int maxFrequency) {
|
||||
String where = "";
|
||||
|
@ -1295,7 +1322,8 @@ public class DBHandler {
|
|||
* order of frequency.
|
||||
* @param maxFrequency
|
||||
* max frequency of a word to be considered in the list, if maxFrequency=0 it will retrieve all the words with
|
||||
* frequency>=1.
|
||||
* frequency≥1.
|
||||
* @return wordList
|
||||
*/
|
||||
public HashMap<String, Integer> getMostFrequentWords(int numWords, int maxFrequency) {
|
||||
|
||||
|
@ -1344,7 +1372,8 @@ public class DBHandler {
|
|||
* order of frequency.
|
||||
* @param maxFrequency
|
||||
* max frequency of a word to be considered in the list, if maxFrequency=0 it will retrieve all the words with
|
||||
* frequency>=1.
|
||||
* frequency≥1.
|
||||
* @return words
|
||||
*/
|
||||
public ArrayList<String> getMostFrequentWordsArray(int numWords, int maxFrequency) {
|
||||
|
||||
|
@ -1393,7 +1422,7 @@ public class DBHandler {
|
|||
* max number of words, if numWords=0 then it will retrieve all the words in the list.
|
||||
* @param maxFrequency
|
||||
* max frequency of a word to be considered in the list, if maxFrequency=0 it will retrieve all the words with
|
||||
* frequency>=1.
|
||||
* frequency≥1.
|
||||
*/
|
||||
public void printWordList(String fileName, String order, int numWords, int maxFrequency) {
|
||||
PrintWriter pw;
|
||||
|
@ -1467,7 +1496,9 @@ public class DBHandler {
|
|||
* Get a
|
||||
*
|
||||
* @param tableName
|
||||
* tableName
|
||||
* @param id
|
||||
* id
|
||||
* @return sentence
|
||||
*/
|
||||
public String getSelectedSentence(String tableName, int id) {
|
||||
|
@ -1555,6 +1586,7 @@ public class DBHandler {
|
|||
* Set a sentence record field as true/false in dbselection table.
|
||||
*
|
||||
* @param id
|
||||
* id
|
||||
* @param field
|
||||
* reliable, unknownWords, strangeSymbols, selected or unwanted = true/false
|
||||
* @param fieldValue
|
||||
|
@ -1699,6 +1731,7 @@ public class DBHandler {
|
|||
* Get the description of the tableName
|
||||
*
|
||||
* @param tableName
|
||||
* tableName
|
||||
* @return and String array where: desc[0] tableName desc[1] description desc[2] stopCriterion desc[3]
|
||||
* featuresDefinitionFileName desc[4] featuresDefinitionFile desc[5] covDefConfigFileName desc[6] covDefConfigFile
|
||||
*/
|
||||
|
@ -1879,6 +1912,10 @@ public class DBHandler {
|
|||
/**
|
||||
* The following characteres should be escaped: \0 An ASCII 0 (NUL) character. \' A single quote (“'”) character.
|
||||
* \" A double quote (“"”) character.
|
||||
*
|
||||
* @param str
|
||||
* str
|
||||
* @return str
|
||||
*/
|
||||
public String mysqlEscapeCharacters(String str) {
|
||||
|
||||
|
|
|
@ -109,6 +109,8 @@ public class DatabaseSelector {
|
|||
*
|
||||
* @param args
|
||||
* the command line args (see printUsage for details)
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
main2(args);
|
||||
|
@ -120,8 +122,8 @@ public class DatabaseSelector {
|
|||
*
|
||||
* @param args
|
||||
* the command line args (see printUsage for details)
|
||||
*
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main2(String[] args) throws Exception {
|
||||
/* Sort out the filenames and dirs for the logfiles */
|
||||
|
@ -349,6 +351,8 @@ public class DatabaseSelector {
|
|||
* the arguments
|
||||
* @param log
|
||||
* a StringBufffer for logging
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return true if args can be parsed and all essential args are there, false otherwise
|
||||
*/
|
||||
private static boolean readArgs(String[] args, StringBuffer log) throws Exception {
|
||||
|
@ -779,9 +783,12 @@ public class DatabaseSelector {
|
|||
* Add a list of sentences to the cover Here the already selected sentences are added to the cover and the indexes removed (or
|
||||
* set to -1) in the idSentenceList
|
||||
*
|
||||
* @param tableName
|
||||
* tableName
|
||||
* @param covDef
|
||||
* the cover
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private static void addSelectedSents(String tableName, CoverageDefinition covDef) throws Exception {
|
||||
|
||||
|
@ -821,7 +828,10 @@ public class DatabaseSelector {
|
|||
/**
|
||||
* Remove unwanted sentences from the basename list
|
||||
*
|
||||
* @param tableName
|
||||
* tableName
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private static void removeUnwantedSentences(String tableName) throws Exception {
|
||||
if (verbose)
|
||||
|
|
|
@ -489,8 +489,11 @@ public class FeatureMaker {
|
|||
*
|
||||
* @param textString
|
||||
* the text to process
|
||||
* @param id
|
||||
* id
|
||||
* @return the resulting XML-Document
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
protected static Document phonemiseText(String textString, int id) throws Exception {
|
||||
try {
|
||||
|
@ -528,8 +531,13 @@ public class FeatureMaker {
|
|||
*
|
||||
* @param text
|
||||
* the file
|
||||
* @param id
|
||||
* id
|
||||
* @param test
|
||||
* test
|
||||
* @return true, if successful
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
protected static Vector<String> splitIntoSentences(String text, int id, boolean test) throws Exception {
|
||||
|
||||
|
@ -622,6 +630,9 @@ public class FeatureMaker {
|
|||
* the Node to start from checkCredibility returns 0 if the sentence is useful 1 if the sentence contains
|
||||
* unknownWords (so the sentence is not useful) 2 if the sentence contains strangeSymbols (so the sentence is not
|
||||
* useful)
|
||||
* @param sentence
|
||||
* sentence
|
||||
* @return sentence
|
||||
*/
|
||||
protected static StringBuilder collectTokens(Node nextToken, StringBuilder sentence) {
|
||||
int credibility = 0;
|
||||
|
@ -682,6 +693,7 @@ public class FeatureMaker {
|
|||
* g2p_method "contains-unknown-words" or "contains-strange-symbols",
|
||||
*
|
||||
* @param t
|
||||
* t
|
||||
* @return 0 if the sentence is useful 1 if the sentence contains unknownWords 2 if the sentence contains strangeSymbols
|
||||
*/
|
||||
protected static int checkReliability(Element t) {
|
||||
|
|
|
@ -413,8 +413,11 @@ public class FeatureMakerMaryServer {
|
|||
*
|
||||
* @param textString
|
||||
* the text to process
|
||||
* @param id
|
||||
* id
|
||||
* @return the resulting XML-Document
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
protected static Document phonemiseText(String textString, int id) throws Exception {
|
||||
try {
|
||||
|
@ -444,6 +447,8 @@ public class FeatureMakerMaryServer {
|
|||
* @param d
|
||||
* the target features as Mary Data object
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return feasVector
|
||||
*/
|
||||
protected static byte[] getFeatures(MaryData d) throws Exception {
|
||||
|
||||
|
@ -526,8 +531,13 @@ public class FeatureMakerMaryServer {
|
|||
*
|
||||
* @param text
|
||||
* the file
|
||||
* @param id
|
||||
* id
|
||||
* @param test
|
||||
* test
|
||||
* @return true, if successful
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
protected static Vector<String> splitIntoSentences(String text, int id, boolean test) throws Exception {
|
||||
|
||||
|
@ -620,6 +630,9 @@ public class FeatureMakerMaryServer {
|
|||
* the Node to start from checkCredibility returns 0 if the sentence is useful 1 if the sentence contains
|
||||
* unknownWords (so the sentence is not useful) 2 if the sentence contains strangeSymbols (so the sentence is not
|
||||
* useful)
|
||||
* @param sentence
|
||||
* sentence
|
||||
* @return sentence
|
||||
*/
|
||||
protected static StringBuffer collectTokens(Node nextToken, StringBuffer sentence) {
|
||||
int credibility = 0;
|
||||
|
@ -680,6 +693,7 @@ public class FeatureMakerMaryServer {
|
|||
* g2p_method "contains-unknown-words" or "contains-strange-symbols",
|
||||
*
|
||||
* @param t
|
||||
* t
|
||||
* @return 0 if the sentence is useful 1 if the sentence contains unknownWords 2 if the sentence contains strangeSymbols
|
||||
*/
|
||||
protected static int checkReliability(Element t) {
|
||||
|
|
|
@ -31,6 +31,9 @@ public class MaryScriptCreator {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
// input: one line ( dummy "text" )
|
||||
|
|
|
@ -177,9 +177,9 @@ public class SelectionFunction {
|
|||
* @param verboseSelect
|
||||
* if true, get vectors from coverage definition, if false, read vectors from disk
|
||||
* @param wikiToDB
|
||||
*
|
||||
*
|
||||
* wikiToDB
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public void select(Set<Integer> selectedIdSents, Set<Integer> unwantedIdSents, CoverageDefinition coverageDefinition,
|
||||
PrintWriter logFile, CoverageFeatureProvider cfProvider, boolean verboseSelect, DBHandler wikiToDB) // throws
|
||||
|
@ -298,15 +298,14 @@ public class SelectionFunction {
|
|||
*
|
||||
* @param coverageDefinition
|
||||
* the coverage definition
|
||||
* @param logFile
|
||||
* the logFile
|
||||
* @param sentenceIndex
|
||||
* @param selectedIdSents
|
||||
* the index of the next sentence
|
||||
* @param basenameList
|
||||
* the list of filenames
|
||||
* @param vectorArray
|
||||
* the array of vectors or null if the vectors are on disk
|
||||
* @param unwantedIdSents
|
||||
* the list unwanted sentences
|
||||
* @param cfProvider
|
||||
* cf provider
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @return true if a sentence was selected, false otherwise
|
||||
*/
|
||||
private boolean selectNext(Set<Integer> selectedIdSents, Set<Integer> unwantedIdSents, CoverageDefinition coverageDefinition,
|
||||
|
@ -337,9 +336,13 @@ public class SelectionFunction {
|
|||
|
||||
/**
|
||||
* @param selectedIdSents
|
||||
* selectedIdSents
|
||||
* @param unwantedIdSents
|
||||
* unwantedIdSents
|
||||
* @param coverageDefinition
|
||||
* coverageDefinition
|
||||
* @param cfProvider
|
||||
* cfProvider
|
||||
*/
|
||||
private void determineMostUsefulSentence(Set<Integer> selectedIdSents, Set<Integer> unwantedIdSents,
|
||||
CoverageDefinition coverageDefinition, CoverageFeatureProvider cfProvider) {
|
||||
|
@ -411,8 +414,8 @@ public class SelectionFunction {
|
|||
* @param basename
|
||||
* the file from which to read from
|
||||
* @return the feature vectors from the file
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private byte[] getNextFeatureVectors1(String basename) throws IOException {
|
||||
// open the file
|
||||
|
|
|
@ -43,6 +43,9 @@ public class SimpleCoverageComputer {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ public class SortTestResults {
|
|||
* @param args
|
||||
* comand line arguments
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
File logFile = new File(args[0]);
|
||||
|
|
|
@ -766,10 +766,13 @@ public class WikipediaMarkupCleaner {
|
|||
* [[image: ... ]]
|
||||
*
|
||||
* @param s
|
||||
* s
|
||||
* @param lineIn
|
||||
* lineIn
|
||||
* @param iniTag
|
||||
* iniTag
|
||||
* @param endTag
|
||||
* @param debug
|
||||
* endTag
|
||||
* @return line
|
||||
*/
|
||||
private StringBuffer removeSectionImage(Scanner s, StringBuffer lineIn, String iniTag, String endTag) {
|
||||
|
@ -846,6 +849,9 @@ public class WikipediaMarkupCleaner {
|
|||
/***
|
||||
* Internal links: [[Name of page]] [[Name of page|Text to display]] External links: [http://www.example.org Text to display]
|
||||
* [http://www.example.org] http://www.example.org
|
||||
*
|
||||
* @param line
|
||||
* line
|
||||
*/
|
||||
private StringBuffer processInternalAndExternalLinks(StringBuffer line) {
|
||||
int index1, index2, index3;
|
||||
|
@ -1056,6 +1062,7 @@ public class WikipediaMarkupCleaner {
|
|||
* extract/clean text from the pages and create a cleanText table. It also creates a wordList table including frequencies.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
void processWikipediaPages() throws Exception {
|
||||
// Load wikipedia pages, extract clean text and create word list.
|
||||
|
|
|
@ -92,6 +92,8 @@ public class LTSTrainer extends AlignerTrainer {
|
|||
* whether to convert all graphemes to lowercase, using the locale of the allophone set.
|
||||
* @param considerStress
|
||||
* indicator if stress is preserved
|
||||
* @param context
|
||||
* context
|
||||
*/
|
||||
public LTSTrainer(AllophoneSet aPhSet, boolean convertToLowercase, boolean considerStress, int context) {
|
||||
super();
|
||||
|
@ -109,6 +111,7 @@ public class LTSTrainer extends AlignerTrainer {
|
|||
* the minimum number of instances that have to occur in at least two subsets induced by split
|
||||
* @return bigTree
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public CART trainTree(int minLeafData) throws IOException {
|
||||
|
||||
|
@ -262,8 +265,11 @@ public class LTSTrainer extends AlignerTrainer {
|
|||
* Convenience method to save files to graph2phon.wagon and graph2phon.pfeats in a specified directory with UTF-8 encoding.
|
||||
*
|
||||
* @param tree
|
||||
* tree
|
||||
* @param saveTreefile
|
||||
* saveTreefile
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public void save(CART tree, String saveTreefile) throws IOException {
|
||||
MaryCARTWriter mcw = new MaryCARTWriter();
|
||||
|
@ -317,6 +323,7 @@ public class LTSTrainer extends AlignerTrainer {
|
|||
* @param splitPattern
|
||||
* a regular expression used for identifying the field separator in each line.
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public void readLexicon(BufferedReader lexicon, String splitPattern) throws IOException {
|
||||
|
||||
|
@ -369,7 +376,7 @@ public class LTSTrainer extends AlignerTrainer {
|
|||
* Stress is optionally preserved, marking the first vowel of a stressed syllable with "1".
|
||||
*
|
||||
* @param lexicon
|
||||
* @throws IOException
|
||||
* lexicon
|
||||
*/
|
||||
public void readLexicon(HashMap<String, String> lexicon) {
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ public class LexiconCreator {
|
|||
}
|
||||
|
||||
/**
|
||||
* Initialise a new lexicon creator.
|
||||
* Initialize a new lexicon creator.
|
||||
*
|
||||
* @param allophoneSet
|
||||
* this specifies the set of phonetic symbols that can be used in the lexicon, and provides the locale of the
|
||||
|
@ -131,6 +131,9 @@ public class LexiconCreator {
|
|||
/**
|
||||
* This base implementation does nothing. Subclasses can override this method to prepare a lexicon in the expected format,
|
||||
* which should then be found at lexiconFilename.
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
protected void prepareLexicon() throws IOException {
|
||||
}
|
||||
|
@ -300,6 +303,9 @@ public class LexiconCreator {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
PatternLayout layout = new PatternLayout("%d %m\n");
|
||||
|
|
|
@ -141,6 +141,8 @@ public class CMUDict2MaryFST extends LexiconCreator {
|
|||
/**
|
||||
* Converts a single phonetic symbol in MRPA representation representation into its equivalent in MARY sampa representation.
|
||||
*
|
||||
* @param voicePhoneme
|
||||
* voicePhoneme
|
||||
* @return the converted phone, or the input string if no known conversion exists.
|
||||
*/
|
||||
private String mrpa2sampa(String voicePhoneme) {
|
||||
|
@ -222,6 +224,9 @@ public class CMUDict2MaryFST extends LexiconCreator {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
PatternLayout layout = new PatternLayout("%d %m\n");
|
||||
|
|
|
@ -305,7 +305,8 @@ public class Mary4To5VoiceConverter {
|
|||
* Returns true for a unit selection voice, false for an HMM-based voice.
|
||||
*
|
||||
* @return true if config.containsKey("unitselection.voices.list"), false if config.containsKey("hmm.voices.list")
|
||||
* @throws {@link UnsupportedOperationException} if the voice is neither a unit selection nor an HMM-based voice.
|
||||
* @throws UnsupportedOperationException
|
||||
* if the voice is neither a unit selection nor an HMM-based voice.
|
||||
*/
|
||||
protected boolean isUnitSelectionVoice() throws UnsupportedOperationException {
|
||||
if (config.containsKey("unitselection.voices.list")) {
|
||||
|
@ -391,7 +392,9 @@ public class Mary4To5VoiceConverter {
|
|||
* Converts format from pdf Mary format 4 to Mary 5, the converted file will have the same input name
|
||||
*
|
||||
* @param pdfInFile
|
||||
* pdfInFile
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public void convertPdfBinaryFile(File pdfInFile) throws Exception {
|
||||
int i, j, k, l;
|
||||
|
@ -516,7 +519,9 @@ public class Mary4To5VoiceConverter {
|
|||
* Converts file format from gv Mary format 4 to Mary 5, the converted file will have the same input name
|
||||
*
|
||||
* @param gvInFile
|
||||
* gvInFile
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public void convertGvBinaryFile(File gvInFile) throws IOException {
|
||||
int i;
|
||||
|
|
|
@ -58,6 +58,9 @@ public abstract class AbstractTimelineMaker extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @param theDB
|
||||
* theDB
|
||||
*/
|
||||
@Override
|
||||
public SortedMap<String, String> getDefaultProps(DatabaseLayout theDB) {
|
||||
|
@ -88,6 +91,7 @@ public abstract class AbstractTimelineMaker extends VoiceImportComponent {
|
|||
* Read and concatenate a list of data files into a single timeline file.
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
@Override
|
||||
public boolean compute() throws IOException, MaryConfigurationException {
|
||||
|
@ -176,6 +180,7 @@ public abstract class AbstractTimelineMaker extends VoiceImportComponent {
|
|||
* @param dataFile
|
||||
* to provide parameters
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
protected void initializeDataTimeline(AbstractDataFile dataFile) throws IOException {
|
||||
String processingHeader = getProcessingHeader();
|
||||
|
@ -188,6 +193,8 @@ public abstract class AbstractTimelineMaker extends VoiceImportComponent {
|
|||
* generate a processing header for the {@link TimelineWriter}
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @return processing header
|
||||
*/
|
||||
protected abstract String getProcessingHeader() throws IOException;
|
||||
|
||||
|
|
|
@ -165,9 +165,13 @@ public class AcousticFeatureFileWriter extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* @param out
|
||||
* out
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws UnsupportedEncodingException
|
||||
* UnsupportedEncodingException
|
||||
* @throws FileNotFoundException
|
||||
* FileNotFoundException
|
||||
*/
|
||||
protected void writeUnitFeaturesTo(DataOutput out) throws IOException, UnsupportedEncodingException, FileNotFoundException {
|
||||
int numUnits = unitFileReader.getNumberOfUnits();
|
||||
|
@ -285,7 +289,9 @@ public class AcousticFeatureFileWriter extends VoiceImportComponent {
|
|||
* Write the header of this feature file to the given DataOutput
|
||||
*
|
||||
* @param out
|
||||
* out
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
protected void writeHeaderTo(DataOutput out) throws IOException {
|
||||
new MaryHeader(MaryHeader.UNITFEATS).writeTo(out);
|
||||
|
@ -303,6 +309,9 @@ public class AcousticFeatureFileWriter extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
AcousticFeatureFileWriter acfeatsWriter = new AcousticFeatureFileWriter();
|
||||
|
|
|
@ -44,7 +44,7 @@ import org.w3c.dom.Node;
|
|||
/**
|
||||
* For the given texts, compute allophones, especially boundary tags.
|
||||
*
|
||||
* @author Benjamin Roth, adapted from Sathish Chandra Pammi
|
||||
* @author Benjamin Roth, adapted from Sathish Chandra Pammi, Steiner
|
||||
*
|
||||
*/
|
||||
public class AllophonesExtractor extends VoiceImportComponent {
|
||||
|
@ -157,7 +157,11 @@ public class AllophonesExtractor extends VoiceImportComponent {
|
|||
/**
|
||||
*
|
||||
* @param basename
|
||||
* basename
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws MaryConfigurationException
|
||||
* MaryConfigurationException
|
||||
*/
|
||||
public void generateAllophonesFile(String basename) throws IOException, MaryConfigurationException {
|
||||
Locale localVoice = MaryUtils.string2locale(locale);
|
||||
|
@ -231,8 +235,8 @@ public class AllophonesExtractor extends VoiceImportComponent {
|
|||
/**
|
||||
* Get style for basename from style definition file. Do this by matching basename against a glob pattern.
|
||||
*
|
||||
* @author steiner
|
||||
* @param basename
|
||||
* basename
|
||||
* @return style as String
|
||||
*/
|
||||
private String getStyleFromStyleDefinition(String basename) {
|
||||
|
|
|
@ -132,6 +132,9 @@ public class AutocorrelationPitchmarker extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* The standard compute() method of the VoiceImportComponent interface.
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public boolean compute() throws IOException {
|
||||
|
||||
|
|
|
@ -311,6 +311,12 @@ public class CARTBuilder extends VoiceImportComponent {
|
|||
*
|
||||
* @param filename
|
||||
* the festvox directory of a voice
|
||||
* @param featDef
|
||||
* featDef
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws MaryConfigurationException
|
||||
* MaryConfigurationException
|
||||
*/
|
||||
public CART importCART(String filename, FeatureDefinition featDef) throws IOException, MaryConfigurationException {
|
||||
// open CART-File
|
||||
|
@ -336,6 +342,10 @@ public class CARTBuilder extends VoiceImportComponent {
|
|||
* the CART
|
||||
* @param featureDefinition
|
||||
* the definition of the features
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws MaryConfigurationException
|
||||
* MaryConfigurationException
|
||||
*/
|
||||
public boolean replaceLeaves(CART cart, FeatureDefinition featureDefinition) throws IOException, MaryConfigurationException {
|
||||
try {
|
||||
|
@ -464,6 +474,8 @@ public class CARTBuilder extends VoiceImportComponent {
|
|||
* the feature definition
|
||||
* @param filename
|
||||
* the filename
|
||||
* @throws FileNotFoundException
|
||||
* FileNotFoundException
|
||||
*/
|
||||
public void dumpFeatureVectors(FeatureVector[] featureVectors, FeatureDefinition featDef, String filename)
|
||||
throws FileNotFoundException {
|
||||
|
@ -495,6 +507,12 @@ public class CARTBuilder extends VoiceImportComponent {
|
|||
* the feature vectors of the units
|
||||
* @param filename
|
||||
* the filename
|
||||
* @param featDef
|
||||
* featDef
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws MaryConfigurationException
|
||||
* MaryConfigurationException
|
||||
*/
|
||||
public void buildAndDumpDistanceTables(FeatureVector[] featureVectors, String filename, FeatureDefinition featDef)
|
||||
throws IOException, MaryConfigurationException {
|
||||
|
|
|
@ -445,10 +445,14 @@ public class DatabaseImportMain extends JFrame {
|
|||
|
||||
/**
|
||||
* @param groups2comps
|
||||
* groups2comps
|
||||
* @return compsList.toArray(new VoiceImportComponent[compsList.size()])
|
||||
* @throws InstantiationException
|
||||
* InstantiationException
|
||||
* @throws IllegalAccessException
|
||||
* IllegalAccessException
|
||||
* @throws ClassNotFoundException
|
||||
* ClassNotFoundException
|
||||
*/
|
||||
private static VoiceImportComponent[] createComponents(String[][] groups2comps) throws InstantiationException,
|
||||
IllegalAccessException, ClassNotFoundException {
|
||||
|
|
|
@ -329,6 +329,7 @@ public class DatabaseLayout {
|
|||
* from another component. Handle with care -- only use this if you know what you are doing!
|
||||
*
|
||||
* @param componentName
|
||||
* componentName
|
||||
* @return the named voice import component, or null if there is no such component.
|
||||
*/
|
||||
public VoiceImportComponent getComponent(String componentName) {
|
||||
|
@ -340,6 +341,8 @@ public class DatabaseLayout {
|
|||
*
|
||||
* @param configFile
|
||||
* the config file
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private void readConfigFile(File configFile) throws IOException {
|
||||
props = new TreeMap<String, String>();
|
||||
|
@ -401,6 +404,8 @@ public class DatabaseLayout {
|
|||
*
|
||||
* @param configFile
|
||||
* the config file
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private void readExternalBinariesConfigFile(File configFile) throws IOException {
|
||||
external = new TreeMap<String, String>();
|
||||
|
@ -590,7 +595,7 @@ public class DatabaseLayout {
|
|||
/**
|
||||
* Prompt the user for the basic props (This is called if we don't have any props)
|
||||
*
|
||||
* @param props
|
||||
* @param basicprops
|
||||
* the map of props to be filled
|
||||
*/
|
||||
private boolean promptUserForBasicProps(SortedMap<String, String> basicprops) {
|
||||
|
@ -611,6 +616,7 @@ public class DatabaseLayout {
|
|||
|
||||
/**
|
||||
* @param basicprops
|
||||
* basicprops
|
||||
*/
|
||||
private void initDefaultBasicProps(SortedMap<String, String> basicprops) {
|
||||
basicprops.put(MARYBASE, System.getProperty("MARYBASE", "/path/to/marybase/"));
|
||||
|
@ -642,6 +648,8 @@ public class DatabaseLayout {
|
|||
*
|
||||
* @param someProps
|
||||
* the map of props to be filled
|
||||
* @param withBasicProps
|
||||
* withBasicProps
|
||||
* @return the map of default props
|
||||
*/
|
||||
private SortedMap<String, String> initDefaultProps(SortedMap<String, String> someProps, boolean withBasicProps) {
|
||||
|
@ -792,6 +800,9 @@ public class DatabaseLayout {
|
|||
|
||||
/**
|
||||
* Initialize the components
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void initializeComps() throws Exception {
|
||||
for (int i = 0; i < components.length; i++) {
|
||||
|
|
|
@ -79,7 +79,9 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
public final String TRAININGFLAG = "EHMMLabeler.doTraining";
|
||||
public final String ALIGNMENTFLAG = "EHMMLabeler.doAlignment";
|
||||
|
||||
private final int EHMM_TRAIN_NUM_THREADS = Math.min(4, Runtime.getRuntime().availableProcessors()); // more than 4 threads don't help for ehmm training
|
||||
private final int EHMM_TRAIN_NUM_THREADS = Math.min(4, Runtime.getRuntime().availableProcessors()); // more than 4 threads
|
||||
// don't help for ehmm
|
||||
// training
|
||||
private final int EHMM_ALIGN_NUM_THREADS = Runtime.getRuntime().availableProcessors();
|
||||
|
||||
public final String getName() {
|
||||
|
@ -120,8 +122,9 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
"directory containing all files used for training and labeling. Will be created if it does not exist.");
|
||||
props2Help.put(ALLOPHONESDIR, "directory containing the IntonisedXML files.");
|
||||
props2Help.put(OUTLABDIR, "Directory to store generated lebels from EHMM.");
|
||||
props2Help.put(INITEHMMDIR,
|
||||
"If you provide a path to previous EHMM Directory, Models will intialize with those models. other wise EHMM Models will build with Flat-Start Initialization");
|
||||
props2Help
|
||||
.put(INITEHMMDIR,
|
||||
"If you provide a path to previous EHMM Directory, Models will intialize with those models. other wise EHMM Models will build with Flat-Start Initialization");
|
||||
props2Help.put(RETRAIN, "true - Do re-training by initializing with given models. false - Do just Decoding");
|
||||
props2Help.put(NONDETENDFLAG, "(0,1) - Viterbi decoding with non deterministic ending (festvox 2.4)");
|
||||
|
||||
|
@ -140,6 +143,8 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
* Do the computations required by this component.
|
||||
*
|
||||
* @return true on success, false on failure
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
|
||||
|
@ -195,7 +200,7 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
} else {
|
||||
System.out.println("Skipping preparatory steps.");
|
||||
}
|
||||
|
||||
|
||||
if ("true".equals(getProp(TRAININGFLAG))) {
|
||||
baumWelchEHMM();
|
||||
} else {
|
||||
|
@ -224,6 +229,10 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
*
|
||||
* @throws IOException
|
||||
* , InterruptedException, MaryConfigurationException
|
||||
* @throws InterruptedException
|
||||
* InterruptedException
|
||||
* @throws MaryConfigurationException
|
||||
* MaryConfigurationException
|
||||
*/
|
||||
private void setup() throws IOException, InterruptedException, MaryConfigurationException {
|
||||
String task = "setup";
|
||||
|
@ -268,6 +277,10 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
*
|
||||
* @throws IOException
|
||||
* , InterruptedException, MaryConfigurationException
|
||||
* @throws MaryConfigurationException
|
||||
* MaryConfigurationException
|
||||
* @throws InterruptedException
|
||||
* InterruptedException
|
||||
*/
|
||||
private void dumpRequiredFiles() throws IOException, InterruptedException, MaryConfigurationException {
|
||||
String task = "dumpRequiredFiles";
|
||||
|
@ -307,7 +320,11 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
* Computing Features Required files for EHMM Training
|
||||
*
|
||||
* @throws IOException
|
||||
* , InterruptedException, MaryConfigurationException
|
||||
* IOException
|
||||
* @throws InterruptedException
|
||||
* InterruptedException
|
||||
* @throws MaryConfigurationException
|
||||
* MaryConfigurationException
|
||||
*/
|
||||
private void computeFeatures() throws IOException, InterruptedException, MaryConfigurationException {
|
||||
String task = "computeFeatures";
|
||||
|
@ -344,8 +361,11 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
* Scaling Features for EHMM Training
|
||||
*
|
||||
* @throws IOException
|
||||
* , InterruptedException
|
||||
* IOException
|
||||
* @throws MaryConfigurationException
|
||||
* MaryConfigurationException
|
||||
* @throws InterruptedException
|
||||
* InterruptedException
|
||||
*/
|
||||
private void scaleFeatures() throws IOException, InterruptedException, MaryConfigurationException {
|
||||
|
||||
|
@ -383,8 +403,11 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
* Convert Features to Binary Format (EHMM2.7 instead of EHMM2.1) for EHMM Training
|
||||
*
|
||||
* @throws IOException
|
||||
* , InterruptedException
|
||||
* IOException
|
||||
* @throws MaryConfigurationException
|
||||
* MaryConfigurationException
|
||||
* @throws InterruptedException
|
||||
* InterruptedException
|
||||
*/
|
||||
private void convertToBinaryFeatures() throws IOException, InterruptedException, MaryConfigurationException {
|
||||
|
||||
|
@ -396,7 +419,7 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
Process process = rtime.exec("/bin/bash");
|
||||
// get an output stream to write to the shell
|
||||
PrintWriter pw = new PrintWriter(new OutputStreamWriter(process.getOutputStream()));
|
||||
String cmd = "( cd " + ehmm.getAbsolutePath() + "/feat; for file in *.ft; do " + getProp(EHMMDIR)
|
||||
String cmd = "( cd " + ehmm.getAbsolutePath() + "/feat; for file in *.ft; do " + getProp(EHMMDIR)
|
||||
+ "/bin/ConvertFeatsFileToBinaryFormat $file ${file%%.ft}.bft >> ../log.txt; done; exit )\n";
|
||||
System.out.println(cmd);
|
||||
pw.print(cmd);
|
||||
|
@ -420,8 +443,11 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
* Initializing EHMM Models
|
||||
*
|
||||
* @throws IOException
|
||||
* , InterruptedException
|
||||
* IOException
|
||||
* @throws MaryConfigurationException
|
||||
* MaryConfigurationException
|
||||
* @throws InterruptedException
|
||||
* InterruptedException
|
||||
*/
|
||||
private void intializeEHMMModels() throws IOException, InterruptedException, MaryConfigurationException {
|
||||
String task = "intializeEHMMModels";
|
||||
|
@ -466,8 +492,11 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
* Training EHMM Models
|
||||
*
|
||||
* @throws IOException
|
||||
* , InterruptedException
|
||||
* IOException
|
||||
* @throws MaryConfigurationException
|
||||
* MaryConfigurationException
|
||||
* @throws InterruptedException
|
||||
* InterruptedException
|
||||
*/
|
||||
private void baumWelchEHMM() throws IOException, InterruptedException, MaryConfigurationException {
|
||||
String task = "baumWelchEHMM";
|
||||
|
@ -479,9 +508,9 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
// get an output stream to write to the shell
|
||||
PrintWriter pw = new PrintWriter(new OutputStreamWriter(process.getOutputStream()));
|
||||
|
||||
String cmd = "( cd " + ehmm.getAbsolutePath() + "; " + getProp(EHMMDIR) + "/bin/ehmm " + outputDir + "/"
|
||||
+ "ehmm" + ".phoneList.int " + outputDir + "/" + "ehmm" + ".align.int 1 0 " + ehmm.getAbsolutePath()
|
||||
+ "/feat bft " + ehmm.getAbsolutePath() + "/mod 0 0 0 48 " + EHMM_TRAIN_NUM_THREADS + " >> log.txt" + "; exit )\n";
|
||||
String cmd = "( cd " + ehmm.getAbsolutePath() + "; " + getProp(EHMMDIR) + "/bin/ehmm " + outputDir + "/" + "ehmm"
|
||||
+ ".phoneList.int " + outputDir + "/" + "ehmm" + ".align.int 1 0 " + ehmm.getAbsolutePath() + "/feat bft "
|
||||
+ ehmm.getAbsolutePath() + "/mod 0 0 0 48 " + EHMM_TRAIN_NUM_THREADS + " >> log.txt" + "; exit )\n";
|
||||
System.out.println("See $ROOTDIR/ehmm/log.txt for EHMM Labelling status... ");
|
||||
if (getProp(INITEHMMDIR).equals("/")) {
|
||||
System.out.println("EHMM baum-welch re-estimation ...");
|
||||
|
@ -511,7 +540,11 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
* Aligning EHMM and Label file generation
|
||||
*
|
||||
* @throws IOException
|
||||
* , InterruptedException, MaryConfigurationException
|
||||
* IOException
|
||||
* @throws InterruptedException
|
||||
* InterruptedException
|
||||
* @throws MaryConfigurationException
|
||||
* MaryConfigurationException
|
||||
*/
|
||||
private void alignEHMM() throws IOException, InterruptedException, MaryConfigurationException {
|
||||
String task = "alignEHMM";
|
||||
|
@ -524,8 +557,9 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
String cmd = "( cd " + ehmm.getAbsolutePath() + "; " + getProp(EHMMDIR) + "/bin/edec " + outputDir + "/" + "ehmm"
|
||||
+ ".phoneList.int " + outputDir + "/" + "ehmm" + ".align.int 1 " + ehmm.getAbsolutePath() + "/feat bft "
|
||||
+ outputDir + "/" + "ehmm" + ".featSettings " + ehmm.getAbsolutePath() + "/mod " + getProp(NONDETENDFLAG) + " "
|
||||
+ ehmm.getAbsolutePath() + "/lab " + EHMM_ALIGN_NUM_THREADS + " >> log.txt" + "; perl " + getProp(EHMMDIR) + "/bin/sym2nm.pl "
|
||||
+ ehmm.getAbsolutePath() + "/lab " + outputDir + "/" + "ehmm" + ".phoneList.int >> log.txt" + "; exit )\n";
|
||||
+ ehmm.getAbsolutePath() + "/lab " + EHMM_ALIGN_NUM_THREADS + " >> log.txt" + "; perl " + getProp(EHMMDIR)
|
||||
+ "/bin/sym2nm.pl " + ehmm.getAbsolutePath() + "/lab " + outputDir + "/" + "ehmm" + ".phoneList.int >> log.txt"
|
||||
+ "; exit )\n";
|
||||
|
||||
System.out.println(cmd);
|
||||
pw.print(cmd);
|
||||
|
@ -550,6 +584,7 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
* Create phone sequence file, which is used for Alignment
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
|
||||
private void getPhoneSequence() throws Exception {
|
||||
|
@ -582,8 +617,10 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
* Get phone sequence from a single feature file
|
||||
*
|
||||
* @param basename
|
||||
* basename
|
||||
* @return String
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private String getLineFromXML(String basename) throws Exception {
|
||||
|
||||
|
@ -611,6 +648,7 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
* This computes a string of phonetic symbols out of an allophones xml: - standard phones are taken from "ph" attribute
|
||||
*
|
||||
* @param tokens
|
||||
* tokens
|
||||
* @return transcription
|
||||
*/
|
||||
private String collectTranscription(NodeList tokens) {
|
||||
|
@ -644,6 +682,7 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
* Post processing Step to convert Label files to MARY supportable format
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void getProperLabelFormat() throws Exception {
|
||||
for (int i = 0; i < bnl.getLength(); i++) {
|
||||
|
@ -657,7 +696,9 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
* Post Processing single Label file
|
||||
*
|
||||
* @param basename
|
||||
* basename
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void convertSingleLabelFile(String basename) throws Exception {
|
||||
|
||||
|
@ -710,6 +751,9 @@ public class EHMMLabeler extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
VoiceImportComponent vic = new EHMMLabeler();
|
||||
|
|
|
@ -118,6 +118,8 @@ public class ESTCaller {
|
|||
* The layout of the processed database
|
||||
* @param baseNameArray
|
||||
* The array of basenames of the .wav files to process
|
||||
* @param pitchmarksExt
|
||||
* pitchmarksExt
|
||||
*
|
||||
*/
|
||||
public void make_pm_wave(String[] baseNameArray, String pitchmarksDirName, String pitchmarksExt) {
|
||||
|
@ -164,6 +166,12 @@ public class ESTCaller {
|
|||
* corrected pitchmarks with the directory name
|
||||
* @param baseNameArray
|
||||
* The array of basenames of the .wav files to process
|
||||
* @param correctedPitchmarksExt
|
||||
* correctedPitchmarksExt
|
||||
* @param lpcDirName
|
||||
* lpcDirName
|
||||
* @param lpcExt
|
||||
* lpcExt
|
||||
*
|
||||
*/
|
||||
public void make_lpc(String[] baseNameArray, String correctedPitchmarksDirName, String correctedPitchmarksExt,
|
||||
|
@ -203,6 +211,12 @@ public class ESTCaller {
|
|||
* The layout of the processed database
|
||||
* @param baseNameArray
|
||||
* The array of basenames of the .wav files to process
|
||||
* @param correctedPitchmarksExt
|
||||
* correctedPitchmarksExt
|
||||
* @param mcepDirName
|
||||
* mcepDirName
|
||||
* @param mcepExt
|
||||
* mcepExt
|
||||
*
|
||||
*/
|
||||
public void make_mcep(String[] baseNameArray, String correctedPitchmarksDirName, String correctedPitchmarksExt,
|
||||
|
|
|
@ -216,8 +216,6 @@ public class F0PolynomialFeatureFileWriter extends VoiceImportComponent {
|
|||
/**
|
||||
* From the given feature definition, set up a battery of instance variables intended to speed up the analysis of the feature
|
||||
* vectors.
|
||||
*
|
||||
* @param featureDefinition
|
||||
*/
|
||||
private void initialiseFeatureConstants() {
|
||||
assert features != null : "This shouldn't be called without features";
|
||||
|
@ -251,6 +249,7 @@ public class F0PolynomialFeatureFileWriter extends VoiceImportComponent {
|
|||
* Get the audio data for the given sentence
|
||||
*
|
||||
* @param s
|
||||
* s
|
||||
* @return the audio data for the sentence, in double representation
|
||||
* @throws IOException
|
||||
* if there is a problem reading the audio data
|
||||
|
@ -269,6 +268,7 @@ public class F0PolynomialFeatureFileWriter extends VoiceImportComponent {
|
|||
* Play the audio for the given sentence in blocking mode (returns when finished playing)
|
||||
*
|
||||
* @param s
|
||||
* s
|
||||
* @throws IOException
|
||||
* if there is a problem reading the audio data
|
||||
*/
|
||||
|
@ -334,6 +334,7 @@ public class F0PolynomialFeatureFileWriter extends VoiceImportComponent {
|
|||
* For the given log f0 contour, compute an interpolation across NaN sections
|
||||
*
|
||||
* @param rawLogF0Contour
|
||||
* rawLogF0Contour
|
||||
* @return a version of the LogF0 contour for which values are interpolated across NaN regions
|
||||
*/
|
||||
private double[] getInterpolatedLogF0Contour(double[] rawLogF0Contour) {
|
||||
|
@ -366,9 +367,9 @@ public class F0PolynomialFeatureFileWriter extends VoiceImportComponent {
|
|||
* For a syllable that is part of a sentence, determine the position of the syllable in an array representing the full
|
||||
* sentence.
|
||||
*
|
||||
* @param sentence
|
||||
* @param s
|
||||
* the sentence
|
||||
* @param syllable
|
||||
* @param syl
|
||||
* the syllable which must be inside the sentence
|
||||
* @param arrayLength
|
||||
* the length of an array representing the temporal extent of the sentence
|
||||
|
@ -439,6 +440,7 @@ public class F0PolynomialFeatureFileWriter extends VoiceImportComponent {
|
|||
* @param approximatedLogF0
|
||||
* the approximated log F0 curve (ignored if null)
|
||||
* @param f0FrameSkip
|
||||
* f0FrameSkip
|
||||
*/
|
||||
private void drawGraph(double[] logF0, double[] interpolatedLogF0, double[] approximatedLogF0, double f0FrameSkip) {
|
||||
if (f0Graph == null) {
|
||||
|
@ -480,9 +482,13 @@ public class F0PolynomialFeatureFileWriter extends VoiceImportComponent {
|
|||
* Compute the polynomial unit features and write them to the given data output.
|
||||
*
|
||||
* @param out
|
||||
* out
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws UnsupportedEncodingException
|
||||
* UnsupportedEncodingException
|
||||
* @throws FileNotFoundException
|
||||
* FileNotFoundException
|
||||
*/
|
||||
protected void writeUnitFeaturesTo(DataOutput out) throws IOException, UnsupportedEncodingException, FileNotFoundException {
|
||||
int numUnits = units.getNumberOfUnits();
|
||||
|
@ -576,7 +582,9 @@ public class F0PolynomialFeatureFileWriter extends VoiceImportComponent {
|
|||
* Write the header of this feature file to the given DataOutput
|
||||
*
|
||||
* @param out
|
||||
* out
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
protected void writeHeaderTo(DataOutput out) throws IOException {
|
||||
new MaryHeader(MaryHeader.UNITFEATS).writeTo(out);
|
||||
|
@ -594,6 +602,9 @@ public class F0PolynomialFeatureFileWriter extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
F0PolynomialFeatureFileWriter acfeatsWriter = new F0PolynomialFeatureFileWriter();
|
||||
|
|
|
@ -127,8 +127,7 @@ public class F0PolynomialInspector extends VoiceImportComponent {
|
|||
/**
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws UnsupportedEncodingException
|
||||
* @throws FileNotFoundException
|
||||
* IOException
|
||||
*/
|
||||
protected void displaySentences() throws IOException {
|
||||
int numUnits = units.getNumberOfUnits();
|
||||
|
@ -377,6 +376,9 @@ public class F0PolynomialInspector extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
F0PolynomialInspector acfeatsWriter = new F0PolynomialInspector();
|
||||
|
|
|
@ -196,6 +196,9 @@ public class F0PolynomialTreeTrainer extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
F0PolynomialTreeTrainer acfeatsWriter = new F0PolynomialTreeTrainer();
|
||||
|
|
|
@ -67,6 +67,10 @@ public class FestivalCARTImporter {
|
|||
*
|
||||
* @param festvoxDirectory
|
||||
* the festvox directory of a voice
|
||||
* @param destDir
|
||||
* destDir
|
||||
* @param featDef
|
||||
* featDef
|
||||
*/
|
||||
public void importCARTS(String festvoxDirectory, String destDir, FeatureDefinition featDef) {
|
||||
try {
|
||||
|
@ -111,6 +115,8 @@ public class FestivalCARTImporter {
|
|||
*
|
||||
* @param destDir
|
||||
* the destination directory
|
||||
* @param featDef
|
||||
* featDef
|
||||
*/
|
||||
public void dumpCARTS(String destDir, FeatureDefinition featDef) {
|
||||
try {
|
||||
|
|
|
@ -118,6 +118,9 @@ public class Festvox2MaryTranscripts extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
Festvox2MaryTranscripts f2mt = new Festvox2MaryTranscripts();
|
||||
|
|
|
@ -178,7 +178,15 @@ public class HMMParameterExtractor extends VoiceImportComponent {
|
|||
* Stand alone testing using a TARGETFEATURES list of files as input.
|
||||
*
|
||||
* @param file
|
||||
* file
|
||||
* @param contextFeaDir
|
||||
* contextFeaDir
|
||||
* @param outputDir
|
||||
* outputDir
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @param InterruptedException
|
||||
* InterruptedException
|
||||
*/
|
||||
public void generateParameters(String file, String contextFeaDir, String outputDir) throws IOException, InterruptedException {
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ public class HMMVoiceCompiler extends VoiceCompiler {
|
|||
|
||||
/**
|
||||
* HMM Voice-specific parameters, these are parameters used during models training if using MGC: gamma=0 alpha=0.42 linear
|
||||
* gain (default) if using LSP: gamma>0 LSP: gamma=1 alpha=0.0 linear gain/log gain Mel-LSP: gamma=1 alpha=0.42 log gain
|
||||
* gain (default) if using LSP: gamma>0 LSP: gamma=1 alpha=0.0 linear gain/log gain Mel-LSP: gamma=1 alpha=0.42 log gain
|
||||
* MGC-LSP: gamma=3 alpha=0.42 log gain
|
||||
*/
|
||||
public static final String alpha = "HMMVoiceConfigure.freqWarp";
|
||||
|
@ -84,7 +84,9 @@ public class HMMVoiceCompiler extends VoiceCompiler {
|
|||
|
||||
/**
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws FileNotFoundException
|
||||
* FileNotFoundException
|
||||
*/
|
||||
@Override
|
||||
protected void mapFeatures() throws IOException, FileNotFoundException {
|
||||
|
@ -243,6 +245,7 @@ public class HMMVoiceCompiler extends VoiceCompiler {
|
|||
* @param treeFileName
|
||||
* a HTS tree file
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private void replaceBackFeatureNames(String treeFileName) throws IOException {
|
||||
|
||||
|
@ -306,7 +309,9 @@ public class HMMVoiceCompiler extends VoiceCompiler {
|
|||
* Load mapping of features from file
|
||||
*
|
||||
* @param fileName
|
||||
* fileName
|
||||
* @throws FileNotFoundException
|
||||
* FileNotFoundException
|
||||
*/
|
||||
private Map<String, String> loadFeaturesMap(String fileName) throws FileNotFoundException {
|
||||
|
||||
|
|
|
@ -121,6 +121,8 @@ public class HMMVoiceConfigure extends VoiceImportComponent {
|
|||
/**
|
||||
* Get the map of properties2values containing the default values
|
||||
*
|
||||
* @param db
|
||||
* db
|
||||
* @return map of props2values
|
||||
*/
|
||||
public SortedMap<String, String> getDefaultProps(DatabaseLayout db) {
|
||||
|
@ -270,6 +272,8 @@ public class HMMVoiceConfigure extends VoiceImportComponent {
|
|||
/**
|
||||
* Do the computations required by this component.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
|
|
|
@ -73,7 +73,7 @@ import marytts.util.io.General;
|
|||
/**
|
||||
* This program was modified from previous version to: 1. copy $MARY_BASE/lib/external/hts directory to the voice building
|
||||
* directory 2. check again that all the external necessary programs are installed. 3. check as before that wav and text
|
||||
* directories exist and make conversions: voiceDir/wav -> voiceDir/hts/data/raw userProvidedDir/utts (festival format) ->
|
||||
* directories exist and make conversions: voiceDir/wav → voiceDir/hts/data/raw userProvidedDir/utts (festival format) →
|
||||
* voiceDir/text (one file per transcription) userProvidedDir/raw move to voiceDir/hts/data/raw
|
||||
*
|
||||
* @author marcela
|
||||
|
@ -99,6 +99,8 @@ public class HMMVoiceDataPreparation extends VoiceImportComponent {
|
|||
/**
|
||||
* Get the map of properties2values containing the default values
|
||||
*
|
||||
* @param db
|
||||
* db
|
||||
* @return map of props2values
|
||||
*/
|
||||
public SortedMap<String, String> getDefaultProps(DatabaseLayout db) {
|
||||
|
@ -124,6 +126,8 @@ public class HMMVoiceDataPreparation extends VoiceImportComponent {
|
|||
/**
|
||||
* Do the computations required by this component.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
|
@ -278,6 +282,8 @@ public class HMMVoiceDataPreparation extends VoiceImportComponent {
|
|||
/**
|
||||
* Check the paths of all the necessary external programs
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return true if all the paths are defined
|
||||
*/
|
||||
private boolean checkExternalPaths() throws Exception {
|
||||
|
@ -333,7 +339,8 @@ public class HMMVoiceDataPreparation extends VoiceImportComponent {
|
|||
/**
|
||||
* Checks if the directory exist and has files
|
||||
*
|
||||
* @param dir
|
||||
* @param dirName
|
||||
* dirName
|
||||
* @return true if dir exists and dir.list has a greater length than 0, false otherwise
|
||||
*/
|
||||
private boolean existWithFiles(String dirName) {
|
||||
|
|
|
@ -117,6 +117,8 @@ public class HMMVoiceMakeData extends VoiceImportComponent {
|
|||
/**
|
||||
* Get the map of properties2values containing the default values
|
||||
*
|
||||
* @param db
|
||||
* db
|
||||
* @return map of props2values
|
||||
*/
|
||||
public SortedMap<String, String> getDefaultProps(DatabaseLayout db) {
|
||||
|
@ -173,6 +175,8 @@ public class HMMVoiceMakeData extends VoiceImportComponent {
|
|||
/**
|
||||
* Do the computations required by this component.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
|
@ -325,7 +329,10 @@ public class HMMVoiceMakeData extends VoiceImportComponent {
|
|||
* Java version of the makeQuestions script (hts/data/scripts/make_questions.pl) uses: questionsFile contextFile
|
||||
* featureListFile
|
||||
*
|
||||
* @param voiceDir
|
||||
* voiceDir
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void makeQuestions(String voiceDir) throws Exception {
|
||||
|
||||
|
@ -676,7 +683,10 @@ public class HMMVoiceMakeData extends VoiceImportComponent {
|
|||
/***
|
||||
* Java version of the make labels script (hts/data/scripts/make_labels.pl) uses:
|
||||
*
|
||||
* @param voiceDir
|
||||
* voiceDir
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void makeLabels(String voiceDir) throws Exception {
|
||||
|
||||
|
@ -814,7 +824,10 @@ public class HMMVoiceMakeData extends VoiceImportComponent {
|
|||
/***
|
||||
* Java version of the make labels script (hts/data/scripts/make_labels.pl) uses:
|
||||
*
|
||||
* @param voiceDir
|
||||
* voiceDir
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void makeLabelsAdapt(String voiceDir) throws Exception {
|
||||
|
||||
|
@ -1015,6 +1028,7 @@ public class HMMVoiceMakeData extends VoiceImportComponent {
|
|||
* @param hmmFeatureList
|
||||
* extra features to train HMMs (file mary/hmmFeatures.txt)
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void extractMonophoneAndFullContextLabels(String feaFileName, String labFileName, String outFeaFileName,
|
||||
String outLabFileName, FeatureDefinition feaDef, PhoneTranslator phTranslator, Map<String, String> hmmFeatureList)
|
||||
|
|
|
@ -86,6 +86,8 @@ public class HMMVoiceMakeVoice extends VoiceImportComponent {
|
|||
/**
|
||||
* Get the map of properties2values containing the default values
|
||||
*
|
||||
* @param db
|
||||
* db
|
||||
* @return map of props2values
|
||||
*/
|
||||
public SortedMap<String, String> getDefaultProps(DatabaseLayout db) {
|
||||
|
@ -110,6 +112,8 @@ public class HMMVoiceMakeVoice extends VoiceImportComponent {
|
|||
/**
|
||||
* Do the computations required by this component.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
|
@ -132,8 +136,8 @@ public class HMMVoiceMakeVoice extends VoiceImportComponent {
|
|||
* the command line to be launched.
|
||||
* @param task
|
||||
* a task tag for error messages, such as "Pitchmarks" or "LPC".
|
||||
* @param the
|
||||
* basename of the file currently processed, for error messages.
|
||||
* @param voicedir
|
||||
* voicedir
|
||||
*/
|
||||
private void launchProcWithLogFile(String cmdLine, String task, String voicedir) {
|
||||
|
||||
|
|
|
@ -178,6 +178,8 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
/**
|
||||
* Do the computations required by this component.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
|
@ -268,8 +270,11 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* Setup the HTK directory
|
||||
*
|
||||
* @throws IOException
|
||||
* , InterruptedException
|
||||
* IOException
|
||||
* @throws InterruptedException
|
||||
* InterruptedException
|
||||
* @throws MaryConfigurationException
|
||||
* MaryConfigurationException
|
||||
*/
|
||||
private void setup() throws IOException, InterruptedException, MaryConfigurationException {
|
||||
|
||||
|
@ -300,6 +305,7 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* Creating phone dictionary (one-one mapping) and lists
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void createPhoneDictionary() throws Exception {
|
||||
PrintWriter transLabelOut = new PrintWriter(new FileOutputStream(new File(getProp(HTDIR) + File.separator + "etc"
|
||||
|
@ -367,6 +373,7 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* Create all required files(config files and HMM prototypes) for HTK Training
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void createRequiredFiles() throws Exception {
|
||||
|
||||
|
@ -534,7 +541,12 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
/**
|
||||
* delete sp repetition on htk.phones3.mlf
|
||||
*
|
||||
* @param filein
|
||||
* filein
|
||||
* @param fileout
|
||||
* fileout
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void delete_multiple_sp_in_PhoneMLFile(String filein, String fileout) throws Exception {
|
||||
String hled = getProp(HTKDIR) + File.separator + "HLEd";
|
||||
|
@ -575,6 +587,7 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* create phone master label file (Not used?)
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void createPhoneMLFile() throws Exception {
|
||||
String hled = getProp(HTKDIR) + File.separator + "HLEd";
|
||||
|
@ -614,6 +627,7 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* Feature Extraction for HTK Training
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void featureExtraction() throws Exception {
|
||||
|
||||
|
@ -648,6 +662,7 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* Initialize HTK Training process
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void initialiseHTKTrain() throws Exception {
|
||||
|
||||
|
@ -690,6 +705,7 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* Create HMMs for each phone from Global HMMs
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void createTrainFile() throws Exception {
|
||||
|
||||
|
@ -744,6 +760,7 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* Flat-start initialization for automatic labeling
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void herestTraining() throws Exception {
|
||||
|
||||
|
@ -1251,6 +1268,7 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* Force Align database for Automatic labels
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void hviteAligning() throws Exception {
|
||||
|
||||
|
@ -1399,6 +1417,7 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* Create phone sequence file, which is used for Alignment
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
|
||||
private void getPhoneSequence() throws Exception {
|
||||
|
@ -1439,8 +1458,14 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* Get phone sequence from a single feature file
|
||||
*
|
||||
* @param basename
|
||||
* basename
|
||||
* @param spause
|
||||
* spause
|
||||
* @param vpause
|
||||
* vpause
|
||||
* @return String
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private String getLineFromXML(String basename, boolean spause, boolean vpause) throws Exception {
|
||||
|
||||
|
@ -1508,6 +1533,7 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* attribute
|
||||
*
|
||||
* @param tokens
|
||||
* tokens
|
||||
* @return orig
|
||||
*/
|
||||
private String collectTranscription(NodeList tokens) {
|
||||
|
@ -1575,7 +1601,9 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* Post Processing single Label file and write on OUTLABDIR
|
||||
*
|
||||
* @param basename
|
||||
* basename
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void convertSingleLabelFile(String basename) throws Exception {
|
||||
|
||||
|
@ -1630,6 +1658,7 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* To convert HTK Label format to MARY lab format
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void getProperLabelFormat() throws Exception {
|
||||
String alignedMlf = getProp(HTDIR) + File.separator + "aligned.mlf";
|
||||
|
@ -1715,9 +1744,10 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* Converting text to RAWMARYXML with Locale
|
||||
*
|
||||
* @param locale
|
||||
* @return "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + "<maryxml version=\"0.4\"\n"
|
||||
* + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + "xmlns=\"http://mary.dfki.de/2002/MaryXML\"\n"
|
||||
* + "xml:lang=\"" + locale + "\">\n" + "<boundary duration=\"100\"/>\n"
|
||||
* locale
|
||||
* @return "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + "<maryxml version=\"0.4\"\n" +
|
||||
* "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + "xmlns=\"http://mary.dfki.de/2002/MaryXML\"\n" +
|
||||
* "xml:lang=\"" + locale + "\">\n" + "<boundary duration=\"100\"/>\n"
|
||||
*/
|
||||
public static String getMaryXMLHeaderWithInitialBoundary(String locale) {
|
||||
return "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + "<maryxml version=\"0.4\"\n"
|
||||
|
@ -1739,6 +1769,7 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* Translation table for labels which are incompatible with HTK or shell filenames See common_routines.pl in HTS training.
|
||||
*
|
||||
* @param lab
|
||||
* lab
|
||||
* @return String
|
||||
*/
|
||||
public String replaceTrickyPhones(String lab) {
|
||||
|
@ -1781,6 +1812,7 @@ public class HTKLabeler extends VoiceImportComponent {
|
|||
* when correcting the actual durations of AcousticPhonemes.
|
||||
*
|
||||
* @param lab
|
||||
* lab
|
||||
* @return String
|
||||
*/
|
||||
public String replaceBackTrickyPhones(String lab) {
|
||||
|
|
|
@ -377,6 +377,13 @@ public class JoinModeller extends VoiceImportComponent {
|
|||
* This function reads a feature list file originally used to train the HMMs, in HMM voices. The file format is simple, one
|
||||
* feature after another like in the ../mary/features.txt An example of feature list is in ../mary/featuresHmmVoice.txt Since
|
||||
* the features are provided by the user, it should be checked that the features exist
|
||||
*
|
||||
* @param featureListFile
|
||||
* featureListFile
|
||||
* @param feaDef
|
||||
* feaDef
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void readFeatureList(String featureListFile, FeatureDefinition feaDef) throws Exception {
|
||||
String line;
|
||||
|
|
|
@ -77,6 +77,8 @@ public class LabelPauseDeleter extends VoiceImportComponent {
|
|||
/**
|
||||
* Do the computations required by this component.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
|
@ -93,6 +95,7 @@ public class LabelPauseDeleter extends VoiceImportComponent {
|
|||
* Post processing Step to convert Label files to MARY supportable format
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void getProperLabelFormat() throws Exception {
|
||||
|
||||
|
@ -120,7 +123,9 @@ public class LabelPauseDeleter extends VoiceImportComponent {
|
|||
* Post Processing single Label file
|
||||
*
|
||||
* @param basename
|
||||
* basename
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
private boolean convertSingleLabelFile(String basename) throws Exception {
|
||||
|
@ -206,8 +211,10 @@ public class LabelPauseDeleter extends VoiceImportComponent {
|
|||
* To get Label Unit DATA (time stamp, index, phone unit)
|
||||
*
|
||||
* @param line
|
||||
* line
|
||||
* @return ArrayList contains time stamp, index and phone unit
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private ArrayList getLabelUnitData(String line) throws IOException {
|
||||
if (line == null)
|
||||
|
|
|
@ -80,6 +80,13 @@ public class MCEPMaker extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* Shift the pitchmarks to the closest peak.
|
||||
*
|
||||
* @param pmIn
|
||||
* pmIn
|
||||
* @param w
|
||||
* w
|
||||
* @param sampleRate
|
||||
* sampleRate
|
||||
*/
|
||||
private Float[] shiftToClosestPeak(Float[] pmIn, short[] w, int sampleRate) {
|
||||
|
||||
|
@ -129,6 +136,13 @@ public class MCEPMaker extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* Shift the pitchmarks to the previous zero crossing.
|
||||
*
|
||||
* @param pmIn
|
||||
* pmIn
|
||||
* @param w
|
||||
* w
|
||||
* @param sampleRate
|
||||
* sampleRate
|
||||
*/
|
||||
private Float[] shiftToPreviousZero(Float[] pmIn, short[] w, int sampleRate) {
|
||||
|
||||
|
@ -166,6 +180,11 @@ public class MCEPMaker extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* Rectification of the pitchmarks.
|
||||
*
|
||||
* @param baseNameArray
|
||||
* baseNameArray
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private void tweakThePitchmarks(String[] baseNameArray) throws IOException {
|
||||
|
||||
|
@ -226,6 +245,9 @@ public class MCEPMaker extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* The standard compute() method of the VoiceImportComponent interface.
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public boolean compute() throws IOException {
|
||||
|
||||
|
|
|
@ -112,6 +112,9 @@ public class OctaveVoiceQualityProcessor extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* The standard compute() method of the VoiceImportComponent interface.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
|
||||
|
|
|
@ -388,8 +388,10 @@ public class PauseDurationTrainer extends VoiceImportComponent {
|
|||
*
|
||||
*
|
||||
* @param basename
|
||||
* basename
|
||||
* @return readFeatureTable(lnr)
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private VectorsAndDefinition readFeaturesFor(String basename) throws IOException {
|
||||
FileInputStream fis;
|
||||
|
|
|
@ -129,9 +129,13 @@ public class PhoneFeatureFileWriter extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* @param out
|
||||
* out
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws UnsupportedEncodingException
|
||||
* UnsupportedEncodingException
|
||||
* @throws FileNotFoundException
|
||||
* FileNotFoundException
|
||||
*/
|
||||
protected void writeUnitFeaturesTo(DataOutput out) throws IOException, UnsupportedEncodingException, FileNotFoundException {
|
||||
int numUnits = unitFileReader.getNumberOfUnits();
|
||||
|
@ -211,6 +215,7 @@ public class PhoneFeatureFileWriter extends VoiceImportComponent {
|
|||
* Write the header of this feature file to the given DataOutput
|
||||
*
|
||||
* @param out
|
||||
* out
|
||||
* @throws IOException
|
||||
*/
|
||||
protected void writeHeaderTo(DataOutput out) throws IOException {
|
||||
|
@ -229,6 +234,9 @@ public class PhoneFeatureFileWriter extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
PhoneFeatureFileWriter ffw = new PhoneFeatureFileWriter();
|
||||
|
|
|
@ -146,6 +146,7 @@ public class PhoneLabelFeatureAligner extends VoiceImportComponent {
|
|||
*
|
||||
* @return a boolean indicating whether or not the database is fully aligned.
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
int bnlLengthIn = bnl.getLength();
|
||||
|
@ -262,6 +263,7 @@ public class PhoneLabelFeatureAligner extends VoiceImportComponent {
|
|||
* @param numProblems
|
||||
* the number of problems
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @return the number of problems remaining
|
||||
*/
|
||||
protected int correctPausesYesNo(int numProblems) throws IOException {
|
||||
|
@ -278,7 +280,11 @@ public class PhoneLabelFeatureAligner extends VoiceImportComponent {
|
|||
* Let the user select if he wants to run the the automatic correction of pauses.
|
||||
*
|
||||
* @param someProblems
|
||||
* someProblems
|
||||
* @param basename
|
||||
* basename
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
protected void deleteProblemsYesNo(Map<String, String> someProblems, String basename) throws IOException {
|
||||
int choice = JOptionPane.showOptionDialog(null, "Removed problematic utterance(s) from List. Also delete file(s)?",
|
||||
|
@ -390,6 +396,7 @@ public class PhoneLabelFeatureAligner extends VoiceImportComponent {
|
|||
*
|
||||
* @return the number of problems remaining
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
protected int correctPauses() throws IOException {
|
||||
correctedPauses = true;
|
||||
|
@ -784,8 +791,10 @@ public class PhoneLabelFeatureAligner extends VoiceImportComponent {
|
|||
* subsequent alignment tries.
|
||||
*
|
||||
* @param basename
|
||||
* basename
|
||||
* @return null if the alignment was OK, or a String containing an error message.
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
protected String verifyAlignment(String basename) throws IOException {
|
||||
BufferedReader labels = null;
|
||||
|
@ -959,6 +968,7 @@ public class PhoneLabelFeatureAligner extends VoiceImportComponent {
|
|||
* @param basename
|
||||
* the filename of the label/feature file
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private void replaceUnitLabels(String basename) throws IOException {
|
||||
String line;
|
||||
|
@ -1093,8 +1103,11 @@ public class PhoneLabelFeatureAligner extends VoiceImportComponent {
|
|||
*
|
||||
* @return a boolean indicating whether the file was saved.
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws UnsupportedEncodingException
|
||||
* UnsupportedEncodingException
|
||||
* @throws FileNotFoundException
|
||||
* FileNotFoundException
|
||||
*/
|
||||
public boolean display() throws IOException, UnsupportedEncodingException, FileNotFoundException {
|
||||
final JFrame frame = new JFrame("Edit " + file.getName());
|
||||
|
|
|
@ -92,6 +92,13 @@ public class PraatPitchmarker extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* Shift the pitchmarks to the closest peak.
|
||||
*
|
||||
* @param pmIn
|
||||
* pmIn
|
||||
* @param w
|
||||
* w
|
||||
* @param sampleRate
|
||||
* sampleRate
|
||||
*/
|
||||
private float[] shiftToClosestPeak(float[] pmIn, short[] w, int sampleRate) {
|
||||
|
||||
|
@ -141,6 +148,13 @@ public class PraatPitchmarker extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* Shift the pitchmarks to the previous zero crossing.
|
||||
*
|
||||
* @param pmIn
|
||||
* pmIn
|
||||
* @param w
|
||||
* w
|
||||
* @param sampleRate
|
||||
* sampleRate
|
||||
*/
|
||||
private float[] shiftToPreviousZero(float[] pmIn, short[] w, int sampleRate) {
|
||||
|
||||
|
@ -183,6 +197,8 @@ public class PraatPitchmarker extends VoiceImportComponent {
|
|||
* basename of the corresponding wav file
|
||||
* @param pitchmarks
|
||||
* the input pitchmarks
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @return the adjusted pitchmarks
|
||||
*/
|
||||
private float[] adjustPitchmarks(String basename, float[] pitchmarks) throws IOException {
|
||||
|
@ -227,6 +243,7 @@ public class PraatPitchmarker extends VoiceImportComponent {
|
|||
* @param basename
|
||||
* of files to process
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
protected void estPitchmarks(String basename) throws IOException {
|
||||
String pointprocessFilename = getProp(PRAATPMDIR) + basename + pointpExt;
|
||||
|
@ -240,6 +257,9 @@ public class PraatPitchmarker extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* The standard compute() method of the VoiceImportComponent interface.
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public boolean compute() throws IOException {
|
||||
percent = 0;
|
||||
|
|
|
@ -130,6 +130,8 @@ public class QualityControl extends VoiceImportComponent {
|
|||
/**
|
||||
* Do the computations required by this component.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
|
||||
|
@ -169,8 +171,11 @@ public class QualityControl extends VoiceImportComponent {
|
|||
* Take Each Base File and identifies any suspicious-alignments
|
||||
*
|
||||
* @param basename
|
||||
* basename
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
|
||||
private void findSuspiciousAlignments(String basename) throws IOException, Exception {
|
||||
|
@ -312,7 +317,9 @@ public class QualityControl extends VoiceImportComponent {
|
|||
*
|
||||
* @return fricativeHash
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private Map createHashMaps() throws IOException, Exception {
|
||||
|
||||
|
@ -427,6 +434,7 @@ public class QualityControl extends VoiceImportComponent {
|
|||
* Create a HashMap which contains indivisual fricative Thresholds
|
||||
*
|
||||
* @param fricativeHash
|
||||
* fricativeHash
|
||||
* @return HashMap which contains indivisual fricative Thresholds
|
||||
*/
|
||||
private Map getFricativeThresholds(Map fricativeHash) {
|
||||
|
@ -469,12 +477,18 @@ public class QualityControl extends VoiceImportComponent {
|
|||
* Identifies If Silence has more Energy
|
||||
*
|
||||
* @param signal
|
||||
* signal
|
||||
* @param samplingRate
|
||||
* samplingRate
|
||||
* @param startTimeStamp
|
||||
* startTimeStamp
|
||||
* @param endTimeStamp
|
||||
* endTimeStamp
|
||||
* @return true if silence segment more energy, else false
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
|
||||
private boolean isSilenceHighEnergy(double[] signal, float samplingRate, double startTimeStamp, double endTimeStamp)
|
||||
|
@ -502,12 +516,18 @@ public class QualityControl extends VoiceImportComponent {
|
|||
* Calculate Silence Energy
|
||||
*
|
||||
* @param signal
|
||||
* signal
|
||||
* @param samplingRate
|
||||
* samplingRate
|
||||
* @param startTimeStamp
|
||||
* startTimeStamp
|
||||
* @param endTimeStamp
|
||||
* endTimeStamp
|
||||
* @return SignalProcUtils.getEnergy(phoneSegment)
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private double getSilenceEnergy(double[] signal, float samplingRate, double startTimeStamp, double endTimeStamp)
|
||||
throws IOException, Exception {
|
||||
|
@ -529,6 +549,7 @@ public class QualityControl extends VoiceImportComponent {
|
|||
* Writing all suspicious labels to a File
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private void writeProblemstoFile() throws IOException {
|
||||
|
||||
|
@ -555,6 +576,7 @@ public class QualityControl extends VoiceImportComponent {
|
|||
* Writing all priority problems to a file
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private void writePrioritytoFile() throws IOException {
|
||||
|
||||
|
@ -584,12 +606,20 @@ public class QualityControl extends VoiceImportComponent {
|
|||
* Identifies if Fricative has more higher frequency Energy
|
||||
*
|
||||
* @param signal
|
||||
* signal
|
||||
* @param samplingRate
|
||||
* samplingRate
|
||||
* @param startTimeStamp
|
||||
* startTimeStamp
|
||||
* @param endTimeStamp
|
||||
* endTimeStamp
|
||||
* @param unitName
|
||||
* unitName
|
||||
* @return true if the segment more energy in higher freq. region, else false
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private boolean isFricativeHighEnergy(double[] signal, float samplingRate, double startTimeStamp, double endTimeStamp,
|
||||
String unitName) throws IOException, Exception {
|
||||
|
@ -628,13 +658,20 @@ public class QualityControl extends VoiceImportComponent {
|
|||
* To get Fricative High-Freq Energy
|
||||
*
|
||||
* @param signal
|
||||
* signal
|
||||
* @param samplingRate
|
||||
* samplingRate
|
||||
* @param startTimeStamp
|
||||
* startTimeStamp
|
||||
* @param endTimeStamp
|
||||
* endTimeStamp
|
||||
* @param unitName
|
||||
* unitName
|
||||
* @return Fricative High-Freq Energy
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private double getFricativeEnergy(double[] signal, float samplingRate, double startTimeStamp, double endTimeStamp,
|
||||
String unitName) throws IOException, Exception {
|
||||
|
@ -666,12 +703,18 @@ public class QualityControl extends VoiceImportComponent {
|
|||
* Identifies The Given Segment is Voiced or Non-Voiced
|
||||
*
|
||||
* @param signal
|
||||
* signal
|
||||
* @param samplingRate
|
||||
* samplingRate
|
||||
* @param startTimeStamp
|
||||
* startTimeStamp
|
||||
* @param endTimeStamp
|
||||
* endTimeStamp
|
||||
* @return true if the segment is Voiced, else false
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
|
||||
private boolean isVowelVoiced(double[] signal, float samplingRate, double startTimeStamp, double endTimeStamp)
|
||||
|
@ -718,8 +761,10 @@ public class QualityControl extends VoiceImportComponent {
|
|||
* To get Label Unit DATA (time stamp, index, phone unit)
|
||||
*
|
||||
* @param line
|
||||
* line
|
||||
* @return ArrayList contains time stamp, index and phone unit
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private ArrayList getLabelUnitData(String line) throws IOException {
|
||||
if (line == null)
|
||||
|
@ -738,7 +783,7 @@ public class QualityControl extends VoiceImportComponent {
|
|||
/**
|
||||
* Double ArrayList to double array conversion
|
||||
*
|
||||
* @param Double
|
||||
* @param array
|
||||
* ArrayList
|
||||
* @return double array
|
||||
*/
|
||||
|
@ -757,8 +802,10 @@ public class QualityControl extends VoiceImportComponent {
|
|||
* To get Phone Unit from Feature Vector
|
||||
*
|
||||
* @param line
|
||||
* line
|
||||
* @return String phone unit
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
|
||||
private String getFeatureUnit(String line) throws IOException {
|
||||
|
@ -775,7 +822,9 @@ public class QualityControl extends VoiceImportComponent {
|
|||
* To know phone unit in Feature Vector is Vowel or not
|
||||
*
|
||||
* @param line
|
||||
* line
|
||||
* @param ph_VC_idx
|
||||
* ph_VC_idx
|
||||
* @return true if phone unit in Feature Vector is Vowel, else false
|
||||
*/
|
||||
private boolean isVowel(String line, int ph_VC_idx) {
|
||||
|
@ -794,7 +843,9 @@ public class QualityControl extends VoiceImportComponent {
|
|||
* To know phone unit in Feature Vector is Fricative or not
|
||||
*
|
||||
* @param line
|
||||
* line
|
||||
* @param ph_Ctype_idx
|
||||
* ph_Ctype_idx
|
||||
* @return true if phone unit in Feature Vector is Fricative, else false
|
||||
*/
|
||||
private boolean isFricative(String line, int ph_Ctype_idx) {
|
||||
|
|
|
@ -128,11 +128,14 @@ public class SPTKMFCCExtractor extends VoiceImportComponent {
|
|||
}
|
||||
|
||||
/***
|
||||
* Calculate mfcc using SPTK, uses sox to convert wav-->raw
|
||||
* Calculate mfcc using SPTK, uses sox to convert wav→raw
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @throws InterruptedException
|
||||
* InterruptedException
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public void getSptkMfcc(String inFile, String outFile) throws IOException, InterruptedException, Exception {
|
||||
|
||||
|
|
|
@ -342,6 +342,9 @@ public class SanityChecker extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
|
|
|
@ -115,9 +115,9 @@ public class SettingsGUI {
|
|||
* Show a frame displaying the help file.
|
||||
*
|
||||
* @param selectedComp
|
||||
*
|
||||
* selectedComp
|
||||
* @param simpleMode
|
||||
*
|
||||
* simpleMode
|
||||
*/
|
||||
public void display(String selectedComp, boolean simpleMode) {
|
||||
wasSaved = false;
|
||||
|
|
|
@ -90,6 +90,9 @@ public class SnackPitchmarker extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* The standard compute() method of the VoiceImportComponent interface.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
|
||||
|
@ -184,6 +187,13 @@ public class SnackPitchmarker extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* Shift the pitchmarks to the closest peak.
|
||||
*
|
||||
* @param pmIn
|
||||
* pmIn
|
||||
* @param w
|
||||
* w
|
||||
* @param sampleRate
|
||||
* sampleRate
|
||||
*/
|
||||
private float[] shiftToClosestPeak(float[] pmIn, short[] w, int sampleRate) {
|
||||
|
||||
|
@ -233,6 +243,13 @@ public class SnackPitchmarker extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* Shift the pitchmarks to the previous zero crossing.
|
||||
*
|
||||
* @param pmIn
|
||||
* pmIn
|
||||
* @param w
|
||||
* w
|
||||
* @param sampleRate
|
||||
* sampleRate
|
||||
*/
|
||||
private float[] shiftToPreviousZero(float[] pmIn, short[] w, int sampleRate) {
|
||||
|
||||
|
@ -271,10 +288,12 @@ public class SnackPitchmarker extends VoiceImportComponent {
|
|||
/**
|
||||
* Adjust pitchmark position to the zero crossing preceding the closest peak.
|
||||
*
|
||||
* @param basename
|
||||
* @param wf
|
||||
* basename of the corresponding wav file
|
||||
* @param pitchmarks
|
||||
* the input pitchmarks
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @return the adjusted pitchmarks
|
||||
*/
|
||||
private float[] adjustPitchmarks(WavReader wf, float[] pitchmarks) throws IOException {
|
||||
|
|
|
@ -123,6 +123,9 @@ public class SnackVoiceQualityProcessor extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* The standard compute() method of the VoiceImportComponent interface.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
|
||||
|
@ -243,9 +246,12 @@ public class SnackVoiceQualityProcessor extends VoiceImportComponent {
|
|||
* Loads in snackData the f0 + formants[numFormants] + band widths[numFormants] from the snackFile
|
||||
*
|
||||
* @param numFormants
|
||||
* numFormants
|
||||
* @param snackFile
|
||||
* snackFile
|
||||
* @return snackData
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
static double[][] readSnackData(int numFormants, String snackFile) throws IOException {
|
||||
double[][] snackData = null;
|
||||
|
@ -288,11 +294,26 @@ public class SnackVoiceQualityProcessor extends VoiceImportComponent {
|
|||
*
|
||||
* @param snack
|
||||
* : array containing f0+formants+band widths
|
||||
* @param samplingRate
|
||||
* samplingRate
|
||||
* @param frameLength
|
||||
* : in samples
|
||||
* @param windowLength
|
||||
* : in samples
|
||||
* @param sound
|
||||
* sound
|
||||
* @param hammWin
|
||||
* hammWin
|
||||
* @param barkMatrix
|
||||
* barkMatrix
|
||||
* @param fftSize
|
||||
* fftSize
|
||||
* @param vq
|
||||
* vq
|
||||
* @param debug
|
||||
* debug
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public void calculateVoiceQuality(double snack[][], int samplingRate, int frameLength, int windowLength, WavReader sound,
|
||||
Window hammWin, double[][] barkMatrix, int fftSize, VoiceQuality vq, boolean debug) throws Exception {
|
||||
|
@ -579,6 +600,12 @@ public class SnackVoiceQualityProcessor extends VoiceImportComponent {
|
|||
/**
|
||||
* returns the index where the closset harmonic peak to f is found
|
||||
*
|
||||
* @param peaks
|
||||
* peaks
|
||||
* @param f
|
||||
* f
|
||||
* @param maxFreqIndex
|
||||
* maxFreqIndex
|
||||
* @return index
|
||||
*/
|
||||
public int findClosestHarmonicPeak(double peaks[], double f, int maxFreqIndex) {
|
||||
|
@ -600,8 +627,11 @@ public class SnackVoiceQualityProcessor extends VoiceImportComponent {
|
|||
* Compensation of the vocal tract influence
|
||||
*
|
||||
* @param freq
|
||||
* freq
|
||||
* @param formant
|
||||
* formant
|
||||
* @param bandWidth
|
||||
* bandWidth
|
||||
* @return 0.0
|
||||
*/
|
||||
public double vocalTractCompensation(double freq, double formant, double bandWidth) {
|
||||
|
|
|
@ -71,6 +71,8 @@ public class SphinxLabeler extends VoiceImportComponent {
|
|||
/**
|
||||
* Do the computations required by this component.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
|
|
|
@ -130,6 +130,8 @@ public class SphinxLabelingPreparator extends VoiceImportComponent {
|
|||
/**
|
||||
* Do the computations required by this component.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
|
@ -207,7 +209,9 @@ public class SphinxLabelingPreparator extends VoiceImportComponent {
|
|||
* Setup the sphinx directory
|
||||
*
|
||||
* @throws IOException
|
||||
* , InterruptedException
|
||||
* IOException
|
||||
* @throws InterruptedException
|
||||
* InterruptedException
|
||||
*/
|
||||
private void setup() throws IOException, InterruptedException {
|
||||
|
||||
|
@ -233,6 +237,7 @@ public class SphinxLabelingPreparator extends VoiceImportComponent {
|
|||
* Dump the filenames
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private void dumpFilenames() throws IOException {
|
||||
// for training: open filename file
|
||||
|
@ -262,6 +267,7 @@ public class SphinxLabelingPreparator extends VoiceImportComponent {
|
|||
* @param phones
|
||||
* the phone set to be filled
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void buildDictAndDumpTrans(Map dictionary, Set phones) throws Exception {
|
||||
// build a new MaryClient
|
||||
|
@ -494,6 +500,8 @@ public class SphinxLabelingPreparator extends VoiceImportComponent {
|
|||
/**
|
||||
* Get a new MARY client
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @return the MARY client
|
||||
*/
|
||||
private MaryClient getMaryClient() throws IOException {
|
||||
|
@ -514,6 +522,7 @@ public class SphinxLabelingPreparator extends VoiceImportComponent {
|
|||
* @param phones
|
||||
* the phone set
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private void dumpPhoneFile(Set phones) throws IOException {
|
||||
PrintWriter phoneOut = new PrintWriter(new FileOutputStream(new File(outputDir + "/" + voicename + ".phone")));
|
||||
|
@ -564,6 +573,7 @@ public class SphinxLabelingPreparator extends VoiceImportComponent {
|
|||
* @param dictionary
|
||||
* the dictionary
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private void dumpDictFile(Map dictionary) throws IOException {
|
||||
PrintWriter dictOut = new PrintWriter(new FileOutputStream(new File(outputDir + "/" + voicename + ".dic")));
|
||||
|
@ -588,6 +598,7 @@ public class SphinxLabelingPreparator extends VoiceImportComponent {
|
|||
* Dump the filler dictionary
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private void dumpFillerDictFile() throws IOException {
|
||||
PrintWriter fillerDictOut = new PrintWriter(new FileOutputStream(new File(outputDir + "/" + voicename + ".filler")));
|
||||
|
@ -601,6 +612,7 @@ public class SphinxLabelingPreparator extends VoiceImportComponent {
|
|||
* Convert the MFCCs to Sphinx format
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void convertMFCCs() throws Exception {
|
||||
String wavDir = db.getProp(db.WAVDIR);
|
||||
|
@ -693,6 +705,7 @@ public class SphinxLabelingPreparator extends VoiceImportComponent {
|
|||
* Rewrite the config file so that it matches the voice database
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
private void rewriteConfigFile() throws Exception {
|
||||
// open the config file
|
||||
|
|
|
@ -63,6 +63,8 @@ public class SphinxTrainer extends VoiceImportComponent {
|
|||
/**
|
||||
* Do the computations required by this component.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
|
|
|
@ -163,6 +163,9 @@ public class TimelineWriter {
|
|||
|
||||
/**
|
||||
* Get the current byte position in the file
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public synchronized long getBytePointer() throws IOException {
|
||||
return (raf.getFilePointer());
|
||||
|
@ -170,6 +173,8 @@ public class TimelineWriter {
|
|||
|
||||
/**
|
||||
* Get the current time position in the file
|
||||
*
|
||||
* @return timePtr
|
||||
*/
|
||||
public synchronized long getTimePointer() {
|
||||
return (timePtr);
|
||||
|
@ -177,6 +182,11 @@ public class TimelineWriter {
|
|||
|
||||
/**
|
||||
* Set the current byte position in the file
|
||||
*
|
||||
* @param bytePos
|
||||
* bytePos
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
protected void setBytePointer(long bytePos) throws IOException {
|
||||
raf.seek(bytePos);
|
||||
|
@ -184,6 +194,9 @@ public class TimelineWriter {
|
|||
|
||||
/**
|
||||
* Set the current time position in the file
|
||||
*
|
||||
* @param timePosition
|
||||
* timePosition
|
||||
*/
|
||||
protected void setTimePointer(long timePosition) {
|
||||
timePtr = timePosition;
|
||||
|
@ -227,6 +240,8 @@ public class TimelineWriter {
|
|||
|
||||
/**
|
||||
* Returns the position of the datagram zone
|
||||
*
|
||||
* @return datagramsBytePos
|
||||
*/
|
||||
public long getDatagramsBytePos() {
|
||||
return datagramsBytePos;
|
||||
|
@ -234,6 +249,8 @@ public class TimelineWriter {
|
|||
|
||||
/**
|
||||
* Returns the current number of datagrams in the timeline.
|
||||
*
|
||||
* @return numDatagrams
|
||||
*/
|
||||
public long getNumDatagrams() {
|
||||
return numDatagrams;
|
||||
|
@ -241,6 +258,8 @@ public class TimelineWriter {
|
|||
|
||||
/**
|
||||
* Returns the sample rate of the timeline.
|
||||
*
|
||||
* @return sampleRate
|
||||
*/
|
||||
public int getSampleRate() {
|
||||
return sampleRate;
|
||||
|
@ -250,6 +269,7 @@ public class TimelineWriter {
|
|||
* Output the internally maintained indexes and close the file.
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public void close() throws IOException {
|
||||
|
||||
|
@ -275,6 +295,10 @@ public class TimelineWriter {
|
|||
* Feeds a file position (in bytes) and a time position (in samples) from a timeline, and determines if a new index field is
|
||||
* to be added.
|
||||
*
|
||||
* @param bytePosition
|
||||
* bytePosition
|
||||
* @param timePosition
|
||||
* timePosition
|
||||
* @return the number of index fields after the feed.
|
||||
*/
|
||||
private void feedIndex(long bytePosition, long timePosition) {
|
||||
|
@ -308,8 +332,8 @@ public class TimelineWriter {
|
|||
* the datagram to write.
|
||||
* @param reqSampleRate
|
||||
* the sample rate at which the datagram duration is expressed.
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public void feed(Datagram d, int reqSampleRate) throws IOException {
|
||||
// System.out.println( "Feeding datagram [ " + d.data.length + " , " + d.duration + " ] at pos ( "
|
||||
|
@ -335,8 +359,8 @@ public class TimelineWriter {
|
|||
* an array of datagrams.
|
||||
* @param reqSampleTime
|
||||
* the sample rate at which the datagram durations are expressed.
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public void feed(Datagram[] dArray, int reqSampleTime) throws IOException {
|
||||
for (int i = 0; i < dArray.length; i++) {
|
||||
|
|
|
@ -109,7 +109,7 @@ public class TranscriptionAligner extends VoiceImportComponent {
|
|||
* XML-Version: this changes mary xml-files (PHONEMISED)
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws XPathExpressionException
|
||||
* Exception
|
||||
*/
|
||||
public boolean compute() throws Exception {
|
||||
|
||||
|
@ -163,6 +163,9 @@ public class TranscriptionAligner extends VoiceImportComponent {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
VoiceImportComponent vic = new TranscriptionAligner();
|
||||
|
|
|
@ -94,6 +94,9 @@ public class UnitLabel {
|
|||
|
||||
/**
|
||||
* @param labFile
|
||||
* labFile
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @return ulab
|
||||
*/
|
||||
public static UnitLabel[] readLabFile(String labFile) throws IOException {
|
||||
|
@ -156,8 +159,10 @@ public class UnitLabel {
|
|||
* To get Label Unit DATA (time stamp, index, phone unit)
|
||||
*
|
||||
* @param line
|
||||
* line
|
||||
* @return ArrayList contains time stamp, index and phone unit
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private static ArrayList getLabelUnitData(String line) throws IOException {
|
||||
if (line == null)
|
||||
|
|
|
@ -378,6 +378,7 @@ public class VoiceCompiler extends VoiceImportComponent {
|
|||
* character is not a letter, we prepend a "V" for "voice".
|
||||
*
|
||||
* @param voiceName
|
||||
* voiceName
|
||||
* @return result in string format
|
||||
*/
|
||||
public static String toPackageName(String voiceName) {
|
||||
|
|
|
@ -59,6 +59,8 @@ public abstract class VoiceImportComponent {
|
|||
* the list of basenames
|
||||
* @param props
|
||||
* the map from properties to values
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
public final void initialise(DatabaseLayout db, BasenameList bnl, SortedMap<String, String> props) throws Exception {
|
||||
// setupHelp(); this is now done by DatabaseLayout
|
||||
|
@ -71,8 +73,8 @@ public abstract class VoiceImportComponent {
|
|||
/**
|
||||
* Initialise a voice import component: component specific initialisation; to be overwritten by subclasses
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
*/
|
||||
protected void initialiseComp() throws Exception {
|
||||
}
|
||||
|
@ -80,6 +82,8 @@ public abstract class VoiceImportComponent {
|
|||
/**
|
||||
* Get the map of properties2values containing the default values
|
||||
*
|
||||
* @param db
|
||||
* db
|
||||
* @return map of props2values
|
||||
*/
|
||||
public abstract SortedMap<String, String> getDefaultProps(DatabaseLayout db);
|
||||
|
@ -117,6 +121,8 @@ public abstract class VoiceImportComponent {
|
|||
/**
|
||||
* Do the computations required by this component.
|
||||
*
|
||||
* @throws Exception
|
||||
* Exception
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
public abstract boolean compute() throws Exception;
|
||||
|
|
|
@ -70,6 +70,8 @@ public class VoiceQualityTimelineMaker extends AbstractTimelineMaker {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
* @return header string
|
||||
*/
|
||||
@Override
|
||||
|
@ -117,6 +119,9 @@ public class VoiceQualityTimelineMaker extends AbstractTimelineMaker {
|
|||
|
||||
/**
|
||||
* load the file
|
||||
*
|
||||
* @param file
|
||||
* file
|
||||
*/
|
||||
@Override
|
||||
protected void load(File file) {
|
||||
|
|
|
@ -188,7 +188,7 @@ public class WavReader {
|
|||
* a String containing the ascii characters you want the <code>dis</code> to contain.
|
||||
*
|
||||
* @return <code>true</code> if <code>chars</code> appears next in <code>dis</code>, else <code>false</code>
|
||||
* @throws on
|
||||
* @throws IOException
|
||||
* ill-formatted input (end of file, for example)
|
||||
*/
|
||||
private boolean checkChars(DataInputStream dis, String chars) throws IOException {
|
||||
|
@ -219,7 +219,7 @@ public class WavReader {
|
|||
return numSamples;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Get the sample data of this wave
|
||||
*
|
||||
* @return samples
|
||||
|
|
|
@ -80,6 +80,7 @@ public class BasenameClassificationDefinitionFileReader {
|
|||
* @param filename
|
||||
* as a String
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public BasenameClassificationDefinitionFileReader(String filename) throws IOException {
|
||||
this(new FileReader(filename));
|
||||
|
@ -91,6 +92,7 @@ public class BasenameClassificationDefinitionFileReader {
|
|||
* @param reader
|
||||
* as a Reader
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public BasenameClassificationDefinitionFileReader(Reader reader) throws IOException {
|
||||
this.reader = new BufferedReader(reader);
|
||||
|
@ -102,6 +104,7 @@ public class BasenameClassificationDefinitionFileReader {
|
|||
* in styleDefinitions
|
||||
*
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private void parseDefinitionFile() throws IOException {
|
||||
String line;
|
||||
|
@ -148,6 +151,7 @@ public class BasenameClassificationDefinitionFileReader {
|
|||
* match basename against the glob expressions in styleDefinitions
|
||||
*
|
||||
* @param basename
|
||||
* basename
|
||||
* @return style String of first matching glob expression, or empty String if no glob matches
|
||||
*/
|
||||
public String getValue(String basename) {
|
||||
|
|
|
@ -40,7 +40,9 @@ public class VocalisationLabelInspector {
|
|||
/**
|
||||
*
|
||||
* @param inLocation
|
||||
* inLocation
|
||||
* @param outLocation
|
||||
* outLocation
|
||||
*/
|
||||
public VocalisationLabelInspector(String inLocation, String outLocation) {
|
||||
this.inLocation = inLocation;
|
||||
|
@ -138,6 +140,7 @@ public class VocalisationLabelInspector {
|
|||
/**
|
||||
*
|
||||
* @param vocalLabels
|
||||
* vocalLabels
|
||||
* @return 0.0
|
||||
*/
|
||||
private double getStartPauseDuration(UnitLabel[] vocalLabels) {
|
||||
|
@ -161,6 +164,7 @@ public class VocalisationLabelInspector {
|
|||
/**
|
||||
*
|
||||
* @param vocalLabels
|
||||
* vocalLabels
|
||||
* @return 0.0
|
||||
*/
|
||||
private double getEndPauseDuration(UnitLabel[] vocalLabels) {
|
||||
|
@ -185,6 +189,7 @@ public class VocalisationLabelInspector {
|
|||
/**
|
||||
*
|
||||
* @param vocalLabels
|
||||
* vocalLabels
|
||||
* @return 0.0
|
||||
*/
|
||||
private double getStartTimeStamp(UnitLabel[] vocalLabels) {
|
||||
|
@ -208,6 +213,7 @@ public class VocalisationLabelInspector {
|
|||
/**
|
||||
*
|
||||
* @param vocalLabels
|
||||
* vocalLabels
|
||||
* @return vocalLabels[vocalLabels.length -1].endTime
|
||||
*/
|
||||
private double getEndTimeStamp(UnitLabel[] vocalLabels) {
|
||||
|
@ -231,7 +237,9 @@ public class VocalisationLabelInspector {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
||||
|
|
|
@ -63,7 +63,9 @@ public class VocalizationAnnotationReader {
|
|||
/**
|
||||
*
|
||||
* @param featureFile
|
||||
* featureFile
|
||||
* @throws IOException
|
||||
* IOException
|
||||
*/
|
||||
private void formatChecker(String featureFile) throws IOException {
|
||||
BufferedReader bfrMean = new BufferedReader(new FileReader(new File(featureFile)));
|
||||
|
@ -120,6 +122,7 @@ public class VocalizationAnnotationReader {
|
|||
|
||||
/**
|
||||
* @param args
|
||||
* args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче