src/main/java/de/dfki/lt/loot/fsa/CharFsa.java
public static CharFsa readLexiconAutomaton(String filename)
    throws FileNotFoundException, IOException {

    BufferedReader in =
      new BufferedReader(new InputStreamReader(new FileInputStream(filename),
                                               "ISO-8859-1"));
    CharFsa result = new CharFsa();
    result.setInitialState(result.newVertex());
    String line = null;
    while ((line = in.readLine()) != null) {
      result.addWord(line);
    }
    in.close();
    System.out.println(result.getNumberOfVertices() + " Zustände");
    return result;
  }
/** Build an nondeterministic Automaton from a list of words */
Build an nondeterministic Automaton from a list of words
Build an nondeterministic Automaton from a list of words
public static CharFsa readLexiconAutomaton(String filename)
    throws FileNotFoundException, IOException {
    BufferedReader in =
      new BufferedReader(new InputStreamReader(new FileInputStream(filename),
                                               "ISO-8859-1"));
    CharFsa result = new CharFsa();
    result.setInitialState(result.newVertex());
    String line = null;
    while ((line = in.readLine()) != null) {
      result.addWord(line);
    }
    in.close();
    System.out.println(result.getNumberOfVertices() + " Zustände");
    return result;
  }
public static CharFsa readLexiconAutomaton ( String filename ) throws FileNotFoundException , IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( new FileInputStream ( filename ) , "ISO-8859-1" ) ) ; CharFsa result = new CharFsa ( ) ; result . setInitialState ( result . newVertex ( ) ) ; String line = null ; while ( ( line = in . readLine ( ) ) != null ) { result . addWord ( line ) ; } in . close ( ) ; System . out . println ( result . getNumberOfVertices ( ) + " Zustände") ; return result ; }
Build an nondeterministic Automaton from a list of words
Build an nondeterministic Automaton from a list of words