Example usage for edu.stanford.nlp.semgraph SemanticGraphEdge toString

List of usage examples for edu.stanford.nlp.semgraph SemanticGraphEdge toString

Introduction

In this page you can find the example usage for edu.stanford.nlp.semgraph SemanticGraphEdge toString.

Prototype

@Override
    public String toString() 

Source Link

Usage

From source file:edu.cmu.geolocator.nlp.StanfordCoreTools.StanfordNLP.java

License:Apache License

public void createEdgeMap(SemanticGraph tree, Map<String, String> edgeMap,
        Map<String, ArrayList<String>> childMap) {
    Set<SemanticGraphEdge> tmp = tree.getEdgeSet();
    // = new HashMap<String,String>();
    for (SemanticGraphEdge edge : tmp) {
        //System.out.println(edge.toString()+"("+edge.getSource().toString()+","+edge.getTarget().word()+")");
        edgeMap.put(edge.getTarget().word(), edge.toString());
        if (!childMap.containsKey(edge.getSource().word()))
            childMap.put(edge.getSource().word(), new ArrayList<String>());
        childMap.get(edge.getSource().word()).add(edge.getTarget().tag());

    }//from   ww  w  .  j  a va2 s  . c  o m
    //System.out.println();

}