Exemplo n.º 1
0
from corpus import Corpus
import pandas as pd
from dateutil.parser import parse
import random
import os
import language_check
from textblob import TextBlob
import glob

corpus = Corpus()
templateCorpus = corpus.getTemplateCorpus()
textDictionary = corpus.getTextDictionary()
numericDictionary = corpus.getNumericDictionary()
tool = language_check.LanguageTool('en-US')

def is_date(string, fuzzy=False):
    try: 
        if isinstance(string, str):
            parse(string, fuzzy=fuzzy)
            return True
        elif isinstance(string, pd.Timestamp):
            return True
        else:
            return False
    except ValueError:
        return False

def is_binary(colNo):
    values = dataset.iloc[:, colNo]
    values = [str(value) for value in values]
    values = [value.lower().strip() for value in values]