コード例 #1
0
        public PosTaggerProcessor(PosTaggerProcessorConfig config, IMorphoModel morphoModel, MorphoAmbiguityResolverModel morphoAmbiguityModel)
        {
            CheckConfig(config, morphoModel, morphoAmbiguityModel);

            _Tokenizer                      = new Tokenizer(config.TokenizerConfig);
            _Words                          = new List <word_t>(DEFAULT_WORDSLIST_CAPACITY);
            _PosTaggerScriber               = PosTaggerScriber.Create(config.ModelFilename, config.TemplateFilename);
            _PosTaggerPreMerging            = new PosTaggerPreMerging(config.Model);
            _PosTaggerMorphoAnalyzer        = new PosTaggerMorphoAnalyzer(morphoModel, morphoAmbiguityModel);
            _ProcessSentCallback_1_Delegate = new Tokenizer.ProcessSentCallbackDelegate(ProcessSentCallback_1);
            _ProcessSentCallback_2_Delegate = new Tokenizer.ProcessSentCallbackDelegate(ProcessSentCallback_2);
        }
コード例 #2
0
        public void SetWordMorphologyAsUndefined()
        {
            var wma = MorphoAmbiguityTuples[0];

            if (!wma.WordFormMorphology.IsEmpty())
            {
                Word.morphology = wma.WordFormMorphology;
            }
            else
            {
                var partOfSpeech = PosTaggerMorphoAnalyzer.ToPartOfSpeech(Word.posTaggerOutputType).GetValueOrDefault();
                Word.morphology = new WordFormMorphology_t(partOfSpeech);
            }

            MorphoAmbiguityTuples.Clear();
            MorphoAmbiguityTuples.Add(new MorphoAmbiguityTuple_t(Word, Word.morphology, wma.PunctuationType));
        }