Package net.sourceforge.chaperon.process

Examples of net.sourceforge.chaperon.process.LexicalAutomaton


    Violations violations = lexicon.validate();

    if ((violations!=null) && (violations.getViolationCount()>0))
      throw new IllegalArgumentException("Lexicon is not valid: "+violations.getViolation(0));

    LexicalAutomaton automaton = new LexicalAutomaton(lexicon.getLexemeCount());

    Lexeme lexeme;
    PatternAutomaton definition = null;

    for (int i = 0; i<lexicon.getLexemeCount(); i++)
    {
      lexeme = lexicon.getLexeme(i);
      automaton.setLexemeSymbol(i, (lexeme.getSymbol()!=null) ? lexeme.getSymbol().getName() : null);

      definition = (new PatternAutomatonBuilder(lexeme.getDefinition())).getPatternAutomaton();
      if (definition!=null)
        automaton.setLexemeDefinition(i, definition);
      else
        throw new IllegalArgumentException("Couldn't create PatternAutomaton for "+
                                           lexeme.getSymbol()+" of \""+lexeme.getDefinition()+"\"");
    }
View Full Code Here


    xmlparser.parse(lexiconFile.toString());

    Lexicon lexicon = lexiconfactory.getLexicon();

    // Build a automaton from the lexicon model
    LexicalAutomaton lexicalautomaton =
      (new LexicalAutomatonBuilder(lexicon, log)).getLexicalAutomaton();

    // Create a processor for the lexicon
    LexicalProcessor lexer = new LexicalProcessor();
    lexer.setLog(log);
View Full Code Here

        Lexicon lexicon = factory.getLexicon();

        LexicalAutomatonBuilder builder =
          new LexicalAutomatonBuilder(lexicon/*, new AvalonLogger(this.logger)*/);

        LexicalAutomaton automaton = builder.getLexicalAutomaton();
        setLexicalAutomaton(automaton);

        this.logger.info("Store automaton into store for '"+this.lexiconSource.getURI()+"'");

        store.store(this.lexiconSource.getURI(),
View Full Code Here

        Lexicon lexicon = factory.getLexicon();

        LexicalAutomatonBuilder builder =
          new LexicalAutomatonBuilder(lexicon/*, new AvalonLogger(this.logger)*/);

        LexicalAutomaton automaton = builder.getLexicalAutomaton();
        setLexicalAutomaton(automaton);

        this.logger.info("Store automaton into store for '"+this.lexiconSource.getURI()+"'");

        store.store(this.lexiconSource.getURI(),
View Full Code Here

        Lexicon lexicon = factory.getLexicon();

        LexicalAutomatonBuilder builder =
          new LexicalAutomatonBuilder(lexicon/*, new AvalonLogger(this.logger)*/);

        LexicalAutomaton automaton = builder.getLexicalAutomaton();
        setLexicalAutomaton(automaton);

        this.logger.info("Store automaton into store for '"+this.lexiconSource.getURI()+"'");

        store.store(this.lexiconSource.getURI(),
View Full Code Here

        Lexicon lexicon = factory.getLexicon();

        LexicalAutomatonBuilder builder =
          new LexicalAutomatonBuilder(lexicon/*, new AvalonLogger(this.logger)*/);

        LexicalAutomaton automaton = builder.getLexicalAutomaton();
        setLexicalAutomaton(automaton);

        this.logger.info("Store automaton into store for '"+this.lexiconSource.getURI()+"'");

        store.store(this.lexiconSource.getURI(),
View Full Code Here

        Lexicon lexicon = factory.getLexicon();

        LexicalAutomatonBuilder builder =
          new LexicalAutomatonBuilder(lexicon/*, new AvalonLogger(this.logger)*/);

        LexicalAutomaton automaton = builder.getLexicalAutomaton();
        setLexicalAutomaton(automaton);

        this.logger.info("Store automaton into store for '"+this.lexiconSource.getURI()+"'");

        store.store(this.lexiconSource.getURI(),
View Full Code Here

TOP

Related Classes of net.sourceforge.chaperon.process.LexicalAutomaton

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.