Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. phones <- read.table("/home/k/kaldi-trunk/egs/deltas/s5/data/lang/phones.txt", quote=""")
  2. ctm <- read.table("/home/k/kaldi-trunk/egs/deltas/s5/exp/align_test/phones.ctm", quote=""")
  3.  
  4. names(ctm) <- c("file_name","prob","start","end","id")
  5. ctm$file <- gsub("_[0-9]*$","",ctm$file_name)
  6. names(phones) <- c("phone","id")
  7.  
  8.  
  9. ctm2 <- merge(ctm, phones, by="id")
  10. ctm3 <- ctm2[,-1]
  11. ctm3 <- ctm3[,-5]
  12. ctm3 <- ctm3[with(ctm3,order(ctm3$file_name , ctm3$start)),]
  13. ctm4 <- ctm3[1:nrow(ctm3),1:ncol(ctm3)]
  14. output <- as.data.frame.matrix(ctm4)
  15. 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")
  16.  
  17. fbbh-b-an86 1 0 0.33 <SIL>
  18. fbbh-b-an86 1 0.33 0.21 S_B
  19. fbbh-b-an86 1 0.54 0.2 IY_E
  20. fbbh-b-an86 1 0.74 0.16 Z_B
  21. fbbh-b-an86 1 0.9 0.29 IY_E
  22. fbbh-b-an86 1 1.19 0.21 D_B
  23. fbbh-b-an86 1 1.4 0.34 IY_E
  24.  
  25. fbbh-b-an86 1 0.000 0.330 1
  26. fbbh-b-an86 1 0.330 0.210 110
  27. fbbh-b-an86 1 0.540 0.200 71
  28. fbbh-b-an86 1 0.740 0.160 138
  29. fbbh-b-an86 1 0.900 0.290 71
  30. fbbh-b-an86 1 1.190 0.210 38
  31. fbbh-b-an86 1 1.400 0.340 71
  32.  
  33. <eps> 0
  34. <SIL> 1
  35. <SIL>_B 2
  36. <SIL>_E 3
  37. <SIL>_I 4
  38. <SIL>_S 5
  39. AA_B 6
  40. AA_E 7
  41. AA_I 8
  42. AA_S 9
  43. AE_B 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement