Skip to content

Commit b06fca1

Browse files
authored
how to start with nltk
downloading basic word lists
1 parent a12e495 commit b06fca1

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

README.md

+18-7
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,29 @@ while(i < 10):
115115
### Dictionaries
116116
key-value pairs.
117117
```python
118-
newDict = {'Google':100, 'Facebook':80, 'Apple':90}
118+
<dict> = {'Google':100, 'Facebook':80, 'Apple':90}
119119
120-
newDict['Amazon'] = 85 # Adding a key along with the value
120+
<dict>['Amazon'] = 85 # Adding a key along with the value
121121
122122
# Accessing the dictionary
123-
for key in newDict:
124-
print("{key} -> {x}".format(key=key, x=newDict[key]))
123+
for key in <dict>:
124+
print("{key} -> {x}".format(key=key, x=<dict>[key]))
125125
126-
len(newDict) # Find the length of the dictionary
127-
newDist.pop(<key>) # Removes the item with the specified key name
128-
newDict.copy() # Make a copy of a dictionary
126+
len(<dict>) # Find the length of the dictionary
127+
<dict>.pop(<key>) # Removes the item with the specified key name
128+
<dict>.copy() # Make a copy of a dictionary
129129
```
130130
A dictionary can also contain many dictionaries, this is called nested dictionaries.
131131
132+
## Third party libraries
133+
134+
### NLTK
135+
```python
136+
import nltk
137+
138+
# Before trying any function download the word list
139+
nltk.download('punkt')
140+
nltk.download('averaged_perceptron_tagger')
141+
```
142+
132143

0 commit comments

Comments
 (0)