//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.maltparser.core.syntaxgraph.DependencyStructure parse(org.maltparser.core.syntaxgraph.DependencyStructure parseDependencyGraph) throws org.maltparser.core.exception.MaltChainedException
        public override IDependencyStructure Parse(IDependencyStructure parseDependencyGraph)
        {
            parserState.clear();
            parserState.initialize(parseDependencyGraph);
            currentParserConfiguration = parserState.Configuration;
            parseCount++;

            diagnostics.writeToDiaFile(parseCount + "");
            while (!parserState.TerminalState)
            {
                GuideUserAction action = parserState.TransitionSystem.getDeterministicAction(parserState.History, currentParserConfiguration);
                if (action == null)
                {
                    action = predict();
                }
                else
                {
                    diagnostics.writeToDiaFile(" *");
                }

                diagnostics.writeToDiaFile(" " + parserState.TransitionSystem.getActionString(action));

                parserState.apply(action);
            }
            CopyEdges(currentParserConfiguration.DependencyGraph, parseDependencyGraph);
            CopyDynamicInput(currentParserConfiguration.DependencyGraph, parseDependencyGraph);
            parseDependencyGraph.LinkAllTreesToRoot();

            diagnostics.writeToDiaFile("\n");

            return(parseDependencyGraph);
        }
Пример #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.maltparser.core.syntaxgraph.DependencyStructure parse(org.maltparser.core.syntaxgraph.DependencyStructure goldDependencyGraph, org.maltparser.core.syntaxgraph.DependencyStructure parseDependencyGraph) throws org.maltparser.core.exception.MaltChainedException
        public override IDependencyStructure parse(IDependencyStructure goldDependencyGraph, IDependencyStructure parseDependencyGraph)
        {
            parserState.clear();
            parserState.initialize(parseDependencyGraph);
            currentParserConfiguration = parserState.Configuration;

            TransitionSystem transitionSystem = parserState.TransitionSystem;

            while (!parserState.TerminalState)
            {
                GuideUserAction action = transitionSystem.getDeterministicAction(parserState.History, currentParserConfiguration);
                if (action == null)
                {
                    action = oracleGuide.predict(goldDependencyGraph, currentParserConfiguration);
                    try
                    {
                        classifierGuide.addInstance(featureModel, (GuideDecision)action);
                    }
                    catch (System.NullReferenceException e)
                    {
                        throw new MaltChainedException("The guide cannot be found. ", e);
                    }
                }
                parserState.apply(action);
            }
            CopyEdges(currentParserConfiguration.DependencyGraph, parseDependencyGraph);
            parseDependencyGraph.LinkAllTreesToRoot();
            oracleGuide.finalizeSentence(parseDependencyGraph);
            return(parseDependencyGraph);
        }
Пример #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.maltparser.core.syntaxgraph.DependencyStructure parse(org.maltparser.core.syntaxgraph.DependencyStructure parseDependencyGraph) throws org.maltparser.core.exception.MaltChainedException
        public IDependencyStructure parse(IDependencyStructure parseDependencyGraph)
        {
            config.clear();
            config.DependencyGraph = parseDependencyGraph;
            config.initialize();

            while (!config.TerminalState)
            {
                GuideUserAction action = transitionSystem.getDeterministicAction(this, config);
                if (action == null)
                {
                    action = predict();
                }
                transitionSystem.apply(action, config);
            }
            parseDependencyGraph.LinkAllTreesToRoot();
            return(parseDependencyGraph);
        }
Пример #4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.maltparser.core.syntaxgraph.DependencyStructure parse(org.maltparser.core.syntaxgraph.DependencyStructure parseDependencyGraph) throws org.maltparser.core.exception.MaltChainedException
        public override IDependencyStructure Parse(IDependencyStructure parseDependencyGraph)
        {
            parserState.clear();
            parserState.initialize(parseDependencyGraph);
            currentParserConfiguration = parserState.Configuration;
            TransitionSystem ts = parserState.TransitionSystem;

            while (!parserState.TerminalState)
            {
                GuideUserAction action = ts.getDeterministicAction(parserState.History, currentParserConfiguration);
                if (action == null)
                {
                    action = predict();
                }
                parserState.apply(action);
            }
            //		copyEdges(currentParserConfiguration.getDependencyGraph(), parseDependencyGraph);
            //		copyDynamicInput(currentParserConfiguration.getDependencyGraph(), parseDependencyGraph);
            parseDependencyGraph.LinkAllTreesToRoot();
            return(parseDependencyGraph);
        }