public void Execute(CGGraph graph)
 {
     foreach (var item in graph.Relations.Where(c => c.label == "null_edge").ToList())
     {
         graph.RemoveRelation(item);
     }
 }
Example #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);
            }
        }
Example #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);
            }
        }
Example #4
0
 public StrategyMod(CGGraph graph)
 {
     this.graph = graph;
 }
 public StrategyAssignSemanticRole(CGGraph graph)
 {
     this.graph = graph;
 }
Example #6
0
 public StrategyQuant(CGGraph graph)
 {
     this.graph = graph;
 }
Example #7
0
 public StrategyPoss(CGGraph graph)
 {
     this.graph = graph;
 }
Example #8
0
 public StrategyStopWords(CGGraph graph)
 {
     this.graph = graph;
 }
Example #9
0
 public StrategyDomain(CGGraph graph)
 {
     this.graph = graph;
 }
Example #10
0
 public StrategySolveOfRelations(CGGraph graph)
 {
     this.graph = graph;
 }
Example #11
0
 public StrategyDataEntity(CGGraph graph)
 {
     this.graph = graph;
 }
Example #12
0
 public StrategyPersonFusion(CGGraph graph)
 {
     this.graph = graph;
 }
 public StrategyMonetaryQuantity(CGGraph graph)
 {
     this.graph = graph;
 }
Example #14
0
 public StrategyRange(CGGraph graph)
 {
     this.graph = graph;
 }
Example #15
0
 public StrategySource(CGGraph graph)
 {
     this.graph = graph;
 }
Example #16
0
 public StrategyTime(CGGraph graph)
 {
     this.graph = graph;
 }
Example #17
0
 public StrategyTopic(CGGraph graph)
 {
     this.graph = graph;
 }
Example #18
0
 public StrategyValue(CGGraph graph)
 {
     this.graph = graph;
 }
 public StrategyVerbToConcept(CGGraph graph)
 {
     this.graph = graph;
 }
Example #20
0
 public StrategyPageRank(CGGraph graph)
 {
     this.graph = graph;
 }
Example #21
0
 public void Execute(CGGraph graph)
 {
     foreach (var item in graph.Relations.Where(c => c.label == "location"))
     {
     }
 }
Example #22
0
 public StrategyFrequency(CGGraph graph)
 {
     this.graph = graph;
 }
Example #23
0
 public StrategyTemporalQuantity(CGGraph graph)
 {
     this.graph = graph;
 }
Example #24
0
 public StrategyPrep(CGGraph graph)
 {
     this.graph = graph;
 }
 public StrategyAssignSemanticRelation(CGGraph graph)
 {
     this.graph = graph;
 }
Example #26
0
 public StrategyPart(CGGraph graph)
 {
     this.graph = graph;
 }
Example #27
0
 public StrategyInstrument(CGGraph graph)
 {
     this.graph = graph;
 }
Example #28
0
 public StrategyDuration(CGGraph graph)
 {
     this.graph = graph;
 }
 public StrategySolveSemantics(CGGraph graph)
 {
     this.graph = graph;
 }
Example #30
0
 public StrategyCondition(CGGraph graph)
 {
     this.graph = graph;
 }