public void Execute(CGGraph graph)
 {
     foreach (var item in graph.Relations.Where(c => c.label == "null_edge").ToList())
     {
         graph.RemoveRelation(item);
     }
 }
Esempio n. 2
0
        public void Execute(CGGraph graph)
        {
            List <CGRelation> deletes = new List <CGRelation>();

            var relations = from c in graph.Relations.Where(c => c.label.Contains("-of"))
                            select c;

            foreach (var item in relations)
            {
                var head = graph.Nodes.Where(c => c.id == item.Head).First();
                var tail = graph.Nodes.Where(c => c.id == item.Tail).First();
                if (!tail.text.Contains("-0"))
                {
                    //deletes.Add(item);
                }
                else
                {
                    item.log  += string.Format("OF relation {0};", item.label);
                    item.label = item.label.Replace("-of", "");
                    var tmp = item.Head;
                    item.Head = item.Tail;
                    item.Tail = tmp;
                }
            }
            foreach (var item in deletes)
            {
                graph.RemoveRelation(item);
            }
        }
Esempio n. 3
0
        public void Execute(CGGraph graph)
        {
            List <CGNode> deletes = new List <CGNode>();

            foreach (var node in graph.Nodes)
            {
                if (node.text == "null_tag")
                {
                    deletes.Add(node);
                    foreach (var inR in graph.Relations.Where(c => c.Head == node.id).ToList())
                    {
                        graph.RemoveRelation(inR);
                    }
                    foreach (var outR in graph.Relations.Where(c => c.Tail == node.id).ToList())
                    {
                        graph.RemoveRelation(outR);
                    }
                }
            }
            foreach (var item in deletes)
            {
                graph.RemoveNode(item);
            }
        }
Esempio n. 4
0
 public StrategyMod(CGGraph graph)
 {
     this.graph = graph;
 }
 public StrategyAssignSemanticRole(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 6
0
 public StrategyQuant(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 7
0
 public StrategyPoss(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 8
0
 public StrategyStopWords(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 9
0
 public StrategyDomain(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 10
0
 public StrategySolveOfRelations(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 11
0
 public StrategyDataEntity(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 12
0
 public StrategyPersonFusion(CGGraph graph)
 {
     this.graph = graph;
 }
 public StrategyMonetaryQuantity(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 14
0
 public StrategyRange(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 15
0
 public StrategySource(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 16
0
 public StrategyTime(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 17
0
 public StrategyTopic(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 18
0
 public StrategyValue(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 19
0
 public StrategyVerbToConcept(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 20
0
 public StrategyPageRank(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 21
0
 public void Execute(CGGraph graph)
 {
     foreach (var item in graph.Relations.Where(c => c.label == "location"))
     {
     }
 }
Esempio n. 22
0
 public StrategyFrequency(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 23
0
 public StrategyTemporalQuantity(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 24
0
 public StrategyPrep(CGGraph graph)
 {
     this.graph = graph;
 }
 public StrategyAssignSemanticRelation(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 26
0
 public StrategyPart(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 27
0
 public StrategyInstrument(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 28
0
 public StrategyDuration(CGGraph graph)
 {
     this.graph = graph;
 }
 public StrategySolveSemantics(CGGraph graph)
 {
     this.graph = graph;
 }
Esempio n. 30
0
 public StrategyCondition(CGGraph graph)
 {
     this.graph = graph;
 }