Example #1
0
        private static void CheckConfig(PosTaggerProcessorConfig config, IMorphoModel morphoModel, MorphoAmbiguityResolverModel morphoAmbiguityModel)
        {
            morphoModel.ThrowIfNull("morphoModel");

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

            morphoAmbiguityModel.ThrowIfNull("morphoAmbiguityModel");
        }
Example #2
0
        public PosTaggerProcessor(PosTaggerProcessorConfig config,
                                  IMorphoModel morphoModel,
                                  MorphoAmbiguityResolverModel morphoAmbiguityModel)
        {
            CheckConfig(config, morphoModel, morphoAmbiguityModel);

            _tokenizer                    = new Tokenizer(config.TokenizerConfig);
            _words                        = new List <Word>(DEFAULT_WORDSLIST_CAPACITY);
            _posTaggerScriber             = PosTaggerScriber.Create(config.ModelFilename, config.TemplateFilename);
            _posTaggerPreMerging          = new PosTaggerPreMerging(config.Model);
            _posTaggerMorphoAnalyzer      = new PosTaggerMorphoAnalyzer(morphoModel, morphoAmbiguityModel);
            _processSentCallback1Delegate = new Tokenizer.ProcessSentCallbackDelegate(ProcessSentCallback1);
            _processSentCallback2Delegate = new Tokenizer.ProcessSentCallbackDelegate(ProcessSentCallback2);
        }