o
    i                     @   sH   d dl mZmZmZmZmZmZmZ G dd deZ	G dd deZ
dS )    )StdConstFstStdFstStdVectorFst_ArcIteratorStdConstFst_ArcIteratorStdVectorFst_StateIteratorStdConstFst_StateIteratorStdVectorFstc                   @   sJ   e Zd ZdefddZdd Zedd Zedd	 Zd
d Z	dd Z
dS )StateIteratorfstc                 C   s>   t |trt|| _d S t |trt|| _d S dt| NzUnsupported type: )
isinstancer   r   _implr   r   type)selfr
    r   E/home/ubuntu/.local/lib/python3.10/site-packages/kaldifst/iterator.py__init__   s
   

zStateIterator.__init__c                 c   .    | j js| j jV  | j   | j jrd S d S Nr   donevaluenextr   r   r   r   __iter__   
   

zStateIterator.__iter__c                 C      | j jS r   r   r   r   r   r   r   r         zStateIterator.donec                 C   r   r   r   r   r   r   r   r   r   !   r   zStateIterator.valuec                 C      | j   d S r   r   r   r   r   r   r   r   %      zStateIterator.nextc                 C   r    r   r   resetr   r   r   r   r$   (   r"   zStateIterator.resetN)__name__
__module____qualname__r   r   r   propertyr   r   r   r$   r   r   r   r   r	      s    

r	   c                   @   st   e Zd ZdedefddZdd Zedd Zed	d
 Z	edd Z
edd Zdd Zdd ZdefddZdS )ArcIteratorr
   statec                 C   sF   t |trt||| _d S t |trt||| _d S tdt| r   )r   r   r   r   r   r   
ValueErrorr   )r   r
   r*   r   r   r   r   -   s
   

zArcIterator.__init__c                 c   r   r   r   r   r   r   r   r   5   r   zArcIterator.__iter__c                 C   r   r   r   r   r   r   r   r   :   r   zArcIterator.donec                 C   r   r   r   r   r   r   r   r   >   r   zArcIterator.valuec                 C   r   r   )r   positionr   r   r   r   r,   B   r   zArcIterator.positionc                 C   r   r   )r   flagsr   r   r   r   r-   F   r   zArcIterator.flagsc                 C   
   | j  S r   r!   r   r   r   r   r   J      
zArcIterator.nextc                 C   r.   r   r#   r   r   r   r   r$   M   r/   zArcIterator.resetac                 C   s   | j |S r   )r   seek)r   r0   r   r   r   r1   P   s   zArcIterator.seekN)r%   r&   r'   r   intr   r   r(   r   r   r,   r-   r   r$   r1   r   r   r   r   r)   ,   s    



r)   N)	_kaldifstr   r   r   r   r   r   r   objectr	   r)   r   r   r   r   <module>   s   $