Esempio n. 1
0
        public List <WordResult[]> Segment(string sentence, int nKind)
        {
            OnBeginSegment(sentence);

            m_pNewSentence = Predefine.SENTENCE_BEGIN + sentence + Predefine.SENTENCE_END;
            int nResultCount = m_Seg.BiSegment(m_pNewSentence, m_dSmoothingPara, nKind);

            for (int i = 0; i < nResultCount; i++)
            {
                if (this.PersonRecognition)
                {
                    m_uPerson.Recognition(m_Seg.m_pWordSeg[i], m_Seg.m_graphOptimum, m_Seg.atomSegment, m_dictCore);
                }

                if (this.TransPersonRecognition)
                {
                    m_uTransPerson.Recognition(m_Seg.m_pWordSeg[i], m_Seg.m_graphOptimum, m_Seg.atomSegment, m_dictCore);
                }

                if (this.PlaceRecognition)
                {
                    m_uPlace.Recognition(m_Seg.m_pWordSeg[i], m_Seg.m_graphOptimum, m_Seg.atomSegment, m_dictCore);
                }
            }
            OnPersonAndPlaceRecognition(m_Seg.m_graphOptimum);

            m_Seg.BiOptimumSegment(1, m_dSmoothingPara);

            for (int i = 0; i < m_Seg.m_pWordSeg.Count; i++)
            {
                m_POSTagger.POSTagging(m_Seg.m_pWordSeg[i], m_dictCore, m_dictCore);
            }

            OnFinishSegment(m_Seg.m_pWordSeg);

            return(m_Seg.m_pWordSeg);
        }