Esempio n. 1
0
        private void LoadCharacterDefinitionTable(XElement charDefTableElem)
        {
            var table = new CharacterDefinitionTable(_spanFactory) { Name = (string) charDefTableElem.Element("Name") };
            foreach (XElement segDefElem in charDefTableElem.Elements("SegmentDefinitions").Elements("SegmentDefinition").Where(IsActive))
            {
                IEnumerable<string> reps = segDefElem.Elements("Representations").Elements("Representation").Select(e => (string) e);
                FeatureStruct fs = null;
                if (_language.PhonologicalFeatureSystem.Count > 0)
                    fs = LoadFeatureStruct(segDefElem, _language.PhonologicalFeatureSystem);
                CharacterDefinition cd = table.AddSegment(reps, fs);
                _charDefs[(string) segDefElem.Attribute("id")] = cd;
            }

            foreach (XElement bdryDefElem in charDefTableElem.Elements("BoundaryDefinitions").Elements("BoundaryDefinition").Where(IsActive))
            {
                IEnumerable<string> reps = bdryDefElem.Elements("Representations").Elements("Representation").Select(e => (string) e);
                CharacterDefinition cd = table.AddBoundary(reps);
                _charDefs[(string) bdryDefElem.Attribute("id")] = cd;
            }

            _language.CharacterDefinitionTables.Add(table);
            _tables[(string) charDefTableElem.Attribute("id")] = table;
        }