o
    if                     @   sn   d dl Z d dlmZ d dlmZ d dlmZmZ d dlm	Z	 d dl
mZ d dlmZmZ G dd	 d	eeZdS )
    N)AbbreviationReplacer)BetweenPunctuation)CommonStandard)replace_punctuation)Cleaner)TextRulec                   @   s@   e Zd ZdZG dd deZG dd deZG dd deZdS )	Japanesejac                       s.   e Zd Zd fdd	Zdd Zdd Z  ZS )	zJapanese.CleanerNc                    s   t  || d S Nsuper__init__)selftextlangdoc_type	__class__ L/var/www/html/corbot_env/lib/python3.10/site-packages/pysbd/lang/japanese.pyr      s   zJapanese.Cleaner.__init__c                 C      |    | jS r   ) remove_newline_in_middle_of_wordr   r   r   r   r   clean      zJapanese.Cleaner.cleanc                 C   s    t dd}t| j|| _d S )Nu   (?<=の)\n(?=\S) )r	   r   r   apply)r   NewLineInMiddleOfWordRuler   r   r   r      s   
z1Japanese.Cleaner.remove_newline_in_middle_of_wordr   )__name__
__module____qualname__r   r   r   __classcell__r   r   r   r   r      s    r   c                   @   s   e Zd Zg ZdS )zJapanese.AbbreviationReplacerN)r    r!   r"   SENTENCE_STARTERSr   r   r   r   r      s    r   c                       s<   e Zd Z fddZdd Zdd Zdd Zd	d
 Z  ZS )zJapanese.BetweenPunctuationc                    s   t  | d S r   r   )r   r   r   r   r   r       s   z$Japanese.BetweenPunctuation.__init__c                 C   r   r   ))sub_punctuation_between_quotes_and_parensr   r   r   r   r   replace#   r   z#Japanese.BetweenPunctuation.replacec                 C      d}t |t| j| _d S )Nu0   （(?=(?P<tmp>[^（）]+|\\{2}|\\.)*)(?P=tmp)）resubr   r   )r   BETWEEN_PARENS_JA_REGEXr   r   r   !sub_punctuation_between_parens_ja'      
z=Japanese.BetweenPunctuation.sub_punctuation_between_parens_jac                 C   r'   )Nu0   「(?=(?P<tmp>[^「」]+|\\{2}|\\.)*)(?P=tmp)」r(   )r   BETWEEN_QUOTE_JA_REGEXr   r   r   !sub_punctuation_between_quotes_ja,   r-   z=Japanese.BetweenPunctuation.sub_punctuation_between_quotes_jac                 C   s   |    |   d S r   )r,   r/   r   r   r   r   r%   1   s   zEJapanese.BetweenPunctuation.sub_punctuation_between_quotes_and_parens)	r    r!   r"   r   r&   r,   r/   r%   r#   r   r   r   r   r      s    r   N)r    r!   r"   iso_coder   r   r   r   r   r   r   r
   
   s
    r
   )r)   pysbd.abbreviation_replacerr   pysbd.between_punctuationr   pysbd.lang.commonr   r   pysbd.punctuation_replacerr   pysbd.cleanerr   pysbd.utilsr   r	   r
   r   r   r   r   <module>   s   