Ejemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private org.maltparser.parser.history.action.GuideUserAction predict() throws org.maltparser.core.exception.MaltChainedException
        private GuideUserAction predict()
        {
            currentAction.clear();
            try
            {
                manager.DecisionModel.predict(featureModel, currentAction, true);

                while (!transitionSystem.permissible(currentAction, config))
                {
                    if (manager.DecisionModel.predictFromKBestList(featureModel, currentAction) == false)
                    {
                        GuideUserAction   defaultAction    = transitionSystem.defaultAction(this, config);
                        ActionContainer[] actionContainers = ActionContainerArray;
                        defaultAction.getAction(actionContainers);
                        currentAction.addAction(actionContainers);
                        break;
                    }
                }
            }
            catch (System.NullReferenceException e)
            {
                throw new MaltChainedException("The guide cannot be found. ", e);
            }
            return(currentAction);
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void initWithDefaultTransitions(org.maltparser.parser.history.GuideUserHistory history) throws org.maltparser.core.exception.MaltChainedException
        protected internal override void initWithDefaultTransitions(GuideUserHistory history)
        {
            GuideUserAction currentAction = new ComplexDecisionAction(history);

            transActionContainer.Action = SHIFT;
            for (int i = 0; i < arcLabelActionContainers.Length; i++)
            {
                arcLabelActionContainers[i].Action = -1;
            }
            currentAction.addAction(actionContainers);
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void initWithDefaultTransitions(org.maltparser.parser.history.GuideUserHistory history) throws org.maltparser.core.exception.MaltChainedException
        protected internal override void initWithDefaultTransitions(GuideUserHistory history)
        {
            GuideUserAction currentAction = new ComplexDecisionAction(history);

            transActionContainer.Action = SHIFT;
            transActionContainer.Action = REDUCE;
            transActionContainer.Action = SWITCH;             //TODO it seems like a good idea to do this, but I don't know what it actually does
            transActionContainer.Action = REDUCEBOTH;         //TODO same as above
            for (int i = 0; i < arcLabelActionContainers.Length; i++)
            {
                arcLabelActionContainers[i].Action = -1;
            }
            currentAction.addAction(actionContainers);
        }