-
Notifications
You must be signed in to change notification settings - Fork 8
/
1.py
49 lines (29 loc) · 959 Bytes
/
1.py
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
import re
import textblob
import os
import sys
from textblob import TextBlob
from textblob import Word
from sentencecounter import no_sentences,getline
number_of_sentence = print (no_sentences())
# paragraph = "ITP is a two-year graduate program located in the Tisch School of the Arts. Perhaps the best way to describe us is as a Center for the Recently Possible."
blob = TextBlob(getline())
# for np in blob.noun_phrases:
# print (np)
# for noun , pos in blob.pos_tags:
# print (noun, pos);
## FIND ALL ASSOCIATED WORD
# print (bank.synsets)
# for sentencs in
# for word in blob.sentences[0].words:
# a = (Word(word)).synsets
# print ((word) ,a )
for i in range(no_sentences()):
for word in blob.sentences[i].words:
a = (Word(word)).synsets
# print ((word) ,a )
print (word)
# # bank = word
# synsets = Word("bank").synsets
# for synset in synsets:
# print (synset.defination())