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