protected void correctStressSymbol(LinkedList<String> phoneList){
  boolean stressFound=false;
  ListIterator<String> it=phoneList.listIterator(0);
  while (it.hasNext()) {
    String s=it.next();
    if (s.endsWith("1")) {
      if (this.removeTrailingOneFromPhones) {
        it.set(s.substring(0,s.length() - 1));
      }
      if (!stressFound) {
        int steps=0;
        while (it.hasPrevious()) {
          steps++;
          String t=it.previous();
          if (t.equals("-") || t.equals("_")) {
            it.next();
            steps--;
            break;
          }
        }
        it.add("'");
        while (steps > 0) {
          it.next();
          steps--;
        }
        stressFound=true;
      }
    }
  }
  if (!stressFound) {
    it=phoneList.listIterator(0);
    while (it.hasNext()) {
      String s=it.next();
      Allophone ph=allophoneSet.getAllophone(s);
      if (ph != null && ph.sonority() >= 5) {
        int steps=0;
        while (it.hasPrevious()) {
          steps++;
          String t=it.previous();
          if (t.equals("-") || t.equals("_")) {
            it.next();
            steps--;
            break;
          }
        }
        it.add("'");
        while (steps > 0) {
          it.next();
          steps--;
        }
        break;
      }
    }
  }
}

protected void correctStressSymbol ( LinkedList < String > phoneList ) { boolean stressFound = false ; ListIterator < String > it = phoneList . listIterator ( 0 ) ; while ( it . hasNext ( ) ) { String s = it . next ( ) ; if ( s . endsWith ( "1" ) ) { if ( this . removeTrailingOneFromPhones ) { it . set ( s . substring ( 0 , s . length ( ) - 1 ) ) ; } if ( ! stressFound ) { int steps = 0 ; while ( it . hasPrevious ( ) ) { steps ++ ; String t = it . previous ( ) ; if ( t . equals ( "-" ) || t . equals ( "_" ) ) { it . next ( ) ; steps -- ; break ; } } it . add ( "'" ) ; while ( steps > 0 ) { it . next ( ) ; steps -- ; } stressFound = true ; } } } if ( ! stressFound ) { it = phoneList . listIterator ( 0 ) ; while ( it . hasNext ( ) ) { String s = it . next ( ) ; Allophone ph = allophoneSet . getAllophone ( s ) ; if ( ph != null && ph . sonority ( ) >= 5 ) { int steps = 0 ; while ( it . hasPrevious ( ) ) { steps ++ ; String t = it . previous ( ) ; if ( t . equals ( "-" ) || t . equals ( "_" ) ) { it . next ( ) ; steps -- ; break ; } } it . add ( "'" ) ; while ( steps > 0 ) { it . next ( ) ; steps -- ; } break ; } } } }
for those syllables containing a " 1 " character , remove that " 1 " character and add a stress marker ' at the beginning of the syllable .
