Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }