+
    Qim  c                  s    R t ^ RIHt RtRtRtRtRtRt^ RI	H
t
Ht ^ R	IHt ^R
IHt  ! R R]
4      t ! R R]]]3,          4      tR# )zSSML --- XML-based markup language for speech synthesis.

Class SSML defines a simple wrapper for holding and converting
text to SSML, suitable to be sent to a speech server. Services
can pass flags to control the elements and attributes used.
)annotationsz$Id$z
$Revision$z$Date$z<andyholmes@gnome.org>u(   Copyright © 2024 GNOME Foundation Inc. ZLGPL)Enumauto)Any)debugc                  s   ] tR t^/tRt]! 4       t]! 4       t]! 4       t]! 4       t	]! 4       t
]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       tRtR# )SSMLCapabilitiesz!Enumeration of SSML capabilities. N)__name__
__module____qualname____firstlineno____doc__r   ZSAY_AS_DATEZSAY_AS_TIMEZSAY_AS_TELEPHONEZSAY_AS_CHARACTERSZSAY_AS_CHARACTERS_GLYPHSZSAY_AS_CARDINALZSAY_AS_ORDINALZSAY_AS_CURRENCYZBREAKZSUBZPHONEMEZEMPHASISZPROSODYZMARKZSENTENCE_PARAGRAPHZTOKENALL__static_attributes__r       ./usr/lib/python3.14/site-packages/orca/ssml.pyr   r   /   s    +&K&Kv#vfOVNfOFE
&CfGvHfG6DFE
&Cr   r   c                  s    ] tR t^DtRtR]P                  3R R lltR R lt]	R R l4       t
]	]P                  3R	 R
 ll4       tR R ltR R ltRtR# )SSMLz*Holds SSML representation of an utterance. c               s$    V ^8  d   QhRRRRRR/# )   textstrfeaturesr   returnZNoner   Zformat   "r   __annotate__SSML.__annotate__G   s#     6 6S 61A 6]a 6r   c                sj    \         P                  V 4       T;'       g    RV R&   \        V4      V R&   R# )z%Create and initialize ACSS structure.r   r   r   N)dict__init__r   )selfr   r   s   &&&r   r   ZSSML.__init__G   s,    dzzrV+H5Zr   c                    V ^8  d   QhRRRR/# )r   otherZobjectr   Zboolr   r   r   r   r   r   M   s      F t r   c                	s    \        V\        4      '       g   R # V P                  R4      VP                  R4      8w  d   R # V P                  R4      VP                  R4      8w  d   R # R# )Fr   r   T)Z
isinstancer   Zget)r   r   s   &&r   __eq__ZSSML.__eq__M   sO    %&&88Fuyy0088J599Z#88r   c               r   )r   r   r   r   z!tuple[str, list[tuple[int, int]]]r   r   r   r   r   r   W   s     7! 7!# 7!"C 7!r   c                s   Rp. pRpRp\        V 4       EFO  w  rVVR8X  d   K  VP                  4       '       g"   Vf   VR,          pTpVP                  4       pEMVP                  4       '       d   Ve   V'       d   \        V^,           \	        V 4      4       F!  pW,          P                  4       '       d   K!   M	  RpV'       dV   X\	        V 4      8  dF   W,          P                  4       '       g*   W,          P                  4       '       g   RpV^,          pK]  V'       g   VP                  W534       RpRpM V'       d   VP                  4       '       g   RpW,          pEKR  	  Ve   VP                  V\	        V 4      34       W3# )z3Mark the word offsets of text for later formatting.r   N   F)Z	enumerateZisspaceZ	isnumericZrangelenZappend)r   ZmarkedoffsetsZ
last_beginZ
is_numericicZjs   &       r   _mark_wordsZSSML._mark_wordsV   s<    )+!%
"&
dODAH} 99;;:#5("
[[]
!7 #1Q3D	2#w00! 3 &+
$SYtw?P?P#w0022).JQ!NNJ?3!%J!%JAKKMM"
KFK $N !NNJD	23  r   c               s$    V ^8  d   QhRRRRRR/# )r   r   r   r   r   r   r   r   r   r   r   r      s#     1 1# 1)9 1UX 1r   c                s   T ;'       g    Rp V^ 8X  d   V # \         P                  V 4      w  rRp^ pV  F  pVR8X  dr   V\        V4      8  d-   V R2p\        P                  ! \        P
                  VR4       M*VRW$,          ^ ,           RW$,          ^,           R2,          pV^,          pK{  VR	8X  d   VR
,          pK  VR8X  d   VR,          pK  VR8X  d   VR,          pK  W5,          pK  	  VR,          pV# )ad  Converts plain text to SSML markup.  If features is 0, the text
will be returned unmodified.

Arguments:
- text:      optional text to add to the queue before speaking
- features:  ssml.SSMLCapabilities flags. Currently, the only
             supported element is SSMLCapabilities.MARK.

Returns:
- The SSML markup of the text, per the supported features.
r   z<speak>r!   z+th U+E000 does not have corresponding indexTz<mark name="Z:z"/>Z<z&lt;Z>z&gt;Z&z&amp;z</speak>)r   r&   r"   r   Zprint_messageZLEVEL_WARNING)r   r   r#   Zssmlr$   r%   Zmsgs   &&     r   markup_textZSSML.markup_text   s     zzrq=K **40
 AH}G$CJKC''(;(;S$Gl7:a=/7:a=/MMDQ ccc	+ , 	
r   c                   V ^8  d   QhRR/# r   r   r   r   r   r   r   r   r      s     @ @C @r   c                sJ    \         P                  V R,          V R,          4      # )z;Return the text content as SSML, per the supported featuresr   r   )r   r'   r      &r   
get_markupZSSML.get_markup   s      Vd:.>??r   c               r(   r)   r   r   r   r   r   r      s      # r   c                s    V R,          # )z$Return the unmarked-up text content.r   r   r*   r+   r   get_textZSSML.get_text   s     F|r   r   N)r   r   r	   r
   r   r   r   r   r    Zstaticmethodr&   r'   r,   r-   r   r   r   r   r   r   D   s^    4#%DTDXDX 6 7! 7!r <L<P<P 1 1f@
 r   r   N)r   Z
__future__r    Z__id__Z__version__Z__date__Z
__author__Z__copyright__Z__license__Zenumr   r   Ztypingr   r   r   r   r   r   r   r   r   r   <module>r.      sX   0 #	(
:   t *H4S> Hr   