src/main/java/de/dfki/lt/loot/fsa/FiniteAutomaton.java
public SubAutomaton plus(SubAutomaton sub) {

    // create new initial and final states
    int newInitialState = this.newVertex();
    int newFinalState = this.newVertex();

    // connect the old final state to the old initial state and the new final
    // state with epsilon transitions
    newEdge(EPSILON, sub.getFinalState(), sub.getInitialState());
    newEdge(EPSILON, sub.getFinalState(), newFinalState);

    // connect the new initial state to the former initial state
    newEdge(EPSILON, newInitialState, sub.getInitialState());

    // update initial state and final state
    sub.setInitialState(newInitialState);
    sub.setFinalState(newFinalState);

    return sub;
  }
/**
   * Modifies the given subautomaton in a way that it matches an arbitrary
   * number (excluding zero) of the char sequences it matches now.
   *
   * @param sub
   *          a subautomaton to wrap with a plus
   * @return the modified subautomaton with the plus
   */
Modifies the given subautomaton in a way that it matches an arbitrary
number (excluding zero) of the char sequences it matches now.

@param sub
a subautomaton to wrap with a plus
@return the modified subautomaton with the plus
Modifies the given subautomaton in a way that it matches an arbitrary number ( excluding zero ) of the char sequences it matches now . @param sub a subautomaton to wrap with a plus @return the modified subautomaton with the plus
public SubAutomaton plus(SubAutomaton sub) {
    int newInitialState = this.newVertex();
    int newFinalState = this.newVertex();
    newEdge(EPSILON, sub.getFinalState(), sub.getInitialState());
    newEdge(EPSILON, sub.getFinalState(), newFinalState);
    newEdge(EPSILON, newInitialState, sub.getInitialState());
    sub.setInitialState(newInitialState);
    sub.setFinalState(newFinalState);
    return sub;
  }
public SubAutomaton plus ( SubAutomaton sub ) { int newInitialState = this . newVertex ( ) ; int newFinalState = this . newVertex ( ) ; newEdge ( EPSILON , sub . getFinalState ( ) , sub . getInitialState ( ) ) ; newEdge ( EPSILON , sub . getFinalState ( ) , newFinalState ) ; newEdge ( EPSILON , newInitialState , sub . getInitialState ( ) ) ; sub . setInitialState ( newInitialState ) ; sub . setFinalState ( newFinalState ) ; return sub ; }
Modifies the given subautomaton in a way that it matches an arbitrary
 number (excluding zero) of the char sequences it matches now.
Modifies the given subautomaton in a way that it matches an arbitrary number ( excluding zero ) of the char sequences it matches now .
// create new initial and final states // connect the old final state to the old initial state and the new final // state with epsilon transitions // connect the new initial state to the former initial state // update initial state and final state