+
    ÖÇÜhî-  ã                   óL  € R t ^ RIt^ RI5 ^ RI5 ]P                  ! R4      t]P                  ! R4      t]P                  ! R4      t]P                  ! R4      t]P                  ! R4      t	]P                  ! R4      t
]P                  ! R	4      t ! R
 R4      t ! R R]4      tR# )aÏ  
CorpusReader for the Comparative Sentence Dataset.

- Comparative Sentence Dataset information -

Annotated by: Nitin Jindal and Bing Liu, 2006.
              Department of Computer Sicence
              University of Illinois at Chicago

Contact: Nitin Jindal, njindal@cs.uic.edu
         Bing Liu, liub@cs.uic.edu (https://www.cs.uic.edu/~liub)

Distributed with permission.

Related papers:

- Nitin Jindal and Bing Liu. "Identifying Comparative Sentences in Text Documents".
   Proceedings of the ACM SIGIR International Conference on Information Retrieval
   (SIGIR-06), 2006.

- Nitin Jindal and Bing Liu. "Mining Comprative Sentences and Relations".
   Proceedings of Twenty First National Conference on Artificial Intelligence
   (AAAI-2006), 2006.

- Murthy Ganapathibhotla and Bing Liu. "Mining Opinions in Comparative Sentences".
    Proceedings of the 22nd International Conference on Computational Linguistics
    (Coling-2008), Manchester, 18-22 August, 2008.
N)Ú*z^\*+$z<cs-[1234]>z</cs-[1234]>z
<cs-[123]>z<cs-4>z(\d)_((?:[\.\w\s/-](?!\d_))+)z\(([^\(]*)\)$c                   ó4   a € ] tR t^3t o RtRR ltR tRtV tR# )Ú
ComparisonzF
A Comparison represents a comparative sentence and its constituents.
Nc                óN   € Wn         W n        W0n        W@n        WPn        W`n        R# )a  
:param text: a string (optionally tokenized) containing a comparison.
:param comp_type: an integer defining the type of comparison expressed.
    Values can be: 1 (Non-equal gradable), 2 (Equative), 3 (Superlative),
    4 (Non-gradable).
:param entity_1: the first entity considered in the comparison relation.
:param entity_2: the second entity considered in the comparison relation.
:param feature: the feature considered in the comparison relation.
:param keyword: the word or phrase which is used for that comparative relation.
N)ÚtextÚ	comp_typeÚentity_1Úentity_2ÚfeatureÚkeyword)Úselfr   r   r   r	   r
   r   s   &&&&&&&ÚF/usr/lib/python3/dist-packages/nltk/corpus/reader/comparative_sents.pyÚ__init__ÚComparison.__init__8   s"   € ð& Œ	Ø"ŒØ ŒØ ŒØŒØŽó    c                ó¦   € R P                  V P                  V P                  V P                  V P                  V P
                  V P                  4      # )z]Comparison(text="{}", comp_type={}, entity_1="{}", entity_2="{}", feature="{}", keyword="{}"))Úformatr   r   r   r	   r
   r   )r   s   &r   Ú__repr__ÚComparison.__repr__R   s@   € ð*ç
‰&Ø�I‰IØ�N‰NØ�M‰MØ�M‰MØ�L‰LØ�L‰Ló
ð
	
r   )r   r   r	   r
   r   r   )NNNNNN)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r   3   s   ø‡ € ñô÷4
ð 
r   r   c                   óˆ   a € ] tR t^`t o Rt]t]! 4       RR3R ltRR lt	RR lt
R tRR ltRR	 ltR
 tR tR tR tRtV tR# )Ú ComparativeSentencesCorpusReaderaO  
Reader for the Comparative Sentence Dataset by Jindal and Liu (2006).

    >>> from nltk.corpus import comparative_sentences
    >>> comparison = comparative_sentences.comparisons()[0]
    >>> comparison.text # doctest: +NORMALIZE_WHITESPACE
    ['its', 'fast-forward', 'and', 'rewind', 'work', 'much', 'more', 'smoothly',
    'and', 'consistently', 'than', 'those', 'of', 'other', 'models', 'i', "'ve",
    'had', '.']
    >>> comparison.entity_2
    'models'
    >>> (comparison.feature, comparison.keyword)
    ('rewind', 'more')
    >>> len(comparative_sentences.comparisons())
    853
NÚutf8c                óX   € \         P                  WW%4       W0n        W@n        RV n        R# )a~  
:param root: The root directory for this corpus.
:param fileids: a list or regexp specifying the fileids in this corpus.
:param word_tokenizer: tokenizer for breaking sentences or paragraphs
    into words. Default: `WhitespaceTokenizer`
:param sent_tokenizer: tokenizer for breaking paragraphs into sentences.
:param encoding: the encoding that should be used to read the corpus.
z
README.txtN)ÚCorpusReaderr   Ú_word_tokenizerÚ_sent_tokenizerÚ_readme)r   ÚrootÚfileidsÚword_tokenizerÚsent_tokenizerÚencodings   &&&&&&r   r   Ú)ComparativeSentencesCorpusReader.__init__t   s'   € ô" 	×Ñ˜d¨'Ô<Ø-ÔØ-ÔØ#ˆŽr   c                ó   € 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 )zé
Return all comparisons in the corpus.

:param fileids: a list or regexp specifying the ids of the files whose
    comparisons have to be returned.
:return: the given file(s) as a list of Comparison objects.
:rtype: list(Comparison)
T©r*   )Ú_fileidsÚ
isinstanceÚstrÚconcatÚabspathsÚ
CorpusViewÚ_read_comparison_block©r   r'   ÚpathÚencÚfileids   &&   r   ÚcomparisonsÚ,ComparativeSentencesCorpusReader.comparisonsŠ   sz   € ð Š?Ø—m‘m‰GÜ˜¤×%Ò%Ø�iˆGÜð ,0¯=©=¸À$ÈÔ+Mõá+MÑ'�T ð —‘ ×&AÑ&AÈC�ÖPÙ+Móó
ð 	
ùôs   Á)A9c                ó
  € \        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      pV Uu0 uF  qf'       g   K  VP	                  4       kK  	  ppV# u upppi u upi )zö
Return a set of all keywords used in the corpus.

:param fileids: a list or regexp specifying the ids of the files whose
    keywords have to be returned.
:return: the set of keywords and comparative phrases used in the corpus.
:rtype: set(str)
Tr-   )r1   r2   r3   Ú_read_keyword_blockÚlower)r   r'   r6   r7   r8   Úall_keywordsr   Úkeywords_sets   &&      r   ÚkeywordsÚ)ComparativeSentencesCorpusReader.keywordsž   s‚   € ô ð ,0¯=©=¸À$ÈÔ+Mõá+MÑ'�T ð —‘ ×&>Ñ&>È�ÖMÙ+Móó
ˆñ 8DÓO±|¨GÃwœ˜Ÿ™ž±|ˆÐOØÐùôùò Ps   �)A9Á	B Á!B c                óD  € . pV P                  R4      ;_uu_ 4       pVP                  4       pRRR4       XP                  R4       FC  pV'       d   VP                  R4      '       d   K$  VP	                  VP                  4       4       KE  	  V#   + '       g   i     Lj; i)zj
Return the list of words and constituents considered as clues of a
comparison (from listOfkeywords.txt).
zlistOfkeywords.txtNÚ
z//)ÚopenÚreadÚsplitÚ
startswithÚappendÚstrip)r   r@   ÚfpÚraw_textÚlines   &    r   Úkeywords_readmeÚ0ComparativeSentencesCorpusReader.keywords_readme±   st   € ð
 ˆØ�Y‰YÐ+×,Ô,°Ø—w‘w“yˆH÷ -à—N‘N 4Ö(ˆDß˜4Ÿ?™?¨4×0Ò0ÙØ�O‰O˜DŸJ™J›LÖ)ñ )ð ˆ÷ -×,ús   œBÂB	c                ó¬   € \        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 sentences in the corpus.

:param fileids: a list or regexp specifying the ids of the files whose
    sentences have to be returned.
:return: all sentences of the corpus as lists of tokens (or as plain
    strings, if no word tokenizer is specified).
:rtype: list(list(str)) or list(str)
Tr-   )r1   r2   r3   Ú_read_sent_blockr5   s   &&   r   ÚsentsÚ&ComparativeSentencesCorpusReader.sents¿   sX   € ô ð ,0¯=©=¸À$ÈÔ+Mõá+MÑ'�T ð —‘ ×&;Ñ&;Àc�ÖJÙ+Móó
ð 	
ùôó   �)Ac                ó¬   € \        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 )zù
Return all words and punctuation symbols in the corpus.

: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)
Tr-   )r1   r2   r3   Ú_read_word_blockr5   s   &&   r   ÚwordsÚ&ComparativeSentencesCorpusReader.wordsÐ   sX   € ô ð ,0¯=©=¸À$ÈÔ+Mõá+MÑ'�T ð —‘ ×&;Ñ&;Àc�ÖJÙ+Móó
ð 	
ùôrS   c                ó   €  VP                  4       pV'       g   . # \        P                  ! \        V4      pV'       g   K@  \        P                  ! \        V4      p\        P                  ! \
        V4      pVP                  4       P                  4       pV P                  '       d   V P                  P                  V4      pVP                  4        . pV'       Ed   V EF  p\        \        P                  ! RV4      P                  ^4      4      p	\        WiR7      p
VP                  4       p\        P                  V4      pV'       df   V F_  w  rÍVR8X  d   VP                  4       V
n        K#  VR8X  d   VP                  4       V
n        KA  VR8X  g   KJ  VP                  4       V
n        Ka  	  \"        P                  V4      pV'       d   V^ ,          V
n        VP'                  V
4       EK  	  V'       dV   V FO  p\        \        P                  ! RV4      P                  ^4      4      p	\        WiR7      p
VP'                  V
4       KQ  	  V# )Tz	<cs-(\d)>)r   r   Ú1Ú2Ú3)ÚreadlineÚreÚfindallÚ
COMPARISONÚGRAD_COMPARISONÚNON_GRAD_COMPARISONrI   r#   ÚtokenizeÚintÚmatchÚgroupr   ÚENTITIES_FEATSr   r	   r
   ÚKEYWORDr   rH   )r   ÚstreamrL   Úcomparison_tagsÚgrad_comparisonsÚnon_grad_comparisonsÚcomparison_textÚcomparison_bundleÚcompr   Ú
comparisonÚentities_featsÚcodeÚentity_featr   s   &&             r   r4   Ú7ComparativeSentencesCorpusReader._read_comparison_blockà   sÏ  € ØØ—?‘?Ó$ˆDßØ�	Ü Ÿjšj¬°TÓ:ˆOß‰Ü#%§:¢:¬o¸tÓ#DÐ Ü')§z¢zÔ2EÀtÓ'LÐ$à"(§/¡/Ó"3×"9Ñ"9Ó";�Ø×'×'Ð'Ø&*×&:Ñ&:×&CÑ&CÀOÓ&T�Oà—‘Ô!ð %'Ð!ß#Ð#ä 0˜Ü$'¬¯ª°¸tÓ(D×(JÑ(JÈ1Ó(MÓ$N˜	Ü%/Ø!0ô&˜
ð  &Ÿ™Ó0˜Ü)7×)?Ñ)?ÀÓ)E˜ß)Û5CÑ 1 Ø#'¨3¤;Ø:E×:KÑ:KÓ:M JÖ$7Ø%)¨S¤[Ø:E×:KÑ:KÓ:M JÖ$7Ø%)¨S¦[Ø9D×9JÑ9JÓ9L JÖ$6ñ 6Dô #*§/¡/°$Ó"7˜ß"Ø18¸µ˜JÔ.Ø)×0Ñ0°×<ñ% !1÷* (Û 4˜ä$'¬¯ª°¸tÓ(D×(JÑ(JÈ1Ó(MÓ$N˜	Ü%/Ø!0ô&˜
ð *×0Ñ0°Ö<ñ !5ð )Ð(r   c                óp   € . pV P                  V4       F  pVP                  VP                  4       K   	  V# ©N)r4   rH   r   )r   rh   r@   ro   s   &&  r   r<   Ú4ComparativeSentencesCorpusReader._read_keyword_block  s3   € ØˆØ×5Ñ5°fÖ=ˆJØ�O‰O˜J×.Ñ.Ö/ñ >àˆr   c                óˆ  €  VP                  4       p\        P                  ! \        V4      '       d8    VP                  4       p\        P                  ! \        V4      '       g   K4   Ki  \        P                  ! \
        V4      '       d   KŒ  \        P	                  V4      '       d   K©  \        P                  ! \        V4      '       d   KÌ  V P                  '       dE   V P                  P                  V4       Uu. uF  pV P                  P                  V4      NK   	  up# V P                  P                  V4      .# u upi )T)r\   r]   rd   ÚSTARSr^   r_   rf   ÚCLOSE_COMPARISONr$   rb   r#   )r   rh   rL   Úsents   &&  r   rP   Ú1ComparativeSentencesCorpusReader._read_sent_block  sí   € ØØ—?‘?Ó$ˆDÜ�xŠxœ˜t×$Ò$ØØ!Ÿ?™?Ó,�DÜ—x’x¤ t×,Ô,ØÙä—J’Jœz¨4×0Ô0Ü&×.Ñ.¨t×4Ô4ÜŸ
š
Ô#3°T×:Ô:à×'×'Ð'ð %)×$8Ñ$8×$AÑ$AÀ$Ô$Góá$G˜Dð ×,Ñ,×5Ñ5°dÖ;Ù$Gñð ð
 !×0Ñ0×9Ñ9¸$Ó?Ð@Ð@ùòs   Ã<$D?c                ó\   € . pV P                  V4       F  pVP                  V4       K  	  V# ru   )rP   Úextend)r   rh   rV   rz   s   &&  r   rU   Ú1ComparativeSentencesCorpusReader._read_word_block1  s-   € ØˆØ×)Ñ)¨&Ö1ˆDØ�L‰L˜Öñ 2àˆr   )r%   r$   r#   ru   )r   r   r   r   r   ÚStreamBackedCorpusViewr3   ÚWhitespaceTokenizerr   r9   r@   rM   rQ   rV   r4   r<   rP   rU   r   r   r   s   @r   r   r   `   sX   ø‡ € ñð" (€Jñ +Ó,ØØô$ô,
ô(ò&ô
ô"
ò 3)òjòA÷,ð r   r   )r   r]   Únltk.corpus.reader.apiÚnltk.tokenizeÚcompilerx   r_   ry   r`   ra   rf   rg   r   r"   r   © r   r   Ú<module>r…      s–   ðñó8 
ä $Ü ð 	�
Š
�8Ó€Ø�ZŠZ˜Ó'€
Ø—:’:˜oÓ.Ð Ø—*’*˜]Ó+€Ø—j’j Ó+Ð Ø—’Ð<Ó=€Ø
�*Š*Ð%Ó
&€÷*
ñ *
ôZU |ö Ur   