src/main/java/de/dfki/lt/loot/fsa/FiniteAutomaton.java
public SubAutomaton multiAlternative(Collection<SubAutomaton> alternatives) {
    if (alternatives.isEmpty()) {
      throw new IllegalArgumentException("alternatives list may not be empty");
    }
    // the result automaton will be created by modifying the first automaton
    // in the collection

    // created new initial and final state
    int newInitialState = this.newVertex();
    int newFinalState = this.newVertex();

    SubAutomaton result = null;
    // link states according to slides
    for (SubAutomaton alternative : alternatives) {
      this.newEdge(EPSILON, newInitialState, alternative.getInitialState());
      this.newEdge(EPSILON, alternative.getFinalState(), newFinalState);
      if (result == null) {
        result = alternative;
        alternative.setInitialState(newInitialState);
        alternative.setFinalState(newFinalState);
      } else {
        alternative.setInitialState(-1);
        alternative.setFinalState(-1);
      }
    }
    return result;
  }
/**
   * This creates an automaton that matches the `or' of the language of each
   * of the subautomata in the list, which may not be empty.
   *
   * The current automaton is modified so that the first automaton in the list
   * contains the result after calling this method.
   *
   * @param alternatives a list of <code>SubAutomaton</code> for which we
   *        return an n-ary alternative
   */
This creates an automaton that matches the `or' of the language of each
of the subautomata in the list, which may not be empty.

The current automaton is modified so that the first automaton in the list
contains the result after calling this method.

@param alternatives a list of SubAutomaton for which we
return an n-ary alternative
This creates an automaton that matches the ` or ' of the language of each of the subautomata in the list which may not be empty . The current automaton is modified so that the first automaton in the list contains the result after calling this method . @param alternatives a list of SubAutomaton for which we return an n - ary alternative
public SubAutomaton multiAlternative(Collection<SubAutomaton> alternatives) {
    if (alternatives.isEmpty()) {
      throw new IllegalArgumentException("alternatives list may not be empty");
    }
    int newInitialState = this.newVertex();
    int newFinalState = this.newVertex();
    SubAutomaton result = null;
    for (SubAutomaton alternative : alternatives) {
      this.newEdge(EPSILON, newInitialState, alternative.getInitialState());
      this.newEdge(EPSILON, alternative.getFinalState(), newFinalState);
      if (result == null) {
        result = alternative;
        alternative.setInitialState(newInitialState);
        alternative.setFinalState(newFinalState);
      } else {
        alternative.setInitialState(-1);
        alternative.setFinalState(-1);
      }
    }
    return result;
  }
public SubAutomaton multiAlternative ( Collection < SubAutomaton > alternatives ) { if ( alternatives . isEmpty ( ) ) { throw new IllegalArgumentException ( "alternatives list may not be empty" ) ; } int newInitialState = this . newVertex ( ) ; int newFinalState = this . newVertex ( ) ; SubAutomaton result = null ; for ( SubAutomaton alternative : alternatives ) { this . newEdge ( EPSILON , newInitialState , alternative . getInitialState ( ) ) ; this . newEdge ( EPSILON , alternative . getFinalState ( ) , newFinalState ) ; if ( result == null ) { result = alternative ; alternative . setInitialState ( newInitialState ) ; alternative . setFinalState ( newFinalState ) ; } else { alternative . setInitialState ( - 1 ) ; alternative . setFinalState ( - 1 ) ; } } return result ; }
This creates an automaton that matches the `or' of the language of each
 of the subautomata in the list, which may not be empty.
This creates an automaton that matches the ` or ' of the language of each of the subautomata in the list which may not be empty .
// the result automaton will be created by modifying the first automaton // in the collection // created new initial and final state // link states according to slides