Exemplo 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);
        }