
    '[f                     b    d Z ddlT ddlT ddlmZmZ  G d de          Z G d de          Z	dS )	z
Indian Language POS-Tagged Corpus
Collected by A Kumaran, Microsoft Research, India
Distributed with permission

Contents:
  - Bangla: IIT Kharagpur
  - Hindi: Microsoft Research India
  - Marathi: IIT Bombay
  - Telugu: IIIT Hyderabad
    )*)map_tag	str2tuplec                   2    e Zd ZdZddZddZddZddZdS )	IndianCorpusReaderz@
    List of words, one per line.  Blank lines are ignored.
    Nc                 \    t          d |                     |d          D                       S )Nc                 8    g | ]\  }}t          ||d d           S )FIndianCorpusView.0fileidencs      M/var/www/piapp/venv/lib/python3.11/site-packages/nltk/corpus/reader/indian.py
<listcomp>z,IndianCorpusReader.words.<locals>.<listcomp>!   s:       !VS !eU;;      Tconcatabspathsselffileidss     r   wordszIndianCorpusReader.words   >     %)]]7D%A%A  
 
 	
r   c                      r j         k    r fdnd t          fd                     |d          D                       S )Nc                 0    t          j        |           S Nr   _tagsettr   tagsets    r   <lambda>z1IndianCorpusReader.tagged_words.<locals>.<lambda>)       WT\61-M-M r   c           	      <    g | ]\  }}t          ||d d          S )TFr
   r   r   r   tag_mapping_functions      r   r   z3IndianCorpusReader.tagged_words.<locals>.<listcomp>-   s>       !VS !dE;OPP  r   Tr   r   r   r   r   r"   r'   s   ` `@r   tagged_wordszIndianCorpusReader.tagged_words'   z     	(f,,#M#M#M#M#M  #'    %)]]7D%A%A  
 
 	
r   c                 \    t          d |                     |d          D                       S )Nc                 8    g | ]\  }}t          ||d d          S )FTr
   r   s      r   r   z,IndianCorpusReader.sents.<locals>.<listcomp>5   s:       !VS !eT::  r   Tr   r   s     r   sentszIndianCorpusReader.sents3   r   r   c                      r j         k    r fdnd t          fd                     |d          D                       S )Nc                 0    t          j        |           S r   r   r    s    r   r#   z1IndianCorpusReader.tagged_sents.<locals>.<lambda>=   r$   r   c           	      <    g | ]\  }}t          ||d d           S )Tr
   r&   s      r   r   z3IndianCorpusReader.tagged_sents.<locals>.<listcomp>A   s>       !VS !dD:NOO  r   Tr(   r)   s   ` `@r   tagged_sentszIndianCorpusReader.tagged_sents;   r+   r   r   )NN)__name__
__module____qualname____doc__r   r*   r.   r2    r   r   r   r      sn         
 
 
 


 

 

 


 
 
 


 

 

 

 

 

r   r   c                       e Zd Z	 ddZd ZdS )r   Nc                 j    || _         || _        || _        t                              | ||           d S )N)encoding)_tagged_group_by_sent_tag_mapping_functionStreamBackedCorpusView__init__)r   corpus_filer:   taggedgroup_by_sentr'   s         r   r?   zIndianCorpusView.__init__I   s<     +%9"''kH'MMMMMr   c                      |                                 }|                    d          rg S d |                                D             } j        r fd|D             } j        sd |D             } j        r|gS |S )N<c                 0    g | ]}t          |d           S )_)sep)r   )r   words     r   r   z/IndianCorpusView.read_block.<locals>.<listcomp>U   s%    BBBT	$C(((BBBr   c                 D    g | ]\  }}|                     |          fS r7   )r=   )r   wr!   r   s      r   r   z/IndianCorpusView.read_block.<locals>.<listcomp>W   s0    JJJ6AqQ221556JJJr   c                     g | ]\  }}|S r7   r7   )r   rJ   r!   s      r   r   z/IndianCorpusView.read_block.<locals>.<listcomp>Y   s    )))&1aA)))r   )readline
startswithsplitr=   r;   r<   )r   streamlinesents   `   r   
read_blockzIndianCorpusView.read_blockQ   s      ??3 	IBBTZZ\\BBB% 	KJJJJTJJJD| 	*))D)))D 	6MKr   r   )r3   r4   r5   r?   rR   r7   r   r   r   r   H   s>        QUN N N N    r   r   N)
r6   nltk.corpus.reader.apinltk.corpus.reader.utilnltk.tagr   r   CorpusReaderr   r>   r   r7   r   r   <module>rW      s   
 
 % $ $ $ % % % % ' ' ' ' ' ' ' '+
 +
 +
 +
 +
 +
 +
 +
\    -     r   