Package org.maltparserx.parser.algorithm.stack

Source Code of org.maltparserx.parser.algorithm.stack.StackSwapEagerFactory

package org.maltparserx.parser.algorithm.stack;

import org.maltparserx.core.exception.MaltChainedException;
import org.maltparserx.parser.Algorithm;
import org.maltparserx.parser.TransitionSystem;
import org.maltparserx.parser.guide.OracleGuide;
import org.maltparserx.parser.history.GuideUserHistory;
/**
* @author Johan Hall
*
*/
public class StackSwapEagerFactory extends StackFactory {
  public StackSwapEagerFactory(Algorithm algorithm) {
    super(algorithm);
  }
 
  public TransitionSystem makeTransitionSystem() throws MaltChainedException {
    if (manager.getConfigLogger().isInfoEnabled()) {
      manager.getConfigLogger().info("  Transition system    : Non-Projective\n");
    }
    TransitionSystem ts = new NonProjective();
    ts.setPropagationManager(manager.getPropagationManager());
    return ts;
  }
 
  public OracleGuide makeOracleGuide(GuideUserHistory history) throws MaltChainedException {
    if (manager.getConfigLogger().isInfoEnabled()) {
      manager.getConfigLogger().info("  Oracle               : Swap-Eager\n");
    }
    return new SwapEagerOracle(manager, history);
  }
}
TOP

Related Classes of org.maltparserx.parser.algorithm.stack.StackSwapEagerFactory

TOP
Copyright © 2018 www.massapi.com. 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.