# Class AnnotatedString (0.14.0)

0.14.0 (latest) 0.13.0 0.12.0 0.11.0 0.10.17 0.9.0 0.8.2 0.7.1 0.6.3 0.5.1 0.4.0 0.3.3 0.2.1 0.1.1

    AnnotatedString(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Describes string annotation from both semantic and formatting
perspectives. Example:

User Query:

top countries by population in Africa

0 4 14 17 28 31 37

Table Data:

- "country" - dimension
- "population" - metric
- "Africa" - value in the "continent" column

text_formatted = `"top countries by population in Africa"`

html_formatted =
`"top <b>countries</b> by <b>population</b> in <i>Africa</i>"`

::

markups = \[
{DIMENSION, 4, 12}, // 'countries'
{METRIC, 17, 26}, // 'population'
{FILTER, 31, 36} // 'Africa'
\]

Note that html formattings for 'DIMENSION' and 'METRIC' are the
same, while semantic markups are different.

| ## Attributes ||
|---|---|
| **Name** | **Description** |
| `text_formatted` | `str` Text version of the string. |
| `html_formatted` | `str` HTML version of the string annotation. |
| `markups` | `MutableSequence[https://docs.cloud.google.com/python/docs/reference/dataqna/latest/google.cloud.dataqna_v1alpha.types.AnnotatedString.SemanticMarkup]` Semantic version of the string annotation. |

## Classes

### SemanticMarkup

    SemanticMarkup(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Semantic markup denotes a substring (by index and length)
with markup information.

### SemanticMarkupType

    SemanticMarkupType(value)

Semantic markup types.