src/main/java/de/dfki/lt/loot/fsa/FiniteAutomatonTest.java
public static void main(String[] args) throws IOException {

    // define test regular expressions
    String[] testRegExps = {
      "X*|Y", "(X*|Y)", "A*BA", "ABA*", "(A|B)", "ABAB(X*|Y)*", "X|Y*",
      "(AX|BY)*", "((AX)|BY)*", "([a-c]a[a-c])*",
      "(xy|yx)*b"
    };

    if (args.length > 0) {
      testRegExps = args;
    }
    for (int i = 0; i < testRegExps.length; i++) {
      // init automaton
      CharFsa automaton = CharFsa.compileRegex(testRegExps[i]);
      // process regex
      if (automaton != null) {
        // show result automaton
        //System.out.println(automaton);
        printGraph(automaton, i + "-0.dot");

        // determinize automaton
        CharFsa detAutomaton = automaton.determinize();
        // show determinized automaton
        //System.out.println(detAutomaton);
        // print determinized automaton in VCG format
        printGraph(detAutomaton, i + "-1det.dot");

        // minimize automaton (Hopcroft)
        Minimization.minimize(detAutomaton, detAutomaton._comp);
        // show minimized automaton
        //System.out.println(detAutomaton);
        // print minimized automaton in VCG format
        printGraph(detAutomaton, i + "-2min.dot");

        detAutomaton = CharFsa.compileRegex(testRegExps[i]).determinize();
        // minimize automaton
        MinimizationBrzowski.minimize(detAutomaton, detAutomaton._comp);
        // show minimized automaton
        //System.out.println(detAutomaton);
        // print minimized automaton in VCG format
        printGraph(detAutomaton, i + "-3min.dot");

        /*
        // compact automaton
        detAutomaton.compact();
        // show minimized automaton
        //System.out.println(detAutomaton);
        // print minimized automaton in VCG format
        detAutomaton.printGraph(i + "-3cpt.dot");
        */
      }
    }
  }
/**
   * This is the main method. It requires no argument
   *
   * @param args an array of <code>String</code>s with the arguments;
   * not used here
   */
This is the main method. It requires no argument
@param args an array of Strings with the arguments;
not used here
This is the main method . It requires no argument @param args an array of Strings with the arguments ; not used here
public static void main(String[] args) throws IOException {
    String[] testRegExps = {
      "X*|Y", "(X*|Y)", "A*BA", "ABA*", "(A|B)", "ABAB(X*|Y)*", "X|Y*",
      "(AX|BY)*", "((AX)|BY)*", "([a-c]a[a-c])*",
      "(xy|yx)*b"
    };
    if (args.length > 0) {
      testRegExps = args;
    }
    for (int i = 0; i < testRegExps.length; i++) {
      CharFsa automaton = CharFsa.compileRegex(testRegExps[i]);
      if (automaton != null) {
        printGraph(automaton, i + "-0.dot");
        CharFsa detAutomaton = automaton.determinize();
        printGraph(detAutomaton, i + "-1det.dot");
        Minimization.minimize(detAutomaton, detAutomaton._comp);
        printGraph(detAutomaton, i + "-2min.dot");
        detAutomaton = CharFsa.compileRegex(testRegExps[i]).determinize();
        MinimizationBrzowski.minimize(detAutomaton, detAutomaton._comp);
        printGraph(detAutomaton, i + "-3min.dot");
        /*
        // compact automaton
        detAutomaton.compact();
        detAutomaton.printGraph(i + "-3cpt.dot");
        */
      }
    }
  }
public static void main ( String [ ] args ) throws IOException { String [ ] testRegExps = { "X*|Y" , "(X*|Y)" , "A*BA" , "ABA*" , "(A|B)" , "ABAB(X*|Y)*" , "X|Y*" , "(AX|BY)*" , "((AX)|BY)*" , "([a-c]a[a-c])*" , "(xy|yx)*b" } ; if ( args . length > 0 ) { testRegExps = args ; } for ( int i = 0 ; i < testRegExps . length ; i ++ ) { CharFsa automaton = CharFsa . compileRegex ( testRegExps [ i ] ) ; if ( automaton != null ) { printGraph ( automaton , i + "-0.dot" ) ; CharFsa detAutomaton = automaton . determinize ( ) ; printGraph ( detAutomaton , i + "-1det.dot" ) ; Minimization . minimize ( detAutomaton , detAutomaton . _comp ) ; printGraph ( detAutomaton , i + "-2min.dot" ) ; detAutomaton = CharFsa . compileRegex ( testRegExps [ i ] ) . determinize ( ) ; MinimizationBrzowski . minimize ( detAutomaton , detAutomaton . _comp ) ; printGraph ( detAutomaton , i + "-3min.dot" ) ; /*
        // compact automaton
        detAutomaton.compact();
        // show minimized automaton
        //System.out.println(detAutomaton);
        // print minimized automaton in VCG format
        detAutomaton.printGraph(i + "-3cpt.dot");
        */ } } }
This is the main method.
This is the main method .
// define test regular expressions // init automaton // process regex // show result automaton //System.out.println(automaton); // determinize automaton // show determinized automaton //System.out.println(detAutomaton); // print determinized automaton in VCG format // minimize automaton (Hopcroft) // show minimized automaton //System.out.println(detAutomaton); // print minimized automaton in VCG format // minimize automaton // show minimized automaton //System.out.println(detAutomaton); // print minimized automaton in VCG format