Esempio n. 1
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);
        }
//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);
        }
Esempio n. 3
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));
        }