;; REQUIRES:
;; -----------------------------
;; This module works without any requires, but in order to use the audio
;; REQUIRES:
;; -----------------------------
;; This module works without any requires, but in order to use the audio
-;; functions, you need to install the emacs package "emms", by Joe Drew,
+;; functions, you need to install the Emacs package "emms", by Joe Drew,
;; and the external program "mpg321", by Jorgen Schafer and Ulrik Jensen,
;; both under GPL licenses.
;;
;; and the external program "mpg321", by Jorgen Schafer and Ulrik Jensen,
;; both under GPL licenses.
;;
-(if t (require 'emms-setup))
-;(require 'emms-player-mpd)
-;(setq emms-player-mpd-server-name "localhost")
-;(setq emms-player-mpd-server-port "6600")
+(require 'xml)
+
+;; (if t (require 'emms-setup))
+;; (require 'emms-player-mpd)
+;; (setq emms-player-mpd-server-name "localhost")
+;; (setq emms-player-mpd-server-port "6600")
(defvar transcribe-function-list '("initiating" "responding" "control" "expresive" "interpersonal"))
(defvar transcribe-move-list '("initiation" "response" "follow-up"))
(defvar transcribe-attribute-list '("clauses" "errors" "function" "move"))
(defvar transcribe-function-list '("initiating" "responding" "control" "expresive" "interpersonal"))
(defvar transcribe-move-list '("initiation" "response" "follow-up"))
(defvar transcribe-attribute-list '("clauses" "errors" "function" "move"))
(defun transcribe-analyze-episode (episode person)
"This calls the external python package analyze_episodes2.py. The new
(defun transcribe-analyze-episode (episode person)
"This calls the external python package analyze_episodes2.py. The new
- (let* ((transcription (xml-get-children episode 'transcription))
- (participantsnode (xml-get-children episode 'participants))
- (participantsstring (nth 2 (car participantsnode)))
- (participants (split-string participantsstring)))
+ (let* ((transcription (xml-get-children episode 'transcription)))
(dolist (turn transcription)
(dolist (intervention (xml-node-children turn))
(when (listp intervention)
(dolist (turn transcription)
(dolist (intervention (xml-node-children turn))
(when (listp intervention)
(initiating 0.0000);; TODO implement
(responding 0.0000);; TODO implement
(control 0.0000);; TODO implement
(expressive 0.0000);; TODO implement
(interpersonal 0.0000);; TODO implement
(clausesl1 0.0000)
(initiating 0.0000);; TODO implement
(responding 0.0000);; TODO implement
(control 0.0000);; TODO implement
(expressive 0.0000);; TODO implement
(interpersonal 0.0000);; TODO implement
(clausesl1 0.0000)
(setq role (nth 2 (car rolenode)))
(setq context (nth 2 (car contextnode)))
(setq demand (nth 2 (car demandnode)))
(setq role (nth 2 (car rolenode)))
(setq context (nth 2 (car contextnode)))
(setq demand (nth 2 (car demandnode)))
(setq expressive (+ expressive 1)))
(when (string-equal function "interpersonal")
(setq interpersonal (+ interpersonal 1)))
(setq expressive (+ expressive 1)))
(when (string-equal function "interpersonal")
(setq interpersonal (+ interpersonal 1)))
(setq asunitsl1 (1+ asunitsl1)))))))))))))
(reverse interventionsl2)
;; (write-region (format "%s" interventionsl2) nil (format "transcribe-output-%s-%s-l2.txt" episodenumber personid))
(setq asunitsl1 (1+ asunitsl1)))))))))))))
(reverse interventionsl2)
;; (write-region (format "%s" interventionsl2) nil (format "transcribe-output-%s-%s-l2.txt" episodenumber personid))
(clausesperasunitl2 (/ clausesl2 asunitsl2))
(errorsperasunitl2 (/ errorsl2 asunitsl2))
(asunitspersecondl1 (/ asunitsl1 (string-to-number duration)))
(clausesperasunitl2 (/ clausesl2 asunitsl2))
(errorsperasunitl2 (/ errorsl2 asunitsl2))
(asunitspersecondl1 (/ asunitsl1 (string-to-number duration)))
(initiatingperasunitl2 (/ initiating asunitsl2))
(respondingperasunitl2 (/ responding asunitsl2))
(controlperasunitl2 (/ control asunitsl2))
(initiatingperasunitl2 (/ initiating asunitsl2))
(respondingperasunitl2 (/ responding asunitsl2))
(controlperasunitl2 (/ control asunitsl2))
;; (princ clausesmessage)
(princ (format "episode: %s, duration: %s, person: %s\n" episodenumber duration personid))
;; (princ clausesmessage)
(princ (format "episode: %s, duration: %s, person: %s\n" episodenumber duration personid))
(insert (format "%s,%s,%s,0,0,%s,%s,%s,%s,%s,QUAN-L2,segmented,aux,level,subject,yearofclil,month\n" personid episodenumber duration role context demand asunitspersecondl2 asunitspersecondl1)))
(princ (format "L2(Asunits/second): %s, L2(clauses/Asunit): %s, L2(errors/Asunit):%s, L1(Asunits/second): %s\n"
asunitspersecondl2 clausesperasunitl2 errorsperasunitl2 asunitspersecondl1))
(insert (format "%s,%s,%s,0,0,%s,%s,%s,%s,%s,QUAN-L2,segmented,aux,level,subject,yearofclil,month\n" personid episodenumber duration role context demand asunitspersecondl2 asunitspersecondl1)))
(princ (format "L2(Asunits/second): %s, L2(clauses/Asunit): %s, L2(errors/Asunit):%s, L1(Asunits/second): %s\n"
asunitspersecondl2 clausesperasunitl2 errorsperasunitl2 asunitspersecondl1))
lost all previous data. The data in the buffer can be saved to a file and be
passed to 'R' for statistical analysis."
(interactive)
lost all previous data. The data in the buffer can be saved to a file and be
passed to 'R' for statistical analysis."
(interactive)
(erase-buffer)
(insert "person,episode,duration,C-UNITS(L2),C-UNITS(L1),role,context,demand,QUAN-L2,QUAN-L1,QUAL-L2,segmented,aux,level,subjects,yearofCLIL,month\n"))
(dolist (episode episodes)
(let* ((numbernode (xml-get-children episode 'number))
(participantsnode (xml-get-children episode 'participants))
(erase-buffer)
(insert "person,episode,duration,C-UNITS(L2),C-UNITS(L1),role,context,demand,QUAN-L2,QUAN-L1,QUAL-L2,segmented,aux,level,subjects,yearofCLIL,month\n"))
(dolist (episode episodes)
(let* ((numbernode (xml-get-children episode 'number))
(participantsnode (xml-get-children episode 'participants))
(number (nth 2 (car numbernode)))
(participantsstring (nth 2 (car participantsnode)))
(participants (split-string participantsstring)))
(number (nth 2 (car numbernode)))
(participantsstring (nth 2 (car participantsnode)))
(participants (split-string participantsstring)))
;; (insert "person,episode,duration,C-UNITS(L2),C-UNITS(L1),role,context,demand,QUAN-L2,QUAN-L1,QUAL-L2,segmented,aux,level,subjects,yearofCLIL,month\n")
)
;; TODO: save the students present in transcription in list so that we can use that list for transcribe-analyze-all
;; (insert "person,episode,duration,C-UNITS(L2),C-UNITS(L1),role,context,demand,QUAN-L2,QUAN-L1,QUAL-L2,segmented,aux,level,subjects,yearofCLIL,month\n")
)
;; TODO: save the students present in transcription in list so that we can use that list for transcribe-analyze-all