Package com.sun.speech.freetts

Examples of com.sun.speech.freetts.Item


     *
     * @throws ProcessException if an exception occurred during the
     * processing
     */
    public static String wordPunc(Item item) throws ProcessException {
  Item ww = item.getItemAs(Relation.TOKEN);
  if (ww != null && ww.getNext() != null) {
      return "";
  } else {
      if (ww != null && ww.getParent() != null) {
    return ww.getParent().getFeatures().getString("punc");
      } else {
    return "";
      }
  }
    }
View Full Code Here


     * @param ctype the ctype to check for
     *
     * @return "1" on match "0" on no match
     */
    private static String segCodaCtype(Item seg, String ctype) {
  Item daughter
      = seg.getItemAs(
    Relation.SYLLABLE_STRUCTURE).getParent().getLastDaughter();

  while (daughter != null) {
      if ("+".equals(getPhoneFeature(daughter, "vc"))) {
    return "0";
      }
      if (ctype.equals(getPhoneFeature(daughter, "ctype"))) {
    return "1";
      }

      daughter = daughter.getPrevious();
  }
  return "0";
    }
View Full Code Here

     *
     * @return if Onset Stop "1"; otherwise "0"
     *
     */
    private static  String segOnsetCtype(Item seg, String ctype) {
  Item daughter = seg.getItemAs(
      Relation.SYLLABLE_STRUCTURE).getParent().getDaughter();

  while (daughter != null) {
      if ("+".equals(getPhoneFeature(daughter, "vc"))) {
    return "0";
      }
      if (ctype.equals(getPhoneFeature(daughter, "ctype"))) {
    return "1";
      }

      daughter = daughter.getNext();
  }
  return "0";
    }
View Full Code Here

   * @throws ProcessException if an exception occurred during the
   * processing
   */
  public String process(Item item) throws ProcessException {
      int count = 0;
      Item daughter = item.getItemAs(
                Relation.SYLLABLE_STRUCTURE).getDaughter();
      while (daughter != null) {
    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 item) throws ProcessException {
      int count = 0;
      Item ss = item.getItemAs(Relation.SYLLABLE);
      Item firstSyllable  = FIRST_SYLLABLE_PATH.findItem(item);

      for (Item p = ss; p != null; p = p.getPrevious() )  {
    if (isAccented(p)) {
        count++;
    }
View Full Code Here

   * @throws ProcessException if an exception occurred during the
   * processing
   */
  public String process(Item item) throws ProcessException {
      int count = 0;
      Item ss = item.getItemAs(Relation.SYLLABLE);
      Item firstSyllable  = FIRST_SYLLABLE_PATH.findItem(item);

      // this should include the first syllable, but
      // flite 1.1 and festival don't.

      for (Item p = ss.getPrevious();
View Full Code Here

   * @throws ProcessException if an exception occurred during the
   * processing
   */
  public String process(Item item) throws ProcessException {
      int count = 0;
      Item ss = item.getItemAs(Relation.SYLLABLE);
      Item lastSyllable  = LAST_SYLLABLE_PATH.findItem(item);

      for (Item p = ss.getNext(); p != null; p = p.getNext() )  {
    if ("1".equals(p.getFeatures().getString("stress"))) {
        count++;
    }
View Full Code Here

   * processing
   */
  public String process(Item item) throws ProcessException {
      String type;

      Item s = item.getItemAs(Relation.SYLLABLE_STRUCTURE);
      if (s == null) {
    type = "single";
      } else if (s.getNext() == null) {
    if (s.getPrevious() == null) {
        type = "single";
    } else {
        type = "final";
    }
      } else if (s.getPrevious() == null) {
    type = "initial";
      } else {
    type = "mid";
      }
      return type;
View Full Code Here

   * @throws ProcessException if an exception occurred during the
   * processing
   */
  public String process(Item item) throws ProcessException {
      int count = 0;
      Item ss = item.getItemAs(Relation.SYLLABLE);
      Item firstSyllable  = FIRST_SYLLABLE_PATH.findItem(item);

      for (Item p = ss; p != null; p = p.getPrevious(), count++ )  {
    if (p.equalsShared(firstSyllable)) {
        break;
    }
View Full Code Here

   * @throws ProcessException if an exception occurred during the
   * processing
   */
  public String process(Item item) throws ProcessException {
      int count = 0;
      Item ss = item.getItemAs(Relation.SYLLABLE);
      Item firstSyllable  = LAST_LAST_SYLLABLE_PATH.findItem(item);

      for (Item p = ss; p != null; p = p.getNext() )  {
    if (p.equalsShared(firstSyllable)) {
        break;
    }
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.