Re: [jgrapht-users] Extending Default Edge
Brought to you by:
barak_naveh,
perfecthash
From: Ricardo R. <ric...@gm...> - 2011-02-11 03:42:00
|
Hi, >From the sample in project page: http://nlp.stanford.edu/software/lex-parser.shtml#Sample <http://nlp.stanford.edu/software/lex-parser.shtml#Sample>I imagine the TypedDependencies are: det(rain-3, The-1) amod(rain-3, strongest-2) nsubj(shut-8, rain-3) ... And, by dependecy relations, I understand: det, amod, nsubj, etc.. So... if that's the case, you don't need to use the class DefaultEdge as a type for your edges or extend it, JGraphT is based on Generics... so you can use whatever class which is suitable for you... E.g.: SimpleGraph<String, String> graph = new SimpleGraph<String, String>(String.class); So you can add edges with the desired information: graph.addEdge("rain-3", "The-1", "det"); graph.addEdge("rain-3", "strongest-2", "amod"); graph.addEdge("shut-8", "rain-3", "nsubj"); Probably your vertices and edges are not String's, so you just have to choose the right class for your graphs... I hope I could help you. Regards 2011/2/9 Neal Lewis <im...@gm...> > Hello, > > First off, thanks for such a great API. This had made my life much, > much easier. > > I am applying the graphs to output from the Stanford Parser API, and > creating SimpleGraphs Undirected from the TypedDependencies output from > the Stanford Parser. I would like to use the dependency relations as > edges in the graph, such that I can create a GraphPath of label edges. > > Is this possible? Has it been down before? > > Thank you! > > Neal > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > -- Redder |