a
    yn„fÚ  ã                   @  sX   d dl mZ d dlZd dlmZ d dlmZ dZedd�dddd	œd
d„ƒZ	dd„ Z
dS )é    )ÚannotationsN)Úhigh_level_function)ÚHighLevelContext)Útitlezak.str)ÚmoduleT)Ú	highlevelÚbehaviorÚattrsc                c  s   | fV  t | |||ƒS )a  
    Args:
        array: Array-like data (anything #ak.to_layout recognizes).
        highlevel (bool): If True, return an #ak.Array; otherwise, return
            a low-level #ak.contents.Content subclass.
        behavior (None or dict): Custom #ak.behavior for the output array, if
            high-level.
        attrs (None or dict): Custom attributes for the output array, if
            high-level.

    Replaces any string-valued data with a titlecase version (correctly
    transforming Unicode characters). Each word in the output will start with
    an uppercase character and its remaining characters will be lowercase.

    Replaces any bytestring-valued data with a titlecase version (transforming
    ASCII characters only). Each word in the output will start with an
    uppercase character and its remaining characters will be lowercase.

    Note: this function does not raise an error if the `array` does not
    contain any string or bytestring data.

    Requires the pyarrow library and calls
    [pyarrow.compute.utf8_title](https://arrow.apache.org/docs/python/generated/pyarrow.compute.utf8_title.html)
    or
    [pyarrow.compute.ascii_title](https://arrow.apache.org/docs/python/generated/pyarrow.compute.ascii_title.html)
    on strings and bytestrings, respectively.
    )Ú_impl)Úarrayr   r   r	   © r   úe/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/awkward/operations/str/akstr_title.pyr      s    r   c           	      C  sz   ddl m} |dƒ}t||d��}| | ¡}W d   ƒ n1 s@0    Y  tj |tjjj	|j
|jdd�¡}|j||d�S )Nr   )Úimport_pyarrow_computeÚe)r   r	   T)Zbytestring_to_string)r   )Zawkward._connect.pyarrowr   r   ÚunwrapÚakZ_doZrecursively_applyÚ
operationsÚstrZ_get_ufunc_actionZ
utf8_titleZascii_titleÚwrap)	r   r   r   r	   r   ZpcÚctxZlayoutÚoutr   r   r   r
   0   s    (
ÿþr
   )Ú
__future__r   Zawkwardr   Zawkward._dispatchr   Zawkward._layoutr   Ú__all__r   r
   r   r   r   r   Ú<module>   s   #