Package com.sun.speech.freetts

Examples of com.sun.speech.freetts.Item


   *
   * @throws ProcessException if an exception occurred during the
   * processing
   */
  public String process(Item syl) throws ProcessException {
      Item ss = syl.getItemAs(Relation.SYLLABLE_STRUCTURE);
      if (ss == null) {
    return "1";
      } else if (ss.getNext() != null) {
    return "0";
      } else if (ss.getParent() == null) {
    return "1";
      } else {
    return wordBreak(ss.getParent());
      }
  }
View Full Code Here


   * @throws ProcessException if an exception occurred during the
   * processing
   */
  public String process(Item syl) throws ProcessException {
      int count = 0;
      Item daughter = syl.getItemAs(
                Relation.SYLLABLE_STRUCTURE).getDaughter();
      while (daughter != null) {
    if ("+".equals(getPhoneFeature(daughter, "vc"))) {
        break;
    }
    count++;
    daughter = daughter.getNext();
      }
      return Integer.toString(rail(count));
  }
View Full Code Here

   * @throws ProcessException if an exception occurred during the
   * processing
   */
  public String process(Item syl) throws ProcessException {
      int count = 0;
      Item daughter = syl.getItemAs(
                Relation.SYLLABLE_STRUCTURE).getLastDaughter();

      while (daughter != null) {
    if ("+".equals(getPhoneFeature(daughter, "vc"))) {
        break;
    }

    daughter = daughter.getPrevious();
    count++;
      }
      return Integer.toString(rail(count));
  }
View Full Code Here

  // parse out the prefix, e.g., "113" in "113,000"
  int i = numberDigits - numberZeroes;
  String part = numberString.substring(0, i);
   
  // get how many thousands/millions/billions
  Item oldTail = wordRelation.getTail();
 
  expandNumber(part, wordRelation);

  if (wordRelation.getTail() == oldTail) {
      expandNumberAt(numberString, i, wordRelation);
View Full Code Here

  String numberString = Utilities.deleteChar(rawNumberString, ',');
 
  expandNumber(numberString, wordRelation);

  // get the last in the list of number strings
  Item lastItem = wordRelation.getTail();

  if (lastItem != null) {

      FeatureSet featureSet = lastItem.getFeatures();
      String lastNumber = featureSet.getString("name");
      String ordinal = findMatchInArray(lastNumber, digit2num, ord2num);

      if (ordinal == null) {
    ordinal = findMatchInArray(lastNumber, digit2teen, ord2teen);
View Full Code Here

TOP

Related Classes of com.sun.speech.freetts.Item

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.