o
    i                  
   @   s   d dl mZ d dlmZmZmZmZ d dlmZ ddl	m
Z
 ddlmZ ddlmZ eee  Zee Ze
dd	eeef fd
dZdeeef deded	eeef fddZdS )    )c_uint64)CallableListSequenceTuple)hash_unicode   )registry)Model)Ints2dzstrings2arrays.v1returnc                   C   s
   t dtS )z=Transform a sequence of string sequences to a list of arrays.strings2arrays)r
   forward r   r   O/home/ubuntu/.local/lib/python3.10/site-packages/thinc/layers/strings2arrays.pyr      s   
r   modelXsis_trainc                    sL   dd |D } fdd|D } fdd|D }dt dtfdd}||fS )	Nc                 S   s   g | ]	}d d |D qS )c                 S   s   g | ]	}t t|jqS r   )r   r   value).0wordr   r   r   
<listcomp>       z&forward.<locals>.<listcomp>.<listcomp>r   )r   Xr   r   r   r      r   zforward.<locals>.<listcomp>c                    s   g | ]
} j j|d dqS )uint64)dtype)ops	asarray1i)r   hr   r   r   r          c                    s   g | ]
} j |d dqS )   )r   	reshape2i)r   arrayr   r   r   r      r    dXr   c                 S   s   g S )Nr   )r%   r   r   r   backprop   s   zforward.<locals>.backprop)OutTInT)r   r   r   hasheshash_arraysarraysr&   r   r   r   r      s
   r   N)ctypesr   typingr   r   r   r   
murmurhashr   configr	   r   r
   typesr   strr(   r'   layersr   boolr   r   r   r   r   <module>   s    .