Exemple #1
0
        public string GenerateMetadataNLG()
        {
            var temporal = new List <CGVerb>();
            var noverbs  = new List <string>()
            {
            };
            var vers = this.Nodes.Where(c =>
                                        !noverbs.Contains(c.nosuffix) &&
                                        c.semanticroles.Contains("verb")).OrderByDescending(c => c.pagerank).ToList();

            foreach (var verb in vers)
            {
                var cgverb = new CGVerb(verb);
                cgverb.GenerateVerbs(this);
                cgverb.GenerateAgents(this);
                cgverb.GeneratePatients(this);
                cgverb.GenerateThemes(this);
                cgverb.GenerateGoal(this);
                cgverb.GenerateAttribute(this);
                temporal.Add(cgverb);
            }

            var result = new List <CGVerb>();

            foreach (var item in temporal.OrderByDescending(c => c.Rank))
            {
                var count = result.Sum(c => c.Words);
                if (count > 100)
                {
                    break;
                }
                result.Add(item);
            }
            return(JsonConvert.SerializeObject(result));
        }
Exemple #2
0
        public string Summary()
        {
            StringBuilder sb = new StringBuilder();

            var result = new List <CGVerb>();

            var vers = this.Nodes.Where(c => c.semanticroles.Contains("verb")).OrderByDescending(c => c.pagerank).ToList();

            foreach (var verb in vers)
            {
                var cgverb = new CGVerb(verb);
                cgverb.GenerateVerbs(this);
                cgverb.GenerateAgents(this);
                cgverb.GeneratePatients(this);
                cgverb.GenerateThemes(this);
                cgverb.GenerateGoal(this);
                cgverb.GenerateAttribute(this);
                result.Add(cgverb);
            }
            int words = 0;

            foreach (var item in result.OrderByDescending(c => c.Rank))
            {
                words += item.Words;
                sb.AppendLine(item.SummaryLemme());
                if (words > 100)
                {
                    break;
                }
            }
            return(sb.ToString());
        }
Exemple #3
0
        public string GenerateInformativeAspectsv2()
        {
            StringBuilder sb     = new StringBuilder();
            var           result = new List <CGVerb>();

            var noverbs = new List <string>()
            {
            };

            var vers = this.Nodes.Where(c =>
                                        !noverbs.Contains(c.nosuffix) &&
                                        c.semanticroles.Contains("verb")).OrderByDescending(c => c.pagerank).ToList();

            foreach (var verb in vers)
            {
                var cgverb = new CGVerb(verb);
                cgverb.GenerateVerbs(this);
                cgverb.GenerateAgents(this);
                cgverb.GeneratePatients(this);
                cgverb.GenerateThemes(this);
                cgverb.GenerateGoal(this);
                result.Add(cgverb);
            }
            int words = 0;

            foreach (var item in result.OrderByDescending(c => c.Rank))
            {
                words += item.Words;
                sb.AppendLine(item.Log(false));
                if (words > 100)
                {
                    break;
                }
            }
            return(sb.ToString());
        }