Beispiel #1
0
        public static string FindNames(string sentence)
        {
            if (mNameFinder == null)
            {
                mNameFinder = new OpenNLP.Tools.NameFind.EnglishNameFinder(mModelPath + "namefind\\");
            }

            string[] models = new string[] { "person" };
            return(mNameFinder.GetNames(models, sentence));
        }
Beispiel #2
0
        public static string FindNames(string sentence)
        {
            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, sentence);
        }
Beispiel #3
0
        private string FindNames(string sentence)
        {
            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, sentence));
        }
Beispiel #4
0
        private string FindNames(OpenNLP.Tools.Parser.Parse sentenceParse)
        {
            if (_nameFinder == null)
            {
                _nameFinder = new OpenNLP.Tools.NameFind.EnglishNameFinder(_modelPath + "namefind\\");
            }

            var models = new[] { "date", "location", "money", "organization", "percentage", "person", "time" };

            return(_nameFinder.GetNames(models, sentenceParse));
        }
Beispiel #5
0
        /// <summary>
        /// Initializes a new instance of the SharpNLPTagger class with its behavior specified by the provided TaggerMode value.
        /// </summary>
        /// <param name="taggingMode">Specifies the mode under which the tagger will operate.</param>
        public SharpNLPTagger(TaggerMode taggingMode)
        {
            string resourcesDirectory;

            TaggingMode = taggingMode;
            if (Settings != null)
            {
                resourcesDirectory = Settings["ResourcesDirectory"];
                mModelPath         = resourcesDirectory + Settings["MaximumEntropyModelDirectory"];
                mNameFinderPath    = resourcesDirectory + Settings["WordnetSearchDirectory"];
            }
            else
            {
                resourcesDirectory = ConfigurationManager.AppSettings["ResourcesDirectory"];
                mModelPath         = resourcesDirectory + ConfigurationManager.AppSettings["MaximumEntropyModelDirectory"];
                mNameFinderPath    = resourcesDirectory + ConfigurationManager.AppSettings["WordnetSearchDirectory"];
            }

            mNameFinder = new OpenNLP.Tools.NameFind.EnglishNameFinder(mNameFinderPath);
        }
Beispiel #6
0
        private string FindNames(OpenNLP.Tools.Parser.Parse sentenceParse)
        {
            if (mNameFinder == null)
            {
                mNameFinder = new OpenNLP.Tools.NameFind.EnglishNameFinder(mModelPath);
            }

            string[] models = new string[] { "date", "location", "money", /*"organization",*/ "percentage", "person", "time" };
            return mNameFinder.GetNames(models, sentenceParse);
        }
Beispiel #7
0
        private string FindNames(OpenNLP.Tools.Parser.Parse sentenceParse)
        {
            if (_nameFinder == null)
            {
                _nameFinder = new OpenNLP.Tools.NameFind.EnglishNameFinder(_modelPath + "namefind\\");
            }

            var models = new[] { "date", "location", "money", "organization", "percentage", "person", "time" };
            return _nameFinder.GetNames(models, sentenceParse);
        }