def strip_text(text):
    smileys = ':-) :) :o) :] :3 :c) :> =] 8) =) :} :^) \n                :D 8-D 8D x-D xD X-D XD =-D =D =-3 =3 B^D'.split()
    pattern = '|'.join(map(re.escape, smileys))
    kaomojis = (((('[^0-9A-Za-zぁ-んァ-ン一-龥ovっつ゜ニノ三二]' + '[\\(∩\u3000（]') + '[^0-9A-Za-zぁ-んァ-ン一-龥ｦ-ﾟ\\)∩\u3000）]') + '[\\)∩\u3000）]') + '[^0-9A-Za-zぁ-んァ-ン一-龥ovっつ゜ニノ三二]*')
    text = text.lower()
    text = re.sub('((https?):((//)|(\\\\\\\\))+([\\w\\d:#@%/;$()~_?\\+-=\\\\\\.&](#!)?)*)', '', text)
    text = ' '.join([word for word in text.split() if (not word.endswith('…'))])
    text = re.sub(pattern, '', text)
    text = re.sub(kaomojis, '', text)
    text = strip_emoji(text)
    text = re.sub('[\\)\\( \\/\\.-\\][0-9]+[ \\)\\/\\.\\(-]', ' ', text)
    text = re.sub('\\([^()]*\\)', '', text)
    text = re.sub('[.,-_]', ' ', text)
    text = re.sub('@\\w+ ?', ' ', text)
    text = text.replace("'s", '')
    text = re.sub('\\W+', ' ', text)
    text = re.sub('[ ][0-9]+ ', '', text)
    text = ' '.join([word for word in text.split() if (word not in stopwords.words('english'))])
    text = ' '.join((word for word in tc.document(text).lemming().data))
    text = ' '.join([w for w in text.split() if (len(w) > 1)])
    return text
def strip_text(text):
    smileys = ':-) :) :o) :] :3 :c) :> =] 8) =) :} :^) \n                :D 8-D 8D x-D xD X-D XD =-D =D =-3 =3 B^D'.split()
    pattern = '|'.join(map(re.escape, smileys))
    kaomojis = (((('[^0-9A-Za-zぁ-んァ-ン一-龥ovっつ゜ニノ三二]' + '[\\(∩\u3000（]') + '[^0-9A-Za-zぁ-んァ-ン一-龥ｦ-ﾟ\\)∩\u3000）]') + '[\\)∩\u3000）]') + '[^0-9A-Za-zぁ-んァ-ン一-龥ovっつ゜ニノ三二]*')
    text = text.lower()
    text = re.sub('((https?):((//)|(\\\\\\\\))+([\\w\\d:#@%/;$()~_?\\+-=\\\\\\.&](#!)?)*)', , text)
    text = ' '.join([word for word in text.split() if (not word.endswith('…'))])
    text = re.sub(pattern, , text)
    text = re.sub(kaomojis, , text)
    text = strip_emoji(text)
    text = re.sub('[\\)\\( \\/\\.-\\][0-9]+[ \\)\\/\\.\\(-]', ' ', text)
    text = re.sub('\\([^()]*\\)', , text)
    text = re.sub('[.,-_]', ' ', text)
    text = re.sub('@\\w+ ?', ' ', text)
    text = text.replace("'s", )
    text = re.sub('\\W+', ' ', text)
    text = re.sub('[ ][0-9]+ ', , text)
    text = ' '.join([word for word in text.split() if (word not in stopwords.words('english'))])
    text = ' '.join((word for word in tc.document(text).lemming().data))
    text = ' '.join([w for w in text.split() if (len(w) > 1)])
    return text