# Path: twip/constant.py
# DATA_PATH = os.path.abspath(os.path.join(BASE_PATH, '..', 'data'))


from past.builtins import basestring
from twip.constant import DATA_PATH
from IPython.display import display, HTML 
from pug.nlp.regex import url
import os
import pandas as pd
import string
import matplotlib
import gzip
# That's not good.  
# Can you fix it?  
# Anything else we might be messing up?  
# *what other punctuation marks have special meaning in Tweets*  

# In[ ]:

# improve on the "stopword" filters here
#
# :-) (ask me about a smilie lexicon)
# not-so-simple words? (ask me about a regex for compound words)
# python variables names with underscores? (regex)


# In[7]:

f = os.path.join(DATA_PATH, 'text.csv.gz')
df.to_csv(f, encoding='utf8', compression='gzip', quoting=pd.io.common.csv.QUOTE_NONNUMERIC)


# In[9]:

with gzip.open(os.path.join(DATA_PATH, 'text.csv.gz'), 'wb') as f:
    df.to_csv(f, encoding='utf8', quoting=pd.io.common.csv.QUOTE_NONNUMERIC)


# Make sure you can read it back in!

# In[10]:


# Path: twip/constant.py
# DATA_PATH = os.path.abspath(os.path.join(BASE_PATH, '..', 'data'))


# Path: docs/notebooks/07 Features -- Text.py
from past.builtins import basestring
from twip.constant import DATA_PATH
from IPython.display import display, HTML 
from pug.nlp.regex import url
import os
import pandas as pd
import string
import matplotlib
import gzip

# That's not good.  
# Can you fix it?  
# Anything else we might be messing up?  
# *what other punctuation marks have special meaning in Tweets*  

# In[ ]:

# improve on the "stopword" filters here
#
# :-) (ask me about a smilie lexicon)
# not-so-simple words? (ask me about a regex for compound words)
# python variables names with underscores? (regex)


# In[7]:

f = os.path.join(DATA_PATH, 'text.csv.gz')
df.to_csv(f, encoding='utf8', compression='gzip', quoting=pd.io.common.csv.QUOTE_NONNUMERIC)


# In[9]:

with gzip.open(os.path.join(DATA_PATH, 'text.csv.gz'), 'wb') as f:
    df.to_csv(f, encoding='utf8', quoting=pd.io.common.csv.QUOTE_NONNUMERIC)


# Make sure you can read it back in!

# In[10]:


df = pd.DataFrame.from_csv(os.path.join(DATA_PATH, 'text.csv.gz'))