forked from DaveGerson/SocialCorrespondenceAnalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfoodList.py
45 lines (39 loc) · 2.19 KB
/
foodList.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
# -*- coding: utf-8 -*-
__author__ = 'gerson64'
from stemming.porter2 import stem
import twitterImport
def unique(inList):
return list(set(inList))
food_words = ["Acidic", "Acrid", "Aged", "Bitter", "Bittersweet", "Bland", "Burnt", "Buttery", "Chalky", "Cheesy",
"Chewy",
"Chocolaty", "Citrusy", "Cool", "Creamy", "Crispy", "Crumbly", "Crunchy", "Crusty", "Doughy", "Dry",
"Earthy", "Eggy",
"Fatty", "Fermented", "Fiery", "Fishy", "Fizzy", "Flakey", "Flat", "Flavorful", "Fresh", "Fried",
"Fruity",
"Full-bodied", "Gamey", "(refers", "to", "the", "flavor", "or", "strong", "odor", "of", "game,",
"like", "Elk", "or",
"Deer.", "Garlicky", "Gelatinous", "Gingery", "Glazed", "Grainy", "Greasy", "Gooey", "Gritty",
"Harsh", "Hearty",
"Heavy", "Herbal", "Hot", "Icy", "Infused", "Juicy", "Lean", "Light", "Lemony", "Malty", "Mashed",
"Meaty", "Mellow",
"Mild", "Minty", "Moist", "Mushy", "Nutty", "Oily", "Oniony", "Overripe", "Pasty", "Peppery",
"Pickled", "Plain",
"Powdery", "Raw", "Refreshing", "Rich", "Ripe", "Roasted", "Robust", "Rubbery", "Runny", "Salty",
"Sautéed", "Savory",
"Seared", "Seasoned", "Sharp", "Silky", "Slimy", "Smokey", "Smothered", "Smooth", "Soggy", "Soupy",
"Sour", "Spicy",
"Spongy", "Stale", "Sticky", "Stale", "Stringy", "Strong", "Sugary", "or", "sweet", "Sweet-and-sour",
"Syrupy",
"Tangy", "Tart", "Tasteless", "Tender", "Toasted", "Tough", "Unflavored", "Unseasoned", "Velvety",
"Vinegary",
"Watery", "Whipped", "Woody", "Yeasty", "Zesty", "Zingy"]
food_words = [stem(word) for word in food_words]
def foodwordList(keyword):
tweets = twitterImport.getTweets(keyword)
tmpList = []
for tweet in tweets['statuses']:
tmpList.append([stem(word) for word in tweet['text'].split(" ")])
finalList = []
for list in tmpList:
finalList = finalList + list
return finalList