Class Session
java.lang.Object
ca.phon.extensions.ExtendableObject
ca.phon.session.Session
- All Implemented Interfaces:
IExtendable
A session, usually recording session, with participants, optional media and
transcript. The transcript is a collection of interleaved comments and records.
Each record is composed of a number of tiers, with the 'Orthography' tier transcribing
a spoken utterance or event.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addParticipant
(int idx, Participant participant) void
addParticipant
(Participant participant) void
void
void
void
addUserTier
(int idx, TierDescription tierDescription) Add user-defined tier description at specified index in tier list.void
addUserTier
(TierDescription tierDescription) Add user-defined tier description to end of the session tier list.void
deleteTierAlignmentRules
(TierAlignmentRules tierAlignmentRules) Delete given tier alignment rulesvoid
deleteTierAlignmentRules
(String tier1, String tier2) Delete tier alignment rules for a pair of tiers.Get list of blind tier namesgetDate()
Return list of languages contained in the sessionGet media location.Additional metadatagetName()
getParticipant
(int idx) int
int
getParticipantIndex
(Participant participant) getRecord
(int recordIndex) int
int
getRecordElementIndex
(int recordIndex) int
getRecordElementIndex
(Record record) int
getRecordIndex
(Record record) ReturnRecords
wrapper object allowing for enumeration of recordsGet session path.getSystemTierParameters
(SystemTierType systemTier) Get tier parameters for system tierReturn a tier description for the given tier name (may include system tiers)Get the unmodifiable list of tier alignment rulesgetTierAlignmentRules
(String tier1, String tier2) Return custom tier alignment rules for given tiers.getTiers()
Return a list of tier descriptions which include all system tiers and all user defined tiers.Get tier view for session.Get timeline for session.getTranscriber
(int i) getTranscriber
(String username) int
Return session transcript which includes comments, gems and records.getTranscriptText
(int transcriptElementIndex, String tier, Range range) Get the text of the specified transcript element index and give range.getTranscriptText
(TranscriptElementRange transcriptElementRange) Get the text of the specified transcript element index and give range.getUserTier
(int idx) Get tier description for user-defined tier at given indexgetUserTier
(String tierName) Get tier description from tier nameint
Get number of user-defined tiers setup in sessionReturn list of user-defined tier descriptions.void
putSystemTierParam
(SystemTierType systemTier, String key, String value) Set tier parameter for system tiervoid
putTierAlignmentRules
(TierAlignmentRules tierAlignmentRules) Set alignment rules for a pair of tiers.void
removeParticipant
(int idx) void
removeParticipant
(Participant participant) void
removeRecord
(int recordIndex) void
removeRecord
(Record record) void
removeTranscriber
(int i) void
void
removeTranscriber
(String username) removeUserTier
(int idx) Remove user-defined tier at given idx from the session tier list.removeUserTier
(TierDescription tierDescription) Remove the user-defined tier description from the session tier list.void
setBlindTiers
(List<String> blindTiers) Set list of tiers included in blind transcriptionvoid
void
void
setLanguages
(List<Language> languages) void
setMediaLocation
(String mediaLocation) void
void
setRecordIndex
(Record record, int recordIndex) void
setSessionPath
(SessionPath sessionPath) Set session path relative to projectvoid
setTierView
(List<TierViewItem> view) Set tier view for session.Methods inherited from class ca.phon.extensions.ExtendableObject
getExtension, getExtensions, putExtension, removeExtension
-
Method Details
-
setSessionPath
Set session path relative to project- Parameters:
sessionPath
- path
-
getSessionPath
Get session path. If session path has not been set this will be created from the corpus and session name stored in the file.- Returns:
- sessionPath
-
getCorpus
- Returns:
- corpus name
-
setCorpus
-
getName
- Returns:
- session name
-
setName
-
getDate
- Returns:
- session recording date, may be null
-
setDate
-
getLanguages
-
setLanguages
-
getMediaLocation
Get media location. Media location may be an absolute path or a relative path. Relative paths are searched using folder options as setup in the application.- Returns:
- media location, may be null
-
setMediaLocation
-
getMetadata
-
getTierView
Get tier view for session. Tier view controls tier ordering, visiblity, font, and locked status. Tier view includes both default tiers and user-defined tiers.- Returns:
- tier view
-
setTierView
Set tier view for session. Tiew view must include all default tiers along with any user-defined tiers.- Parameters:
view
-- Throws:
IllegalArgumentException
- if tier view does not include all necessary tiers
-
getTiers
Return a list of tier descriptions which include all system tiers and all user defined tiers.- Returns:
- list of tiers in session
-
getTier
Return a tier description for the given tier name (may include system tiers)- Parameters:
tierName
-- Returns:
- tier description for given tier name or null if not found
-
getSystemTierParameters
Get tier parameters for system tier- Parameters:
systemTier
-- Returns:
- unmodifiable tier params for given system tier
-
putSystemTierParam
Set tier parameter for system tier- Parameters:
systemTier
-key
-value
-
-
getUserTierCount
public int getUserTierCount()Get number of user-defined tiers setup in session- Returns:
- user tier count
-
getUserTier
Get tier description from tier name- Parameters:
tierName
-- Returns:
- user-define tier description or null if tier was not found
-
getUserTier
Get tier description for user-defined tier at given index- Parameters:
idx
-- Returns:
- user-defined tier description
- Throws:
ArrayIndexOutOfBoundsException
-
removeUserTier
Remove user-defined tier at given idx from the session tier list. Note, this does not remove any tier data from individual records.- Parameters:
idx
-- Returns:
- tier description that was removed
- Throws:
IllegalArgumentException
-
removeUserTier
Remove the user-defined tier description from the session tier list. Note, this does not remove any tier data from individual records.- Parameters:
tierDescription
-- Returns:
- tier description that was removed
-
addUserTier
Add user-defined tier description to end of the session tier list. Note, this does not add the tier to individual records.- Parameters:
tierDescription
-- Throws:
IllegalArgumentException
- on tier name conflict
-
addUserTier
Add user-defined tier description at specified index in tier list. Note, this does not add the tier to individual records.- Parameters:
idx
-tierDescription
-- Throws:
ArrayIndexOutOfBoundsException
IllegalArgumentException
- on tier name conflict
-
getUserTiers
Return list of user-defined tier descriptions.- Returns:
- tier descriptions for user-defined tiers in a wrapper class
-
getTierAlignmentRules
Get the unmodifiable list of tier alignment rules- Returns:
- list of tier alignment rules
-
getTierAlignmentRules
Return custom tier alignment rules for given tiers.- Parameters:
tier1
-tier2
-- Returns:
- custom tier alignment rules for given tiers or null if none
-
putTierAlignmentRules
Set alignment rules for a pair of tiers. If alignment rules already exist for the tuple of tier names they are overwritten.- Parameters:
tierAlignmentRules
-
-
deleteTierAlignmentRules
-
deleteTierAlignmentRules
Delete given tier alignment rules- Parameters:
tierAlignmentRules
-
-
getBlindTiers
-
setBlindTiers
Set list of tiers included in blind transcription- Throws:
IllegalArgumentException
- if any tier name is not in list provided by getTiers()
-
getTranscriberCount
public int getTranscriberCount() -
addTranscriber
-
removeTranscriber
-
removeTranscriber
-
getTranscriber
-
getTranscriber
-
removeTranscriber
public void removeTranscriber(int i) -
getTranscribers
-
getParticipantCount
public int getParticipantCount() -
addParticipant
-
addParticipant
-
getParticipant
-
getParticipantIndex
-
getParticipants
-
removeParticipant
-
removeParticipant
public void removeParticipant(int idx) -
getTranscript
Return session transcript which includes comments, gems and records.- Returns:
- session transcript
-
getTranscriptText
Get the text of the specified transcript element index and give range.- Parameters:
transcriptElementRange
-- Returns:
- text of transcript element at given index and range or null if not found
- Throws:
ArrayIndexOutOfBoundsException
- if transcriptElementIndex is out of bounds or range is invalid
-
getTranscriptText
Get the text of the specified transcript element index and give range.- Parameters:
transcriptElementIndex
-tier
-range
-- Returns:
- text of transcript element at given index and range or null if not found
- Throws:
ArrayIndexOutOfBoundsException
- if transcriptElementIndex is out of bounds or range is invalid
-
getTimeline
Get timeline for session. IntervalTiers is a collection of intervals for each tier in the session.- Returns:
- timeline
-
getRecords
-
addRecord
-
getRecordElementIndex
public int getRecordElementIndex(int recordIndex) -
getRecordElementIndex
-
addRecord
-
removeRecord
-
removeRecord
public void removeRecord(int recordIndex) -
getRecord
-
getRecordCount
public int getRecordCount() -
getRecordIndex
-
setRecordIndex
-