Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- phones <- read.table("/home/k/kaldi-trunk/egs/deltas/s5/data/lang/phones.txt", quote=""")
- ctm <- read.table("/home/k/kaldi-trunk/egs/deltas/s5/exp/align_test/phones.ctm", quote=""")
- names(ctm) <- c("file_name","prob","start","end","id")
- ctm$file <- gsub("_[0-9]*$","",ctm$file_name)
- names(phones) <- c("phone","id")
- ctm2 <- merge(ctm, phones, by="id")
- ctm3 <- ctm2[,-1]
- ctm3 <- ctm3[,-5]
- ctm3 <- ctm3[with(ctm3,order(ctm3$file_name , ctm3$start)),]
- ctm4 <- ctm3[1:nrow(ctm3),1:ncol(ctm3)]
- output <- as.data.frame.matrix(ctm4)
- write.table(output, "/home/k/kaldi-trunk/egs/deltas/s5/data/align_test/phones.txt",col.names = F , row.names=F, quote=F, sep="t")
- fbbh-b-an86 1 0 0.33 <SIL>
- fbbh-b-an86 1 0.33 0.21 S_B
- fbbh-b-an86 1 0.54 0.2 IY_E
- fbbh-b-an86 1 0.74 0.16 Z_B
- fbbh-b-an86 1 0.9 0.29 IY_E
- fbbh-b-an86 1 1.19 0.21 D_B
- fbbh-b-an86 1 1.4 0.34 IY_E
- fbbh-b-an86 1 0.000 0.330 1
- fbbh-b-an86 1 0.330 0.210 110
- fbbh-b-an86 1 0.540 0.200 71
- fbbh-b-an86 1 0.740 0.160 138
- fbbh-b-an86 1 0.900 0.290 71
- fbbh-b-an86 1 1.190 0.210 38
- fbbh-b-an86 1 1.400 0.340 71
- <eps> 0
- <SIL> 1
- <SIL>_B 2
- <SIL>_E 3
- <SIL>_I 4
- <SIL>_S 5
- AA_B 6
- AA_E 7
- AA_I 8
- AA_S 9
- AE_B 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement