示例#1
0
        private string FindNames(OpenNLP.Tools.Parser.Parse sentenceParse)
        {
            if (mNameFinder == null)
            {
                mNameFinder = new OpenNLP.Tools.NameFind.EnglishNameFinder(mModelPath + "namefind\\");
            }

            string[] models = new string[] { "date", "location", "money", "organization", "percentage", "person", "time" };
            return(mNameFinder.GetNames(models, sentenceParse));
        }
示例#2
0
        private string IdentifyCoreferents(string[] sentences)
        {
            if (mCoreferenceFinder == null)
            {
                mCoreferenceFinder = new OpenNLP.Tools.Lang.English.TreebankLinker(mModelPath + "coref");
            }

            System.Collections.Generic.List <OpenNLP.Tools.Parser.Parse> parsedSentences = new System.Collections.Generic.List <OpenNLP.Tools.Parser.Parse>();

            foreach (string sentence in sentences)
            {
                OpenNLP.Tools.Parser.Parse sentenceParse = ParseSentence(sentence);
                string findNames = FindNames(sentenceParse);
                parsedSentences.Add(sentenceParse);
            }
            return(mCoreferenceFinder.GetCoreferenceParse(parsedSentences.ToArray()));
        }
示例#3
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Constructor. </summary>
        ///
        /// <param name="parse">            The parse. </param>
        /// <param name="sentenceNumber">   The sentence number. </param>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public DefaultParse(Parse parse, int sentenceNumber)
        {
            mParse          = parse;
            mSentenceNumber = sentenceNumber;
        }