Skip to content

Commit a27c7e8

Browse files
authored
Merge pull request #520 from korpling/feature/span-doc
Feature/span doc
2 parents 4e68414 + cce71f1 commit a27c7e8

2 files changed

Lines changed: 26 additions & 7 deletions

File tree

docs/graph_ops/span.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
11
# span (graph_operation)
22

3-
3+
This module can query annotations and create spans across
4+
all matching nodes for the same value, adjacency is optional.
45

56
## Configuration
67

78
### query
89

9-
*No description*
10+
The query for retrieving the relevant annotation values and
11+
nodes for the spans to be created.
1012

1113
### node
1214

13-
*No description*
15+
The node index (starting at 1) to pick the target node for the new span.
16+
Note, that the new span will not directly point to the target node, but
17+
will have edges of component `component` (s. below) to the covered tokens.
1418

1519
### anno
1620

17-
*No description*
21+
The annotation key holding the values on the newly created spans.
1822

1923
### value
2024

21-
*No description*
25+
The query indices for determining an annotation value, join via empty string if
26+
more than one index is provided.
2227

2328
### adjacent
2429

25-
*No description*
30+
By default only adjacent matches (in base ordering) will be covered by a new span.
31+
If discontinuous spans are legal or useful in your model, you can set this to `false`.
2632

2733
### component
2834

29-
*No description*
35+
The component for the spanning edges, by default `{ ctype = "Coverage", layer = "annis", name = ""}` (the default coverage component).
3036

src/manipulator/span.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,29 @@ use serde::{Deserialize, Serialize};
2020

2121
use 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)]
2527
pub 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

Comments
 (0)