branch: master
commit 4b55aa09b5721ee7c38ed20c46786e5e53a8d999
Author: David Gonzalez Gandara
Commit: David Gonzalez Gandara
packages/transcribe.el: Applied suggested patches
---
packages/transcribe/transcribe.el | 69 -
1 files changed, 30 insertions(+), 39 deletions(-)
diff --git a/packages/transcribe/transcribe.el
b/packages/transcribe/transcribe.el
index 1e7b332..9662207 100644
--- a/packages/transcribe/transcribe.el
+++ b/packages/transcribe/transcribe.el
@@ -1,6 +1,6 @@
;;; transcribe.el --- Package for audio transcriptions
-;; Copyright 2014-2015 Free Software Foundation, Inc.
+;; Copyright 2014-2016 Free Software Foundation, Inc.
;; Author: David Gonzalez Gandara
;; Version: 1.5.0
@@ -23,7 +23,7 @@
;; 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.
;;
@@ -76,10 +76,12 @@
;;; Code:
-(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")
(emms-standard)
(emms-default-players)
@@ -95,7 +97,7 @@
(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"))
-;(append transcribe-attribute-list transcribe-function-list
transcribe-move-list)
+;; (append transcribe-attribute-list transcribe-function-list
transcribe-move-list)
(defun transcribe-analyze-episode (episode person)
"This calls the external python package analyze_episodes2.py. The new
@@ -109,25 +111,17 @@
and the persons and the utterances only. The raw transcription will be send
to buffer called
'Raw Output'"
(interactive)
- (let* ((interventionsl2 '())
- (interventionsl1 '())
- (xml (xml-parse-region (point-min) (point-max)))
+ (let* ((xml (xml-parse-region (point-min) (point-max)))
(results (car xml))
- (episodes (xml-get-children results 'episode))
- (clausesmessage nil)
- (number nil))
+ (episodes (xml-get-children results 'episode)))
(dolist (episode episodes)
- (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)
- (save-excursion
- (set-buffer "Raw Output")
+ (with-current-buffer "Raw Output"
(insert (format "%s: " (car intervention)))
(dolist (utterance (nthcdr 2 intervention))
(when (listp utterance)
@@ -148,21 +142,21 @@
(episodes (xml-get-children results 'episode))
(asunitsl2 0.)
(asunitsl1 0.)
- (shifts 0.);; TODO implement
+ ;; (shifts 0.);; TODO implement
(initiating 0.);; TODO implement
(responding 0.);; TODO implement
(control 0.);; TODO implement
(expressive 0.);; TODO implement
(interpersonal 0.);; TODO implement
(clausesl1 0.)
- (errorsl1 0.);; TODO implement
+ ;; (errorsl1 0.);; TODO implement
(clausesl2 0.)
(errorsl2 0.)
(duration nil)
(role nil)
(context nil)
(demand nil)
- (clausesmessage nil)
+ ;; (clausesmessage nil)
(number nil))
(dolist (episode episodes)
@@ -184,8 +178,7 @@
(setq role (nth 2 (car rolenode)))
(setq context (nth 2 (car contextnode)))
(setq demand (nth 2 (car demandnode)))
-;; (save-excursion
- ;; (set-buffer "Statistics Output")
+;; (with-current-buffer "Statistics Output"
;; (insert (format "role: %s; context: %s; demand: %s\n"
role context demand)))
))
@@ -214,13 +207,14 @@
(setq expressive (+ expressive 1)))
(when (string-equal function "interpersonal")
(setq interpersonal (+ interpersonal 1)))