+
    ÖÇÜh	  ã                   óL   € R t ^ RIHt ^ RI5  ! R R]4      t ! R R]4      tR# )a
  
CorpusReader for the Opinion Lexicon.

Opinion Lexicon information
===========================

Authors: Minqing Hu and Bing Liu, 2004.
    Department of Computer Science
    University of Illinois at Chicago

Contact: Bing Liu, liub@cs.uic.edu
        https://www.cs.uic.edu/~liub

Distributed with permission.

Related papers:

- Minqing Hu and Bing Liu. "Mining and summarizing customer reviews".
    Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery
    & Data Mining (KDD-04), Aug 22-25, 2004, Seattle, Washington, USA.

- Bing Liu, Minqing Hu and Junsheng Cheng. "Opinion Observer: Analyzing and
    Comparing Opinions on the Web". Proceedings of the 14th International World
    Wide Web conference (WWW-2005), May 10-14, 2005, Chiba, Japan.
)ÚWordListCorpusReader)Ú*c                   ó*   a € ] tR t^&t o RtR tRtV tR# )ÚIgnoreReadmeCorpusViewzI
This CorpusView is used to skip the initial readme block of the corpus.
c                óÄ   € \         P                  ! V .VO5/ VB  V P                  4        \        V P                  4       V P                  P                  4       .V n        R # ©N)ÚStreamBackedCorpusViewÚ__init__Ú_openÚread_blankline_blockÚ_streamÚtellÚ_filepos)ÚselfÚargsÚkwargss   &*,ÚD/usr/lib/python3/dist-packages/nltk/corpus/reader/opinion_lexicon.pyr	   ÚIgnoreReadmeCorpusView.__init__+   sF   € Ü×'Ò'¨Ð>¨tÒ>°vÒ>à�
‰
Œä˜TŸ\™\Ô*àŸ™×*Ñ*Ó,Ð-ˆŽó    )r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r	   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r   &   s   ø‡ € ñ÷.ð .r   r   c                   óD   a € ] tR t^5t o Rt]tRR ltR tR t	R t
RtV tR# )	ÚOpinionLexiconCorpusReaderap  
Reader for Liu and Hu opinion lexicon.  Blank lines and readme are ignored.

    >>> from nltk.corpus import opinion_lexicon
    >>> opinion_lexicon.words()
    ['2-faced', '2-faces', 'abnormal', 'abolish', ...]

The OpinionLexiconCorpusReader provides shortcuts to retrieve positive/negative
words:

    >>> opinion_lexicon.negative()
    ['2-faced', '2-faces', 'abnormal', 'abolish', ...]

Note that words from `words()` method are sorted by file id, not alphabetically:

    >>> opinion_lexicon.words()[0:10] # doctest: +NORMALIZE_WHITESPACE
    ['2-faced', '2-faces', 'abnormal', 'abolish', 'abominable', 'abominably',
    'abominate', 'abomination', 'abort', 'aborted']
    >>> sorted(opinion_lexicon.words())[0:10] # doctest: +NORMALIZE_WHITESPACE
    ['2-faced', '2-faces', 'a+', 'abnormal', 'abolish', 'abominable', 'abominably',
    'abominate', 'abomination', 'abort']
Nc                ó   € Vf   V P                   pM\        V\        4      '       d   V.p\        V P	                  VRR4       UUUu. uF#  w  r#pV P                  W P                  VR7      NK%  	  uppp4      # u upppi )a&  
Return all words in the opinion lexicon. Note that these words are not
sorted in alphabetical order.

:param fileids: a list or regexp specifying the ids of the files whose
    words have to be returned.
:return: the given file(s) as a list of words and punctuation symbols.
:rtype: list(str)
T)Úencoding)Ú_fileidsÚ
isinstanceÚstrÚconcatÚabspathsÚ
CorpusViewÚ_read_word_block)r   ÚfileidsÚpathÚencÚfileids   &&   r   ÚwordsÚ OpinionLexiconCorpusReader.wordsO   sz   € ð Š?Ø—m‘m‰GÜ˜¤×%Ò%Ø�iˆGÜð ,0¯=©=¸À$ÈÔ+Mõá+MÑ'�T ð —‘ ×&;Ñ&;Àc�ÖJÙ+Móó
ð 	
ùôs   Á)A9c                ó$   € V P                  R4      # )zh
Return all positive words in alphabetical order.

:return: a list of positive words.
:rtype: list(str)
zpositive-words.txt©r-   ©r   s   &r   ÚpositiveÚ#OpinionLexiconCorpusReader.positived   ó   € ð �z‰zÐ.Ó/Ð/r   c                ó$   € V P                  R4      # )zh
Return all negative words in alphabetical order.

:return: a list of negative words.
:rtype: list(str)
znegative-words.txtr0   r1   s   &r   ÚnegativeÚ#OpinionLexiconCorpusReader.negativem   r4   r   c                ó    € . p\        ^4       F<  pVP                  4       pV'       g   K  VP                  VP                  4       4       K>  	  V# )é   )ÚrangeÚreadlineÚappendÚstrip)r   Ústreamr-   ÚiÚlines   &&   r   r(   Ú+OpinionLexiconCorpusReader._read_word_blockv   s@   € ØˆÜ�r–ˆAØ—?‘?Ó$ˆDßÙØ�L‰L˜Ÿ™›Ö&ñ	 ð
 ˆr   © r   )r   r   r   r   r   r   r'   r-   r2   r6   r(   r   r   r   s   @r   r   r   5   s*   ø‡ € ñð. (€Jô
ò*0ò0÷ð r   r   N)r   Únltk.corpus.readerr   Únltk.corpus.reader.apir   r   r   rB   r   r   Ú<module>rE      s.   ðñõ4 4Ü $ô.Ð3ô .ôHÐ!5ö Hr   