-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
I am trying to use cl-graph with https://github.com/own-pt/cl-conllu library. This library read conllu files (http://universaldependencies.org/format.html -- with a sentence tokenized). The library implements a class for a sentence that contains tokens (another class).
The first part works:
(let* ((sent (car (read-conllu #P"CF107.conllu")))
(tks (sentence-tokens sent))
(g (cl-graph:make-graph 'cl-graph:graph-container)))
(dolist (tk tks g)
(if (equal "0" (token-head tk))
(add-vertex g tk)
(add-edge-between-vertexes g tk (nth (token-head tk) tks) :edge-type :directed))))
But it seems the problem is with the edges when I try:
(cl-graph:graph->dot
*
nil
:vertex-labeler
(lambda (vertex stream)
(format stream "~(~A~)" (token-form (element vertex))))
:edge-formatter
(lambda (edge stream)
(format stream "~a" (element edge))))
I got
There is no applicable method for the generic function
#<STANDARD-GENERIC-FUNCTION CL-GRAPH:DOT-ATTRIBUTE-VALUE (1)>
when called with arguments
(:LABEL
#<GRAPH-CONTAINER-DIRECTED-EDGE <#<#<TOKEN {100301C313}>> #<#<TOKEN {100301B153}>> NIL>>).
[Condition of type SIMPLE-ERROR]
What did I miss?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels