Exemple #1
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);
        }
Exemple #2
0
        /// ------------------------------------------------------------------------------------
        public TierCollection Copy()
        {
            var copy = new TierCollection();

            copy.AnnotatedMediaFile = AnnotatedMediaFile;

            foreach (var tier in this)
            {
                copy.Add(tier.Copy());
            }

            return(copy);
        }