public Alphabet(String alpha){
  boolean[] unicode=new boolean[Character.MAX_VALUE];
  for (int i=0; i < alpha.length(); i++) {
    char c=alpha.charAt(i);
    if (unicode[c])     throw new IllegalArgumentException("Illegal alphabet: repeated character = '" + c + "'");
    unicode[c]=true;
  }
  alphabet=alpha.toCharArray();
  R=alpha.length();
  inverse=new int[Character.MAX_VALUE];
  for (int i=0; i < inverse.length; i++)   inverse[i]=-1;
  for (int c=0; c < R; c++)   inverse[alphabet[c]]=c;
}

public Alphabet ( String alpha ) { boolean [ ] unicode = new boolean [ Character . MAX_VALUE ] ; for ( int i = 0 ; i < alpha . length ( ) ; i ++ ) { char c = alpha . charAt ( i ) ; if ( unicode [ c ] ) throw new IllegalArgumentException ( "Illegal alphabet: repeated character = '" + c + "'" ) ; unicode [ c ] = true ; } alphabet = alpha . toCharArray ( ) ; R = alpha . length ( ) ; inverse = new int [ Character . MAX_VALUE ] ; for ( int i = 0 ; i < inverse . length ; i ++ ) inverse [ i ] = - 1 ; for ( int c = 0 ; c < R ; c ++ ) inverse [ alphabet [ c ] ] = c ; }
initializes a new alphabet from the given set of characters .
