2.2. Annotating by merging¶
Widget Merge makes it possible to convert the labels of its input segmentations into annotation values. Suppose that three instances of Text Field have been created: two instances containing a text in English, and one containing a text in French. We might want to merge these three segmentations into a single one, where each segment would be associated with an annotation whose key is language and whose value is either en or fr. The first step would then be to rename each Text Field instance with the desired annotation value for this text, as shown on figure 1 below.

Figure 1: Specifying annotations values using the label of Text Field instances.¶
The three instances of Text Field should then be connected to an instance of Merge as shown on figure 2 below.

Figure 2: Example workflow for creating annotations with Merge.
One must still specify, in the interface of Merge, the annotation key to which values en and fr should be associated. This can be done by entering the string language in field Import labels with key, having previously ensured that labels would actually be converted into annotation values by checking the box at the left of this line (see figure 3 below).
We also have the option to give a distinct, numeric annotation value to each segment; to that effect, check the Auto-number with key box. A sensible key for this annotation might be e.g. num.

Figure 3: Importing labels as annotation values with Merge.¶
The result of these operations can be viewed using an instance of Display, whose output is shown on figure 4 below. For each segment in the merged segmentation, an annotation value en or fr associated with key language is displayed above the segment’s content, as well as a numeric annotation with key num:
