.. meta:: :description: Orange Textable documentation, XML annotation-based selection using a regex :keywords: Orange, Textable, documentation, annotation, selection, xml, regex XML Annotation-based selection using a regex ============================================ Another common way of exploiting annotations consists in using them to select the segments that will be in-/excluded by an instance of :ref:`Select` (see :doc:`Partitioning segmentations `) or :ref:`Intersect` (see :doc:`Using a segmentation to filter another `). Thus, in the case of the XML data example introduced :doc:`here ` (and further developed :doc:`there `), we might insert an instance of :ref:`Select` between those of :ref:`Extract XML` and :ref:`Count` (see :ref:`figure 1 ` below) in order to include only "content words". .. _annotation_based_selection_fig1: .. figure:: figures/annotation_based_selection_schema.png :align: center :alt: Inserting an instance of Select to filter a segmentation :scale: 80% Figure 1: Inserting an instance of :ref:`Select` to filter a segmentation. In this simplified example, the :ref:`Select` instance could thus be parameterized as indicated on :ref:`figure 2 ` below), so as to exclude (**Mode: Exclude**) those segments whose annotation value for key *type* (**Annotation key**: *type*) is *DET* or *PREP* (**Regex:** ``^(DET|PREP)$``). .. _annotation_based_selection_fig2: .. figure:: figures/select_annotation_key.png :align: center :alt: Inserting an instance of Select to filter a segmentation Figure 2: Excluding segments based on annotation values with :ref:`Select`. See also -------- * :doc:`Getting started: Partitioning segmentations ` * :doc:`Getting started: Using a segmentation to filter another ` * :doc:`Getting started: Converting XML markup to annotations ` * :doc:`Getting started: Merging units with annotations ` * :ref:`Reference: Select widget