def main():
    """对所有文件进行LDA和K-means的预处理"""
    CityFileNameStr = 'Data/City/City.txt'
    FilePath = 'Data/DataProcessing/'

    CityList = (Classifier.CreateCityDict(CityFileNameStr)).keys()  #创建城市列表
    for i in CityList:  #进行过滤和文件重新整理
        try:
            DealSingleFile(FilePath + str(i) + '/' + 'FilterData.txt',\
                           FilePath + str(i) + '/' + 'LKProcessingData.txt')
        except Exception as e:
            print str(e) + '\t' + i
def main():
    CityFileNameStr = 'Data/City/City.txt'
    FilePathReadStr = 'Data/Classified/'
    FilePathWriteStr = 'Data/DataProcessing/'

    CityList = (Classifier.CreateCityDict(CityFileNameStr)).keys()  #创建城市列表

    for i in CityList:  #进行过滤和文件重新整理
        try:
            TextList = Filter(FilePathReadStr + i + '.txt')  #过滤
            CreateDir(FilePathWriteStr + i + '/')
            Classifier.WriteFileLine(FilePathWriteStr + i + '/' +
                                     'FilterData.txt', TextList,
                                     'w')  #文件结构建立重新写入
        except Exception as e:
            print str(e) + '\t' + i