-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinitialization.py
More file actions
62 lines (55 loc) · 1.71 KB
/
Copy pathinitialization.py
File metadata and controls
62 lines (55 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#! /usr/bin/python3
import string
import shelve,time
from nltk.corpus import wordnet
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk import WordPunctTokenizer
class Initialization:
def initializeStopWords(self):
#initialize stopwords
#remove some of them
self.stop_words = list(stopwords.words("english"))
self.stop_words.remove('of')
self.stop_words.remove('not')
self.stop_words.remove('is')
self.stop_words.remove('nor')
self.stop_words.remove('and')
self.stop_words.remove('or')
self.stop_words.remove('but')
self.stop_words.remove('did')
self.stop_words.remove('more')
self.stop_words.remove('most')
self.stop_words.remove('where')
self.stop_words.remove('who')
self.stop_words.remove('what')
self.stop_words.remove('which')
self.stop_words.remove('how')
self.stop_words.remove('when')
self.stop_words.remove('above')
self.stop_words.remove('below')
self.stop_words.remove('before')
self.stop_words.remove('after')
self.stop_words.remove('me')
self.stop_words.append('whose')
self.stop_words.append('tell')
self.stop_words.append('give')
self.stop_words.append('display')
self.stop_words.append('list')
self.stop_words.append('print')
self.stop_words.append('show')
self.stop_words.append('select')
self.stop_words.append('fetch')
self.stop_words.append('search')
self.stop_words.append('get')
self.stop_words.append('want')
return self.stop_words
def initializePunctList(self):
self.punct_list = list(string.punctuation)
self.punct_list.remove('<')
self.punct_list.remove('>')
self.punct_list.remove('!')
self.punct_list.remove('=')
self.punct_list.remove('*')
self.punct_list.remove('/')
return self.punct_list