Exemple #1
0
        public MorphoAmbiguityResolverModel(MorphoAmbiguityResolverConfig config)
        {
            config.ThrowIfNull("config");
            config.ModelFilename.ThrowIfNullOrWhiteSpace("ModelFilename");
            config.TemplateFilename_5g.ThrowIfNullOrWhiteSpace("TemplateFilename_5g");
            config.TemplateFilename_3g.ThrowIfNullOrWhiteSpace("TemplateFilename_3g");

            Config = config;

            /*Dictionary      = LoadModel     ( config.ModelFilename );*/
            DictionaryBytes = LoadModelBytes(config.ModelFilename);
        }
            private static MorphoAmbiguityResolverModel CreateMorphoAmbiguityResolverModel()
            {
                var config = new MorphoAmbiguityResolverConfig()
                {
                    ModelFilename       = Config.MORPHO_AMBIGUITY_MODEL_FILENAME,
                    TemplateFilename_5g = Config.MORPHO_AMBIGUITY_TEMPLATE_FILENAME_5G,
                    TemplateFilename_3g = Config.MORPHO_AMBIGUITY_TEMPLATE_FILENAME_3G,
                };
                var model = new MorphoAmbiguityResolverModel(config);

                return(model);
            }
Exemple #3
0
        private static void CheckConfig(PosTaggerProcessorConfig config, IMorphoModel morphoModel, MorphoAmbiguityResolverConfig morphoAmbiguityConfig)
        {
            morphoModel.ThrowIfNull("morphoModel");

            config.ThrowIfNull("config");
            config.Model.ThrowIfNull("Model");
            config.TokenizerConfig.ThrowIfNull("TokenizerConfig");
            config.ModelFilename.ThrowIfNullOrWhiteSpace("ModelFilename");
            config.TemplateFilename.ThrowIfNullOrWhiteSpace("TemplateFilename");

            morphoAmbiguityConfig.ThrowIfNull("morphoAmbiguityConfig");
            morphoAmbiguityConfig.ModelFilename.ThrowIfNullOrWhiteSpace("morphoAmbiguityConfig.ModelFilename");
            morphoAmbiguityConfig.TemplateFilename_5g.ThrowIfNullOrWhiteSpace("morphoAmbiguityConfig.TemplateFilename_5g");
        }