Esempio n. 1
0
        private void NavigateAttribute(List <CGVerbTerm> list, CGNode Target, CGGraph graph, int level)
        {
            var out_agents = graph.GetOutRelations(Target);

            foreach (var rel in out_agents)
            {
                var item = graph.Nodes.Where(c => c.id == rel.Tail).Single();
                if (rel.conceptualrole == "mod" ||
                    rel.conceptualrole == "manner" ||
                    rel.conceptualrole == "op" ||
                    rel.conceptualrole == "domain" ||
                    rel.conceptualrole == "poss" ||
                    rel.conceptualrole == "direction" ||
                    rel.conceptualrole == "location")
                {
                    if (list.Where(c => c.Node.id == item.id).Count() == 0 &&
                        list.Where(c => c.Node.text == item.text).Count() == 0)
                    {
                        var wrapper = new CGVerbTerm(item, rel, level + 1);
                        list.Add(wrapper);
                        NavigateAttribute(list, item, graph, level + 1);
                    }
                }
                else
                {
                    this.AttributesLoss.Add(string.Format("Text :{0} / conceptualroles:{1} / Item Text: {2} / Level {3}", Target.text, rel.conceptualrole, item.text, level));
                }
            }
        }
Esempio n. 2
0
        public void GenerateAgents(CGGraph graph)
        {
            var out_agents = graph.GetOutRelationsByConceptualRole(this.Verb, "agent", "co-agent", "experiencer",
                                                                   "stimulus");

            foreach (var rel in out_agents)
            {
                var node    = graph.Nodes.Where(c => c.id == rel.Tail).Single();
                var list    = new List <CGVerbTerm>();
                var wrapper = new CGVerbTerm(node, rel, 0);
                list.Add(wrapper);
                NavigateAgent(list, node, graph, 0);
                this.Agents.Add(list);
            }
            var in_agents = graph.GetInRelationsByConceptualRole(this.Verb, "agent-of");

            foreach (var rel in in_agents)
            {
                var node    = graph.Nodes.Where(c => c.id == rel.Head).Single();
                var list    = new List <CGVerbTerm>();
                var wrapper = new CGVerbTerm(node, rel, 0);
                list.Add(wrapper);
                NavigateAgent(list, node, graph, 0);
                this.Agents.Add(list);
            }
        }
Esempio n. 3
0
        public void GenerateAttribute(CGGraph graph)
        {
            var out_themes = graph.GetOutRelationsByConceptualRole(this.Verb, "attribute");

            foreach (var rel in out_themes)
            {
                var node    = graph.Nodes.Where(c => c.id == rel.Tail).Single();
                var list    = new List <CGVerbTerm>();
                var wrapper = new CGVerbTerm(node, rel, 0);
                list.Add(wrapper);
                NavigateAttribute(list, node, graph, 0);
                this.Attributes.Add(list);
            }
        }
Esempio n. 4
0
        public void GenerateGoal(CGGraph graph)
        {
            var out_themes = graph.GetOutRelationsByConceptualRole(this.Verb, "goal", "purpose", "destination", "asset");

            foreach (var rel in out_themes)
            {
                var node    = graph.Nodes.Where(c => c.id == rel.Tail).Single();
                var list    = new List <CGVerbTerm>();
                var wrapper = new CGVerbTerm(node, rel, 0);
                list.Add(wrapper);
                NavigateGoal(list, node, graph, 0);
                this.Goal.Add(list);
            }
        }
Esempio n. 5
0
        public void GeneratePatients(CGGraph graph)
        {
            var out_patients = graph.GetOutRelationsByConceptualRole(this.Verb, "patient", "co-patient",
                                                                     "recipient", "predicate");

            foreach (var rel in out_patients)
            {
                var node    = graph.Nodes.Where(c => c.id == rel.Tail).Single();
                var list    = new List <CGVerbTerm>();
                var wrapper = new CGVerbTerm(node, rel, 0);
                list.Add(wrapper);
                NavigatePatient(list, node, graph, 0);
                this.Patients.Add(list);
            }
        }
Esempio n. 6
0
        public void GenerateVerbs(CGGraph graph)
        {
            var out_verbs = graph.GetOutRelations(this.Verb);

            foreach (var rel in out_verbs)
            {
                if (rel.conceptualrole == "mod" ||
                    rel.conceptualrole == "manner" ||
                    rel.conceptualrole == "time")
                {
                    var node    = graph.Nodes.Where(c => c.id == rel.Tail).Single();
                    var wrapper = new CGVerbTerm(node, rel, 0);
                    this.VerbAttributes.Add(wrapper);
                }
                else
                {
                    this.AttributesLoss.Add(string.Format("{0} {1} {2} {3}", Verb.id, Verb.text, rel.conceptualrole, rel.Tail));
                }
            }
        }