generating segmentation for words
parent
f44665e9b2
commit
0600482fe5
|
|
@ -57,7 +57,8 @@ class Delegate (NSObject):
|
|||
'''Called automatically when the application has launched'''
|
||||
print("App Launched!")
|
||||
# phrases = story_texts()#random.sample(story_texts(), 100) #
|
||||
phrases = test_texts(30)
|
||||
# phrases = test_texts(30)
|
||||
phrases = story_words()
|
||||
# print(phrases)
|
||||
generate_audio(phrases)
|
||||
|
||||
|
|
@ -174,14 +175,19 @@ class SynthesizerQueue(object):
|
|||
|
||||
|
||||
def story_texts():
|
||||
# story_file = './inputs/all_stories_hs.json'
|
||||
story_file = './inputs/all_stories.json'
|
||||
stories_data = json.load(open(story_file))
|
||||
# text_list_dup = [t[0] for i in stories_data.values() for t in i]
|
||||
text_list_dup = [t for i in stories_data.values() for t in i]
|
||||
text_list = sorted(list(set(text_list_dup)))
|
||||
return text_list
|
||||
|
||||
def story_words():
|
||||
story_file = './inputs/all_stories_hs.json'
|
||||
stories_data = json.load(open(story_file))
|
||||
text_list_dup = [t[0] for i in stories_data.values() for t in i]
|
||||
text_list = sorted(list(set(text_list_dup)))
|
||||
return text_list
|
||||
|
||||
def test_texts(count=10):
|
||||
word_list = [i.strip('\n_') for i in open('./inputs/wordlist.txt','r').readlines()]
|
||||
text_list = sorted(random.sample(list(set(word_list)),count))
|
||||
|
|
|
|||
Loading…
Reference in New Issue