//=============== Only PoS-Tagger (without Morphology) ===============// private static void ProcessText_without_Morphology(string text) { var(config, ssc) = PosTaggerEnvironment.CreatePosTaggerProcessorConfig(); using (ssc) using (var tokenizer = new Tokenizer(config.TokenizerConfig)) using (var posTaggerScriber = PosTaggerScriber.Create(config.ModelFilename, config.TemplateFilename)) { var posTaggerPreMerging = new PosTaggerPreMerging(config.Model); var result = new List <word_t>(); tokenizer.Run(text, true, words => { //-merge-phrases-abbreviations-numbers- posTaggerPreMerging.Run(words); //directly pos-tagging posTaggerScriber.Run(words); result.AddRange(words); }); Console.WriteLine("pos-tagger-entity-count: " + result.Count + Environment.NewLine); foreach (var w in result) { Console.WriteLine(w); } Console.WriteLine(); } }
public PosTaggerModelBuilder(string templateFilename, LanguageTypeEnum languageType, UrlDetectorConfig urlDetectorConfig) { templateFilename.ThrowIfNullOrWhiteSpace("templateFilename"); urlDetectorConfig.ThrowIfNull("urlDetectorConfig"); _PosTaggerScriber = PosTaggerScriber.Create4ModelBuilder(templateFilename); _PosTaggerInputTypeProcessor = CreatePosTaggerInputTypeProcessor(languageType); _UrlDetector = new UrlDetector(urlDetectorConfig); _Words = new List <word_t>(); }
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); }
public static PosTaggerScriber Create4ModelBuilder(string templateFilename) { var _PosTaggerCRFSuiteConverter = new PosTaggerScriber(templateFilename); return(_PosTaggerCRFSuiteConverter); }
public static PosTaggerScriber Create(string modelFilename, string templateFilename) { var _PosTaggerCRFSuiteConverter = new PosTaggerScriber(modelFilename, templateFilename); return(_PosTaggerCRFSuiteConverter); }