Package com.sun.speech.freetts.lexicon

Examples of com.sun.speech.freetts.lexicon.LexiconImpl


     * -showtimes
     *
     * </pre>
     */
    public static void main(String[] args) {
  LexiconImpl lex, lex2;
  boolean showTimes = false;
        String srcPath = ".";
        String destPath = ".";
  String baseName = "germanlex";

  try {
      if (args.length > 0) {
    BulkTimer.LOAD.start();
    for (int i = 0 ; i < args.length; i++) {
                    if (args[i].equals("-src")) {
                        srcPath = args[++i];
                    } else if (args[i].equals("-dest")) {
                        destPath = args[++i];
        } else if (args[i].equals("-name")
                               && i < args.length - 1) {
      baseName = args[++i];
        } else if (args[i].equals("-generate_binary")) {

       System.out.println("Loading " + baseName);
                         String path = "file:" + srcPath + "/" + baseName;
                         lex = new GermanLexicon(
                             new URL(path + "_compiled.txt"),
                             new URL(path + "_addenda.txt"),
                             new URL(path + "_lts.txt"),
                             false);
       BulkTimer.LOAD.start("load_text");
                         lex.load();
       BulkTimer.LOAD.stop("load_text");

       System.out.println("Dumping " + baseName);
       BulkTimer.LOAD.start("dump_text");
       lex.dumpBinary(destPath + "/" + baseName);
       BulkTimer.LOAD.stop("dump_text");

        } else if (args[i].equals("-compare")) {

      BulkTimer.LOAD.start("load_text");
      lex = GermanLexicon.getInstance(baseName, false);
      BulkTimer.LOAD.stop("load_text");

      BulkTimer.LOAD.start("load_binary");
      lex2 = GermanLexicon.getInstance(baseName, true);
      BulkTimer.LOAD.stop("load_binary");

      BulkTimer.LOAD.start("compare");
      lex.compare(lex2);
      BulkTimer.LOAD.stop("compare");
        } else if (args[i].equals("-showtimes")) {
      showTimes = true;
        } else {
      System.out.println("Unknown option " + args[i]);
View Full Code Here


     * -showtimes
     *
     * </pre>
     */
    public static void main(String[] args) {
  LexiconImpl lex, lex2;
  boolean showTimes = false;
        String srcPath = ".";
        String destPath = ".";
  String baseName = "cmulex";

  try {
      if (args.length > 0) {
    BulkTimer.LOAD.start();
    for (int i = 0 ; i < args.length; i++) {
                    if (args[i].equals("-src")) {
                        srcPath = args[++i];
                    } else if (args[i].equals("-dest")) {
                        destPath = args[++i];
        } else if (args[i].equals("-name")
                               && i < args.length - 1) {
      baseName = args[++i];
        } else if (args[i].equals("-generate_binary")) {

       System.out.println("Loading " + baseName);
                         String path = "file:" + srcPath + "/" + baseName;
                         lex = new CMULexicon(
                             new URL(path + "_compiled.txt"),
                             new URL(path + "_addenda.txt"),
                             new URL(path + "_lts.txt"),
                             false);
       BulkTimer.LOAD.start("load_text");
                         lex.load();
       BulkTimer.LOAD.stop("load_text");

       System.out.println("Dumping " + baseName);
       BulkTimer.LOAD.start("dump_text");
       lex.dumpBinary(destPath + "/" + baseName);
       BulkTimer.LOAD.stop("dump_text");

        } else if (args[i].equals("-compare")) {

      BulkTimer.LOAD.start("load_text");
      lex = CMULexicon.getInstance(baseName, false);
      BulkTimer.LOAD.stop("load_text");

      BulkTimer.LOAD.start("load_binary");
      lex2 = CMULexicon.getInstance(baseName, true);
      BulkTimer.LOAD.stop("load_binary");

      BulkTimer.LOAD.start("compare");
      lex.compare(lex2);
      BulkTimer.LOAD.stop("compare");
        } else if (args[i].equals("-showtimes")) {
      showTimes = true;
        } else {
      System.out.println("Unknown option " + args[i]);
View Full Code Here

TOP

Related Classes of com.sun.speech.freetts.lexicon.LexiconImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.