@@ -20,16 +20,29 @@ use serde::{Deserialize, Serialize};
2020
2121use crate :: { manipulator:: Manipulator , util:: update_graph_silent} ;
2222
23+ /// This module can query annotations and create spans across
24+ /// all matching nodes for the same value, adjacency is optional.
2325#[ derive( Deserialize , Facet , Serialize , Clone , PartialEq ) ]
2426#[ serde( deny_unknown_fields) ]
2527pub struct CreateSpans {
28+ /// The query for retrieving the relevant annotation values and
29+ /// nodes for the spans to be created.
2630 query : String ,
31+ /// The node index (starting at 1) to pick the target node for the new span.
32+ /// Note, that the new span will not directly point to the target node, but
33+ /// will have edges of component `component` (s. below) to the covered tokens.
2734 node : usize ,
35+ /// The annotation key holding the values on the newly created spans.
2836 #[ serde( with = "crate::estarde::anno_key" ) ]
2937 anno : AnnoKey ,
38+ /// The query indices for determining an annotation value, join via empty string if
39+ /// more than one index is provided.
3040 value : Vec < usize > ,
41+ /// By default only adjacent matches (in base ordering) will be covered by a new span.
42+ /// If discontinuous spans are legal or useful in your model, you can set this to `false`.
3143 #[ serde( default = "default_adjacent" ) ]
3244 adjacent : bool ,
45+ /// The component for the spanning edges, by default `{ ctype = "Coverage", layer = "annis", name = ""}` (the default coverage component).
3346 #[ serde(
3447 default = "default_component" ,
3548 with = "crate::estarde::annotation_component"
0 commit comments