예제 #1
0
        /// ------------------------------------------------------------------------------------
        public void AddTextTierWithEmptySegments(string id)
        {
            var newTier = new TextTier(id);

            Add(newTier);

            for (int i = 0; i < GetTimeTier().Segments.Count; i++)
            {
                newTier.AddSegment(string.Empty);
            }
        }
예제 #2
0
        /// ------------------------------------------------------------------------------------
        public TierCollection GetTierCollection()
        {
            var collection = new TierCollection();

            var timeSlots = GetTimeSlots();

            var transcriptionAnnotations = GetTranscriptionTierAnnotations();

            if (transcriptionAnnotations.Count == 0)
            {
                return(collection);
            }

            var freeTransAnnotations = GetFreeTranslationTierAnnotations();

            EnsureMediaFileIsCorrect();

            var timeOrderTier     = new TimeTier(GetFullPathToMediaFile());
            var transcriptionTier = new TextTier(TextTier.ElanTranscriptionTierId);
            var freeTransTier     = new TextTier(TextTier.ElanTranslationTierId);

            foreach (var kvp in transcriptionAnnotations)
            {
                var start = timeSlots[kvp.Value.Attribute("TIME_SLOT_REF1").Value];
                var stop  = timeSlots[kvp.Value.Attribute("TIME_SLOT_REF2").Value];
                timeOrderTier.AddSegment(start, stop);
                transcriptionTier.AddSegment(kvp.Value.Value);

                string freeTransValue;
                freeTransTier.AddSegment(freeTransAnnotations.TryGetValue(kvp.Key,
                                                                          out freeTransValue) ? freeTransValue : string.Empty);
            }

            // Add the time and transcription tiers to the collection.
            collection.Add(timeOrderTier);
            collection.Add(transcriptionTier);
            collection.Add(freeTransTier);

            timeOrderTier.ReadOnlyTimeRanges = GetDoesTranscriptionTierHaveDepedentTimeSubdivisionTier();

            return(collection);
        }