public void Execute(CGGraph graph) { foreach (var item in graph.Relations.Where(c => c.label == "null_edge").ToList()) { graph.RemoveRelation(item); } }
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); } }
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); } }
public StrategyMod(CGGraph graph) { this.graph = graph; }
public StrategyAssignSemanticRole(CGGraph graph) { this.graph = graph; }
public StrategyQuant(CGGraph graph) { this.graph = graph; }
public StrategyPoss(CGGraph graph) { this.graph = graph; }
public StrategyStopWords(CGGraph graph) { this.graph = graph; }
public StrategyDomain(CGGraph graph) { this.graph = graph; }
public StrategySolveOfRelations(CGGraph graph) { this.graph = graph; }
public StrategyDataEntity(CGGraph graph) { this.graph = graph; }
public StrategyPersonFusion(CGGraph graph) { this.graph = graph; }
public StrategyMonetaryQuantity(CGGraph graph) { this.graph = graph; }
public StrategyRange(CGGraph graph) { this.graph = graph; }
public StrategySource(CGGraph graph) { this.graph = graph; }
public StrategyTime(CGGraph graph) { this.graph = graph; }
public StrategyTopic(CGGraph graph) { this.graph = graph; }
public StrategyValue(CGGraph graph) { this.graph = graph; }
public StrategyVerbToConcept(CGGraph graph) { this.graph = graph; }
public StrategyPageRank(CGGraph graph) { this.graph = graph; }
public void Execute(CGGraph graph) { foreach (var item in graph.Relations.Where(c => c.label == "location")) { } }
public StrategyFrequency(CGGraph graph) { this.graph = graph; }
public StrategyTemporalQuantity(CGGraph graph) { this.graph = graph; }
public StrategyPrep(CGGraph graph) { this.graph = graph; }
public StrategyAssignSemanticRelation(CGGraph graph) { this.graph = graph; }
public StrategyPart(CGGraph graph) { this.graph = graph; }
public StrategyInstrument(CGGraph graph) { this.graph = graph; }
public StrategyDuration(CGGraph graph) { this.graph = graph; }
public StrategySolveSemantics(CGGraph graph) { this.graph = graph; }
public StrategyCondition(CGGraph graph) { this.graph = graph; }