Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
afnan47
GitHub Repository: afnan47/sem7
Path: blob/main/IR/Assignment 3/three_stopWord.py
418 views
1
import io
2
from nltk.corpus import stopwords
3
from nltk.tokenize import word_tokenize
4
5
6
stop_words = set(stopwords.words('english'))
7
file1 = open("text.txt")
8
9
10
line = file1.read()
11
words = line.split()
12
for r in words:
13
if not r in stop_words:
14
appendFile = open('filteredtext.txt','a')
15
appendFile.write(" "+r)
16
appendFile.close()
17
18
19
#INPUT
20
# Jane Austen’s Pride and Prejudice is an 18th-century novel of manners set in rural
21
# England and portraying the relationships between the four daughters of the Bennet
22
# family and their neighbors. While accurately and vividly depicting the manners and
23
# social norms of that time, the novel also provides sharp observations on the
24
# themes of love, marriage, class, money, education, and social prestige. In
25
# this paper, the four main themes of Pride and Prejudice are analyzed. Marriage
26
# is the main topic around which the plot revolves. The author illustrates the
27
# conflict between marrying for money, which was the typical idea at the time,
28
# and marrying for love. In either case, the economic and social differences were
29
# obstacles which made it hard for young women from poor families to break out of
30
# their social circle. Each person’s position in society was determined by their
31
# class, and the relations between families also centered around differences in wealth
32
# and status. The gender differences also played an important role, as women were
33
# considered inferior to men and were practically unable to choose partners. Austen
34
# both criticizes and examines the social life of 18th-century England, advocating for
35
# marrying for love as one of the essential female rights.
36
37
38
#OUTPUT
39
# Jane Austen’s Pride Prejudice 18th-century novel manners set rural England
40
# portraying relationships four daughters Bennet family neighbors. While accurately
41
# vividly depicting manners social norms time, novel also provides
42
# sharp observations themes love, marriage, class, money, education, social prestige.
43
# In paper, four main themes Pride Prejudice analyzed. Marriage main topic around
44
# plot revolves. The author illustrates conflict marrying money, typical idea
45
# time, marrying love. In either case, economic social differences obstacles made
46
# hard young women poor families break social circle. Each person’s position
47
# society determined class, relations families also centered around differences
48
# wealth status. The gender differences also played important role, women
49
# considered inferior men practically unable choose partners. Austen criticizes examines
50
# social life 18th-century England, advocating marrying love one essential female rights.
51
52