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