commit to clean up

This commit is contained in:
yemaozi88 2018-12-30 23:14:26 +01:00
parent 9ec7c3c50b
commit af785e51cf
3 changed files with 19 additions and 4 deletions

Binary file not shown.

View File

@ -25,12 +25,12 @@ mapping = convert_xsampa2ipa.load_converter('xsampa', 'ipa', default.ipa_xsampa_
stimmen_transcription_ = pd.ExcelFile(default.stimmen_transcription_xlsx) stimmen_transcription_ = pd.ExcelFile(default.stimmen_transcription_xlsx)
phonelist_novo70_ = pd.ExcelFile(default.phonelist_novo70_xlsx)
df = pd.read_excel(phonelist_novo70_, 'list')
## novo phoneset ## novo phoneset
#translation_key = dict() translation_key = dict()
#phonelist_novo70_ = pd.ExcelFile(default.phonelist_novo70_xlsx)
#df = pd.read_excel(phonelist_novo70_, 'list')
## *_simple includes columns which has only one phone in. ## *_simple includes columns which has only one phone in.
#for ipa, novo70 in zip(df['IPA_simple'], df['novo70_simple']): #for ipa, novo70 in zip(df['IPA_simple'], df['novo70_simple']):
# if not pd.isnull(ipa): # if not pd.isnull(ipa):
@ -38,3 +38,18 @@ df = pd.read_excel(phonelist_novo70_, 'list')
# translation_key[ipa] = novo70 # translation_key[ipa] = novo70
#phonelist_novo70 = np.unique(list(df['novo70_simple'])) #phonelist_novo70 = np.unique(list(df['novo70_simple']))
phoneset_ipa = []
phoneset_novo70 = []
with open(default.cmu69_phoneset, "rt", encoding="utf-8") as fin:
lines = fin.read()
lines = lines.split('\n')
for line in lines:
words = line.split('\t')
if len(words) > 1:
novo70 = words[0]
ipa = words[1]
phoneset_ipa.append(ipa)
phoneset_novo70.append(novo70)
translation_key[ipa] = novo70
phoneset_ipa = np.unique(phoneset_ipa)
phoneset_novo70 = np.unique(phonset_novo70)