public TranscriptionChapter() : base() { Sections = new VirtualTypeList<TranscriptionSection>(this,this._children); Begin = new TimeSpan(-1); End = new TimeSpan(-1); }
public TranscriptionChapter(String aName, TimeSpan aBegin, TimeSpan aEnd) { Sections = new VirtualTypeList<TranscriptionSection>(this, this._children); this.Name = aName; this.Begin = aBegin; this.End = aEnd; }
public TranscriptionParagraph(XElement e) { if (!e.CheckRequiredAtributes("b", "e", "s")) throw new ArgumentException("required attribute missing on paragraph (b,e,s)"); Phrases = new VirtualTypeList<TranscriptionPhrase>(this, this._children); _internalID = int.Parse(e.Attribute( "s").Value); AttributeString = (e.Attribute( "a") ?? EmptyAttribute).Value; Elements = e.Attributes().ToDictionary(a => a.Name.ToString(), a => a.Value); foreach (var p in e.Elements("p").Select(p => (TranscriptionElement)new TranscriptionPhrase(p))) Add(p); string bfr; if (Elements.TryGetValue("a", out bfr)) this.AttributeString = bfr; if (Elements.TryGetValue("b", out bfr)) { int ms; if (int.TryParse(bfr, out ms)) Begin = TimeSpan.FromMilliseconds(ms); else Begin = XmlConvert.ToTimeSpan(bfr); } else { var ch = _children.FirstOrDefault(); Begin = ch == null ? TimeSpan.Zero : ch.Begin; } if (Elements.TryGetValue("e", out bfr)) { int ms; if (int.TryParse(bfr, out ms)) End = TimeSpan.FromMilliseconds(ms); else End = XmlConvert.ToTimeSpan(bfr); } else { var ch = _children.LastOrDefault(); End = ch == null ? TimeSpan.Zero : ch.Begin; } if (Elements.TryGetValue("l", out bfr)) { if(!string.IsNullOrWhiteSpace(bfr)) Language = bfr.ToUpper(); } Elements.Remove("b"); Elements.Remove("e"); Elements.Remove("s"); Elements.Remove("a"); Elements.Remove("l"); }
public TranscriptionChapter(XElement c) { Sections = new VirtualTypeList<TranscriptionSection>(this, this._children); Name = c.Attribute("name").Value; Elements = c.Attributes().ToDictionary(a => a.Name.ToString(), a => a.Value); Elements.Remove("name"); foreach (var s in c.Elements("se").Select(s => (TranscriptionElement)new TranscriptionSection(s))) Add(s); }
public TranscriptionParagraph() : base() { Phrases = new VirtualTypeList<TranscriptionPhrase>(this, this._children); this.Begin = new TimeSpan(-1); this.End = new TimeSpan(-1); this.trainingElement = false; }
public TranscriptionSection() { Paragraphs = new VirtualTypeList<TranscriptionParagraph>(this,this._children); Begin = new TimeSpan(-1); End = new TimeSpan(-1); }
public TranscriptionElement() { _vChildren = new VirtualTypeList<TranscriptionElement>(this, _children); }