Jul-08-2020, 09:51 PM
What is the distinction between 'sent3' and 'set(sent3)', 'sent2' and 'set(sent2)', etc.? 'sent3' generates the tokens entailed in sentence 3, which makes sense, but 'set(sent3)' is unusually ordered. Here is the code (caveat, I am a novice at Python tags):
>>> sent3 [output]['In', 'the', 'beginning', 'God', 'created', 'the', 'heaven', 'and', 'the', 'earth', '.'][/output] >>> set(sent3) [output]{'created', '.', 'and', 'the', 'heaven', 'earth', 'God', 'In', 'beginning'}[/output] >>> sent2 [output]['The', 'family', 'of', 'Dashwood', 'had', 'long', 'been', 'settled', 'in', 'Sussex', '.'][/output] >>> set(sent2) [output]{'settled', 'long', 'been', 'of', 'The', 'Dashwood', 'had', 'in', 'Sussex', '.', 'family'}[/output]