o
    jo™i¦
  ã                   @   sp  d Z ddlZddlmZ e ddd¡Ze ddd	¡Ze d
d¡Ze eeed¡Ze dddddddddddddddddddd ¡Z	e ee	¡ 
¡  ¡ Ze e dd¡ee ee	¡ 
¡  d!e¡e e dd¡d!d!e¡  ¡ Zd"ed#ed$efd%d&„Zd"ed$efd'd(„Zd"ed$efd)d*„Zd"ed$efd+d,„Zd"ed$efd-d.„Zd"ed$efd/d0„Zd"ed$efd1d2„Zd"ed$efd3d4„ZdS )5u†  Sketch of Finnish case suffix rules.

This is loosely based on the "archiphonemic" treatment of harmony used by:

Koskenniemi, K. 1983. Two-Level Morphology: A General Computational Model for
Word-Form Recognition and Production. Doctoral dissertation, University of
Helsinki.

Seven of the nine locative cases are covered; the others pose additional
(archiphonemic) challenges.

* abessive ("without"): -tta, -ttÃ¤
* ablative ("from at/on"): -lta, -ltÃ¤
* adessive ("on"): -lla, -llÃ¤
* allative ("onto"): -lle
* elative ("from in"): -sta, -stÃ¤
* essive ("as a"): -na, -nÃ¤
* inessive ("in"): -ssa, -ssÃ¤

Gradation is not handled in any form.
é    N)ÚrewriteÚaÚoÚuõ   Ã¤õ   Ã¶ÚyÚeÚiÚAÚbÚcÚdÚfÚgÚhÚjÚkÚlÚmÚnÚpÚqÚrÚsÚtÚvÚwÚxÚzÚ ÚstemÚsuffixÚreturnc                 C   s   t  | | t¡S )z1Concatenates suffix and applies the harmony rule.)r   Úone_top_rewriteÚ_harmony)r!   r"   © r&   úH/home/ubuntu/.local/lib/python3.10/site-packages/pynini/examples/case.pyÚ_harmonic_suffix<   s   r(   c                 C   ó
   t | dƒS )NÚttA©r(   ©r!   r&   r&   r'   ÚabessiveA   ó   
r-   c                 C   r)   )NÚltAr+   r,   r&   r&   r'   ÚablativeE   r.   r0   c                 C   r)   )NÚllAr+   r,   r&   r&   r'   ÚadessiveI   r.   r2   c                 C   r)   )NÚller+   r,   r&   r&   r'   ÚallativeM   s   
r4   c                 C   r)   )NÚstAr+   r,   r&   r&   r'   ÚelativeR   r.   r6   c                 C   r)   )NÚnAr+   r,   r&   r&   r'   ÚessiveV   r.   r8   c                 C   r)   )NÚssAr+   r,   r&   r&   r'   ÚinessiveZ   r.   r:   )Ú__doc__ÚpyniniÚ
pynini.libr   ÚunionÚ_backÚ_frontÚ_neutralÚ_vÚ_cÚclosureÚoptimizeÚ_sigma_starÚ	cdrewriteÚcrossr%   Ústrr(   r-   r0   r2   r4   r6   r8   r:   r&   r&   r&   r'   Ú<module>   s:   ÿþÿþý	