Python Forum
What is distinction between 'sent3' and 'set(sent3)'?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is distinction between 'sent3' and 'set(sent3)'?
#3
OK. Understood. The question extends to the following operations. If 'set(sent3)' generates the distinct token total for sentence 3, and 'set(text1)' generates the distinct token total for text 1, clearly the former operation is less than the latter. However, when I substitute 'sent3' for 'sent2' [i.e. set(sent2) < set(text1)] why is the output 'false', when the former operation [i.e. set(sent3) < set(text1)] is 'true'? Irrespective of which sentence, the vocabulary total for these 2 sentences (or any singular sentence as a general rule) will always be less than the vocabulary total of an entire text [i.e. set(text1)]. The code is below:

>>> set(sent2) < set(text1)
[output]False[/output]
>>> set(sent3) < set(text1)
[output]True[/output]
>>> set(sent4) < set(text1)
[output]False[/output]
>>> set(sent5) < set(text1)
[output]False[/output]
>>> set(sent6) < set(text1)
[output]False[/output]
>>> set(sent7) < set(text1)
[output]False[/output]
>>> set(sent8) < set(text1)
[output]False[/output]
>>> set(sent9) < set(text1)
[output]False [/output]  
Reply


Messages In This Thread
RE: What is distinction between 'sent3' and 'set(sent3)'? - by AOCL1234 - Jul-09-2020, 03:30 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020