# Transcriber 1.4 file's map

## Transcriber-1.4/

- COPYING
- README
- convert/*
  - Tcl script modules for format conversion
- demo/*
  - sound and transcription demo files
- doc/*
  - help files
- etc/*
  - default configuration file, DTD, localization file
- img/*
  - bitmap images
- src/*
  - sources for new Tcl commands and Tk widgets
- tcl/*
  - Tcl scripts

## tcl/*

### tcl/About.tcl

Display online help. Tries to view it in the default browser on Windows and Mac OS, and on Mozilla or Firefox on Linux.

### tcl/BgShape.tcl

Compute the shape of a signal. Script launched as a background sub-process by Transcriber when background shape calculation mode is on.

### tcl/ComputeShape.tcl

Stand-alone script for pre-computing a set of signal shapes (see comments in the code for the command line options)

### tcl/Debug.tcl

Very rough debugger window which can be activated when debug menu in general options is on.

### tcl/Dialog.tcl

Some generic functions for management of the user interface, e.g.:

- ListFrame, EntryFrame, ListEntryFrame, MenuEntryFrame, MenuFrame, RadioFrame, ColorFrame: create a frame with a variable editor of various kinds
- proc ListEditor: generic list editor used for configuration of Glossary, Bindings, Localization and Event lists.
- proc ChooseFont: generic font chooser (also works for named fonts)

### tcl/Edit.tcl

Management of the text editor pane.

- CreateTextFrame, EmptyTextFrame, DestroyTextFrame: creation/destruction of text widget with associated scrollbars and bindings. All commands to the text widget are filtered by TextFilter
- InitEditor, Create*Button, Insert*Button, ChangeSyncButton, InsertData: creation of text and buttons in the editor.
- CopyAll, PasteAll, tk_text*, :TextCmd, InsertText: cut/copy/paste with embedded tags
- TextFilter: all actions to the text widget are trapped :
  - insertion of chars is only allowed in data segments (i.e. after an index position with a '*data*' text tag); the transcription is updated accordingly.
  - suppression of chars with part of the editor with the 'locked' text tag (i.e. sync, turns, section buttons) is avoided. When deleting one char of an event, the whole event is suppressed.
  - position of the cursor in the text editor is constrained to be in a data section with various heuristics, and the signal view is synchronized with the new position
- GetDataFromPos: get XML text id associated with the cursor position in the text editor
- ModifyText: update an XML text field from the content of the text editor
- ViewAroundText: tries to show some context around current text cursor
- TextFirstSync, TextLastSync, TextNext*: move in the transcription
- Find, FindNext, Replace, ReplaceAll: Find & Replace

### tcl/Episode.tcl

Management of global properties of the transcription edited in "File/Edit Episode attributes..."

### tcl/Events.tcl

Management of:

- Overlapping speech
- Background conditions
- Speech and non-speech events

### tcl/Interface.tcl

Management of the user interface.

- BuildGUI: creation of fonts, widgets, bindings, menus
- ConfigureGeneral: "Options/General..."
- EncodingChooser: (only for Tcl/Tk >= 8.1) for output file default encoding
- EditGlossary
- ConfigureBindings: implementation of "Options/Bindings..."
- ConfigureColors: implementation of "Options/Colors..."

### tcl/Main.tcl

The main script part loads all needed libraries and other script parts, reads configuration, parses the command line.

- Main: the procedure called at startup with all command line arguments.
- Quit: !
- InitDefault, LoadOptions, SaveOptions: initialization of the global array v(*) with default configuration values and user saved values (found in ~/.transcriber for Unix).
- Local, *Local...: management of localization
- LoadModules: load Snack, tcLex and other tcl modules.
- StartWith: parses command line options and open sound and transcription file.

### tcl/Menu.tcl

- add_menu, ..., bind_menu: generic menu management
- InitMenus: create menu for Transcriber application
- Update*Menu: enable/disable some menu items.

### tcl/Play.tcl

Management of various playback modes

- PlayRange: launches playback of an excerpt of the currrent sound file
- Cursor*: automatic move of signal cursor
- Play: launches playback in current mode (play selection, with pauses or beeps...)

### tcl/Segmt.tcl

Within Transcriber, a "segmentation" designs one layer of the transcription (i.e., sections, turns, synchros, background conditions) and also the associated segmentation widget displayed under the signal.

- CreateSegmentWidget, ..., DestroySegmentWidgets: management of the 4 segmentation widgets and their associated bindings
- InitSegmt, AddSegmt, ... : management of the segmentation (viewed in an associated segment widget) and stored in memory as a Tcl list:
  - { {start_position end_position description color} ...}
- GetSegmentFromPos, ..., SegmentSelect: mouse-driven selection of segments
- SegmentMove: move segment boundaries with the mouse
- SetCurrentSegment: highlight given segment in signal and text view. If necessary, moves text and signal cursor to some compatible, heuristic-driven places.
- JoinTransTags, SplitTransTags, JoinData, SplitData: split transcription at given point and update XML data structure (used as intermediate functions between user level and segmentation list level)
- InsertSegment, DeleteSegment, ChangeSegType: creation/destruction of breakpoints and creation of turns/sections at a given breakpoint.

### tcl/Signal.tcl

- EmptySignal: reset current sound file
- Signal: open given sound file and optionally get associated shape
- ShapeDone, ShapeAbort: interaction with background shape calculation sub-process
- LookForShape: tries to find a shape file matching the sound file name
- LookForSignal: tries to find a sound file matching the transcription name in the known sound paths
- SoundFileType: identifies a sound file header, else returns "RAW"
- OpenAudioFile: menu "File/Open audio file..."
- ConfigureAudioFile: menu "Options/Audio File..."
- OpenSound: creates a local sound Snack object or give access to a remote sound through sockets (using SoundClient)

### tcl/SoundServer.tcl

Stand-alone script to be used for providing access to sound files on a server (to be configured for the application, see the code).

### tcl/Speaker.tcl

Speakers and turns management

- 'speaker' namespace:
  - speaker::create/get_atts/set_atts/... : management of speaker list
  - speaker::find : menu "Edit/Speakers/Find speaker"
  - speaker::import : menu "Edit/Speakers/Import from file..."
- 'turn' namespace:
  - turn::choose/choose_* : menu "Segmentation/Edit turn attributes..."

### tcl/Spelling.tcl

Spell checking with ispell if available

### tcl/Synchro.tcl

Management of the list of breakpoint times

### tcl/Topic.tcl

Topic and sections management, very similar to Speaker.tcl

### tcl/Trans.tcl

Management of transcription I/O and display

- trs::import/export : default I/O for transcription in the native .trs XML format
- InitConvertors: read convertor plug-ins found in sibling 'convert' directory
- ReadFile: generic file input using default encoding
- OpenSegmt: display a supplementary segmentation layer under the signal - not user interface yet provided
- SegmtToTrans: convert a simple, single layer, segmentation (as found in most label formats) to a transcription data structure.
- ReadTrans; WriteTrans: reads/writes a transcription file
- OpenTransFile/OpenTransOrSoundFile/SaveTrans: user interface for transcription I/O
- NormalizeTrans: Normalize the transcription by "filling the holes" with sections or turns and creates empty data sections between non-contiguous breakpoints
- ConvertData: attempt to find event tags in a .typ transcription file (rough parsing)
- DisplayTrans: creates the display of the transcription in the editor window
- TextFromSync: construct the character string which will be displayed for the given segment in the segmentation under the signal

### tcl/Undo.tcl

Managmenent of:

- Undo (not reliable)
- Auto-save and rescue
- Logging of transcribers' activity

### tcl/Waveform.tcl

- Create sound frame
- Synchronize waveform, axis and scrollbars
- Resolution setting and selection zooming
- Cursor and selection handling
- Events bindings for cursor position and selection

### tcl/Xml.tcl

Gereric-purpose XML library. Loads and initialize XmlItem, XmlDtd ans XmlParse

### tcl/XmlDtd.tcl

Management of an XML DTD

### tcl/XmlItem.tcl

Management of XML tags and data in Tcl in an object-oriented way

### tcl/XmlParse.tcl

Parsing of an XML document in Tcl using the tcLex library.

## convert/*

Directory containing transcription I/O filters (see convert/README for more infos). Provided filters are:

- ESPS/xwaves .lab input
- TIMIT .phn/.wrd/.txt input
- OGI .lola input
- LIMSI .lbl input
- LDC .typ input/output
- NIST .stm output

## src/*

### src/axis.c

C code for 'axis' Tk widget

### src/segmt.c

C code for 'segmt' Tk widget

### src/shape.c

C code for Snack sound sub-commands:

- $snd centi
- $snd shape
- $snd get
- $snd order

### src/trans.c

Main body of 'trans' package

### src/trans.in

Source of Transcriber launching script "trans"

### src/wavfm.c

C code for 'wavfm' Tk widget