<commit_before>#!/usr/bin/env python2.7

#added icon
#added wordbuttons to pronunciation practice as well

import urllib2
import os
from os import listdir
from os.path import isfile, join
import random
import datetime
import sys
try:
    import pyaudio
    import wave
    import contextlib
except:
    print "Ooops ... no pyaudio or wave ... Say will try SoX"
import glob
import platform
import tempfile
import include.download_dict_sound as download_dict_sound
#http://glowingpython.blogspot.com/2012/11/text-to-speech-with-correct-intonation.html


#change working dir to script folder
if len(os.path.split(sys.argv[0])[0]) > 0:
    os.chdir(os.path.split(sys.argv[0])[0])
dict_sounds_path = os.path.join("sounds")

#replacementsdict = {'.exclamationmark': '!', '.apostrophe': "'", '.questionmark': '?', '.comma': ',', '.colon': ':'}

picfiles = [os.path.abspath(file) for file in glob.glob('Units/*/*/pics/*.*')]
soundfiles = [os.path.abspath(file) for file in glob.glob('Units/*/*/sounds/*.*')]


print "\n \
How to use:\n \
Save pictures to pics folder. Name them exactly what you want the text to be.\n \
Use .questionmark, .comma in the name instead of ? or , etc. -- files cannot have a ? in the name\n \
Run sound_download.py to get audio for text from Google Translate TTS API (unofficial).\n"<commit_msg>Added remove_hidden_files into rosettatablet.py -- will try to update before loading the rest of rt<commit_after>#!/usr/bin/env python2.7

#added icon
#added wordbuttons to pronunciation practice as well

import urllib2
import os
from os import listdir
from os.path import isfile, join
import random
import datetime
import sys
try:
    import pyaudio
    import wave
    import contextlib
except:
    print "Ooops ... no pyaudio or wave ... Say will try SoX"
import glob
import platform
import tempfile
import include.download_dict_sound as download_dict_sound
#http://glowingpython.blogspot.com/2012/11/text-to-speech-with-correct-intonation.html

try:
    with open("testfile.txt", "w") as fp:
        fp.write("This is a test.")
    import remove_hidden_files
    os.remove("testfile.txt")
except:
    print "You do not have permissions to write in this directory. Files not updated this time."



#change working dir to script folder
if len(os.path.split(sys.argv[0])[0]) > 0:
    os.chdir(os.path.split(sys.argv[0])[0])
dict_sounds_path = os.path.join("sounds")

#replacementsdict = {'.exclamationmark': '!', '.apostrophe': "'", '.questionmark': '?', '.comma': ',', '.colon': ':'}

picfiles = [os.path.abspath(file) for file in glob.glob('Units/*/*/pics/*.*')]
soundfiles = [os.path.abspath(file) for file in glob.glob('Units/*/*/sounds/*.*')]


print "\n \
How to use:\n \
Save pictures to pics folder. Name them exactly what you want the text to be.\n \
Use .questionmark, .comma in the name instead of ? or , etc. -- files cannot have a ? in the name\n \
Run sound_download.py to get audio for text from Google Translate TTS API (unofficial).\n"
{'fraction_non_alphanumeric': 0.1340518693162681, 'fraction_numerical': 0.009430784776018861, 'mean_word_length': 3.958263772954925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4354764', 'n_tokens_mistral': 1000, 'n_tokens_neox': 965, 'n_words': 322}