Ejemplo n.º 1
0
 public PosTaggerMorphoAnalyzer(IMorphoModel morphoModel, MorphoAmbiguityResolverModel morphoAmbiguityModel)
 {
     _morphoModel    = morphoModel;
     _morphoAnalyzer = new MorphoAnalyzer(_morphoModel);
     _morphoAmbiguityPreProcessor = new MorphoAmbiguityPreProcessor();
     _morphoAmbiguityResolver     = new MorphoAmbiguityResolver(morphoAmbiguityModel);
     _wordFormMorphologies_Buffer = new List <WordFormMorphology>();
     _wordMorphoAmbiguityFactory  = new WordMorphoAmbiguityFactory(null);
     _wordMorphoAmbiguities       = new List <WordMorphoAmbiguity>();
     CTM = XlatUnsafe.Inst._CHARTYPE_MAP;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
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");
        }