Пример #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.maltparser.parser.ParserConfiguration makeParserConfiguration() throws org.maltparser.core.exception.MaltChainedException
        public virtual ParserConfiguration makeParserConfiguration()
        {
            bool allowRoot   = (bool?)manager.getOptionValue("nivre", "allow_root").Value;
            bool allowReduce = (bool?)manager.getOptionValue("nivre", "allow_reduce").Value;
            bool enforceTree = (bool?)manager.getOptionValue("nivre", "enforce_tree") && manager.getOptionValueString("config", "flowchart").Equals("parse");

            if (manager.LoggerInfoEnabled)
            {
                manager.logInfoMessage("  Parser configuration : Nivre with allow_root=" + allowRoot + ", allow_reduce=" + allowReduce + " and enforce_tree=" + enforceTree + "\n");
            }
            return(new NivreConfig(allowRoot, allowReduce, enforceTree));
        }
Пример #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.maltparser.parser.ParserConfiguration makeParserConfiguration() throws org.maltparser.core.exception.MaltChainedException
        public virtual ParserConfiguration makeParserConfiguration()
        {
            bool allowRoot  = (bool?)manager.getOptionValue("covington", "allow_root").Value;
            bool allowShift = (bool?)manager.getOptionValue("covington", "allow_shift").Value;

            if (manager.LoggerInfoEnabled)
            {
                manager.logInfoMessage("  Parser configuration : Covington with allow_root=" + allowRoot + " and allow_shift=" + allowShift + "\n");
            }
            CovingtonConfig config = new CovingtonConfig(allowRoot, allowShift);

            return(config);
        }
Пример #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public ParserState(DependencyParserConfig manager, org.maltparser.core.symbol.SymbolTableHandler symbolTableHandler, AbstractParserFactory factory) throws org.maltparser.core.exception.MaltChainedException
        public ParserState(IDependencyParserConfig manager, SymbolTableHandler symbolTableHandler, AbstractParserFactory factory)
        {
            this.factory     = factory;
            historyStructure = new HistoryList();
            transitionSystem = factory.makeTransitionSystem();
            string decisionSettings = manager.getOptionValue("guide", "decision_settings").ToString().Trim();

            TransitionSystem.initTableHandlers(decisionSettings, symbolTableHandler);
            int    kBestSize           = ((int?)manager.getOptionValue("guide", "kbest")).Value;
            string classitem_separator = manager.getOptionValue("guide", "classitem_separator").ToString();

            history = new History.History(decisionSettings, classitem_separator, TransitionSystem.TableHandlers, kBestSize);
            TransitionSystem.initTransitionSystem(history);
            config = factory.makeParserConfiguration();
        }
Пример #4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public DeterministicParser(DependencyParserConfig manager, org.maltparser.core.symbol.SymbolTableHandler symbolTableHandler) throws org.maltparser.core.exception.MaltChainedException
        public DeterministicParser(IDependencyParserConfig manager, SymbolTableHandler symbolTableHandler) : base(manager, symbolTableHandler)
        {
            registry.Algorithm = this;
            Guide = new SingleGuide(this, ClassifierGuide_GuideMode.CLASSIFY);
            string featureModelFileName = manager.getOptionValue("guide", "features").ToString().Trim();

            if (manager.LoggerInfoEnabled)
            {
                manager.logDebugMessage("  Feature model        : " + featureModelFileName + "\n");
                manager.logDebugMessage("  Classifier           : " + manager.getOptionValueString("guide", "learner") + "\n");
            }
            string dataSplitColumn    = manager.getOptionValue("guide", "data_split_column").ToString().Trim();
            string dataSplitStructure = manager.getOptionValue("guide", "data_split_structure").ToString().Trim();

            featureModel = manager.FeatureModelManager.getFeatureModel(SingleGuide.findURL(featureModelFileName, manager), 0, ParserRegistry, dataSplitColumn, dataSplitStructure);
        }
Пример #5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.maltparser.parser.ParserConfiguration makeParserConfiguration() throws org.maltparser.core.exception.MaltChainedException
        public virtual ParserConfiguration makeParserConfiguration()
        {
            if (manager.LoggerInfoEnabled)
            {
                manager.logInfoMessage("  Parser configuration : Two-Planar with no_covered_roots = " + manager.getOptionValue("planar", "no_covered_roots").ToString().ToUpper() + ", " + "acyclicity = " + manager.getOptionValue("planar", "acyclicity").ToString().ToUpper() + ", planar root handling = " + manager.getOptionValue("2planar", "planar_root_handling").ToString().ToUpper() + ", reduce on switch = " + manager.getOptionValue("2planar", "reduceonswitch").ToString().ToUpper() + "\n");
            }
            return(new TwoPlanarConfig(manager.getOptionValue("planar", "no_covered_roots").ToString(), manager.getOptionValue("planar", "acyclicity").ToString(), manager.getOptionValue("2planar", "reduceonswitch").ToString(), manager.getOptionValue("multiplanar", "planar_root_handling").ToString()));
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public BatchTrainerWithDiagnostics(DependencyParserConfig manager, org.maltparser.core.symbol.SymbolTableHandler symbolTableHandler) throws org.maltparser.core.exception.MaltChainedException
        public BatchTrainerWithDiagnostics(IDependencyParserConfig manager, SymbolTableHandler symbolTableHandler) : base(manager, symbolTableHandler)
        {
            diagnostics        = new Diagnostics(manager.getOptionValue("singlemalt", "diafile").ToString());
            registry.Algorithm = this;
            Guide = new SingleGuide(this, ClassifierGuide_GuideMode.BATCH);
            string featureModelFileName = manager.getOptionValue("guide", "features").ToString().Trim();

            if (manager.LoggerInfoEnabled)
            {
                manager.logDebugMessage("  Feature model        : " + featureModelFileName + "\n");
                manager.logDebugMessage("  Learner              : " + manager.getOptionValueString("guide", "learner").ToString() + "\n");
            }
            string dataSplitColumn    = manager.getOptionValue("guide", "data_split_column").ToString().Trim();
            string dataSplitStructure = manager.getOptionValue("guide", "data_split_structure").ToString().Trim();

            featureModel = manager.FeatureModelManager.getFeatureModel(SingleGuide.findURL(featureModelFileName, manager), 0, ParserRegistry, dataSplitColumn, dataSplitStructure);

            manager.writeInfoToConfigFile("\nFEATURE MODEL\n");
            manager.writeInfoToConfigFile(featureModel.ToString());
            oracleGuide = parserState.Factory.makeOracleGuide(parserState.History);
        }