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)); }
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())); }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <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; }