U
    e                     @   s@   d dl Z d dlmZ dd Zdd Zdd Zd	d
 Zdd ZdS )    N)hmmc                  C   s|   ddg} ddg}ddgddgg}ddgd	d
gg}ddg}dddddg}t t|d gt| }t| ||||}|| ||fS )NZrainzno rainumbrellazno umbrellagffffff?g333333?g?g?g?g?      ?)listziplenr   Z_create_hmm_tagger)statessymbolsABpiseqmodel r   X/var/www/html/assets/scripts/venv/lib/python3.8/site-packages/nltk/test/unit/test_hmm.py_wikipedia_example_hmm   s    r   c                  C   sR   ddl m}  t \}}}ddg}dddgddd	gg}d
|| }| || d S )Nr   assert_array_almost_equal)upNgffffff?g{Gz?g
ףp=
?gǺ?g rh?g48EG?   )numpy.testingr   r   Z_market_hmm_example_forward_probability)r   r   r   r	   r   expectedfpr   r   r   test_forward_probability   s    r   c                  C   sn   ddl m}  t \}}}}d|| }|j|jdd j}ddgdd	gd
dgddgddgg}| ||d d S )Nr   r   r      ZaxisgX2ı.?g48E?g0*D?g}bٽ?gqh?g?gmV}b?g&S:?gC?gHP?   )r   r   r   r   Tsum)r   r   r   r	   r   r   wikipedia_resultsr   r   r   test_forward_probability2%   s    r!   c                  C   sn   ddl m}  t \}}}}d|| }|j|jdd j}ddgdd	gd
dgddgddgg}| ||d d S )Nr   r   r   r   r   g2w-!?g?g_L?g|гY?gAf?g|a2U0?gPs?g_Q?r   r   )r   r   r   Z_backward_probabilityr   r   )r   r   r   r	   r   bpr    r   r   r   test_backward_probability9   s    r#   c                 C   s   t d d S )Nnumpy)pytestZimportorskip)moduler   r   r   setup_moduleQ   s    r'   )r%   Znltk.tagr   r   r   r!   r#   r'   r   r   r   r   <module>   s   