public static string ToText(this BuildModelNerInputType buildModelNerInputType) { switch (buildModelNerInputType) { case BuildModelNerInputType.B_NAME: return("B-N"); case BuildModelNerInputType.I_NAME: return("I-N"); case BuildModelNerInputType.B_ORG: return("B-J"); case BuildModelNerInputType.I_ORG: return("I-J"); case BuildModelNerInputType.B_GEO: return("B-G"); case BuildModelNerInputType.I_GEO: return("I-G"); case BuildModelNerInputType.B_ENTR: return("B-E"); case BuildModelNerInputType.I_ENTR: return("I-E"); case BuildModelNerInputType.B_PROD: return("B-P"); case BuildModelNerInputType.I_PROD: return("I-P"); default: return("O"); } }
internal static string ToText(this BuildModelNerInputType buildModelNerInputType) { switch (buildModelNerInputType) { case BuildModelNerInputType.B_NAME: return("B-NAME"); case BuildModelNerInputType.I_NAME: return("I-NAME"); case BuildModelNerInputType.B_ORG: return("B-ORG"); case BuildModelNerInputType.I_ORG: return("I-ORG"); case BuildModelNerInputType.B_GEO: return("B-GEO"); case BuildModelNerInputType.I_GEO: return("I-GEO"); case BuildModelNerInputType.B_ENTR: return("B-ENTR"); case BuildModelNerInputType.I_ENTR: return("I-ENTR"); case BuildModelNerInputType.B_PROD: return("B-PROD"); case BuildModelNerInputType.I_PROD: return("I-PROD"); default: //BuildModelNerInputType.O: return("O"); } }
public List <buildmodel_word_t> run4ModelBuilder( string partOfSentText, bool isLastPartOfSentText, NerOutputType nerOutputType, bool prevPartOfSentTextSameNerOutputType) { _BuildModelWords.Clear(); if (prevPartOfSentTextSameNerOutputType) { _BuildModelNerInputTypeI = nerOutputType.ToBuildModelNerInputTypeI(); _BuildModelNerInputTypeB = _BuildModelNerInputTypeI; } else { _BuildModelNerInputTypeI = nerOutputType.ToBuildModelNerInputTypeI(); _BuildModelNerInputTypeB = nerOutputType.ToBuildModelNerInputTypeB(); } _ProcessSentCallback = ProcessSentCallbackModelBuilder; fixed(char *_base = partOfSentText) fixed(CharType * ctm = xlat.CHARTYPE_MAP) fixed(NERCharType * nctm = NER_CHARTYPE_MAP) { _BASE = _base; _CTM = ctm; _NCTM = nctm; _NotSkipNonLetterAndNonDigitToTheEnd = !isLastPartOfSentText; var urls = _UrlDetector.AllocateUrls(partOfSentText); _BuildModelSent.Set4ModelBuilder(0, partOfSentText.Length, (0 < urls.Count) ? urls : null); ProcessSentSplitterCallback(_BuildModelSent); _NotSkipNonLetterAndNonDigitToTheEnd = false; } _ProcessSentCallback = null; return(_BuildModelWords); }
public List <Buildmodel_word_t> Run4ModelBuilder( string partOfSentText, bool isLastPartOfSentText, NerOutputType nerOutputType, bool prevPartOfSentTextSameNerOutputType) { _buildModelWords.Clear(); if (prevPartOfSentTextSameNerOutputType) { _buildModelNerInputTypeI = nerOutputType.ToBuildModelNerInputTypeI(); _buildModelNerInputTypeB = _buildModelNerInputTypeI; } else { _buildModelNerInputTypeI = nerOutputType.ToBuildModelNerInputTypeI(); _buildModelNerInputTypeB = nerOutputType.ToBuildModelNerInputTypeB(); } _outerProcessSentCallbackDelegate = ProcessSentCallbackModelBuilder; fixed(char *_base = partOfSentText) { _BASE = _base; _dontSkipNonLetterAndNonDigitToTheEnd = !isLastPartOfSentText; var urls = _urlDetector.AllocateUrls(partOfSentText); _buildModelSentence.Set4ModelBuilder(0, partOfSentText.Length, (0 < urls.Count) ? urls : null); SentSplitterProcessSentCallback(_buildModelSentence); _dontSkipNonLetterAndNonDigitToTheEnd = false; } _outerProcessSentCallbackDelegate = null; return(_buildModelWords); }