This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"products": [ | |
{ | |
"productId": 1, | |
"purchaseable": true, | |
"prices": { | |
"usd": 1750, | |
"gbp": 1250 | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request | |
import urllib.error | |
import urllib.parse | |
import re | |
from bs4 import BeautifulSoup | |
from bs4 import UnicodeDammit | |
lines = [] | |
base_url = "http://www.phonemicchart.com/transcribe/?w=%s" | |
output_file = open("output.txt", 'w', encoding='utf-8') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nltk | |
import re | |
from nltk.tokenize import word_tokenize, sent_tokenize | |
text = "I'm not going to the party." | |
words = word_tokenize(text) | |
pos_tags = nltk.pos_tag(words) | |
print (pos_tags) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
act | 0 | |
be | 6 | |
begin | 0 | |
believe | 0 | |
break | 0 | |
call | 0 | |
can | 5 | |
change | 0 | |
choose | 0 | |
clean | 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
act | |
be | |
begin | |
believe | |
break | |
call | |
can | |
change | |
choose | |
clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ruby... Ruby, can you hear me? | |
Moli? Moli, where are you? | |
Moli? | |
Ruby, I've crashed. | |
Yeah... But where? | |
I'm hurt, Ruby. Can you find me? | |
Okay, I can see plants. | |
I can see rocks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nltk | |
import re | |
from nltk.tokenize import word_tokenize | |
from nltk.stem import WordNetLemmatizer | |
input_file = "./input.txt" | |
words_file = "./words.txt" | |
output_file = "./output.txt" | |
curriculum_words = [] | |
pos_tagged_array = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nltk.stem import WordNetLemmatizer | |
wordnet_lemmatizer = WordNetLemmatizer() | |
print (wordnet_lemmatizer.lemmatize("geese")) | |
print (wordnet_lemmatizer.lemmatize("bottles", 'n')) | |
print (wordnet_lemmatizer.lemmatize("said", 'v')) | |
print (wordnet_lemmatizer.lemmatize("better", 'a')) | |
print (wordnet_lemmatizer.lemmatize("quickly", 'r')) |
NewerOlder