예제 #1
0
        /// ------------------------------------------------------------------------------------
        private void WriteRoot()
        {
            ProcessHelper.WriteStartElementWithAttrib(_writer, "inventory", "version", kVersion);
            WriteRootAttributes();

            ProcessHelper.WriteMetadata(_writer, _project, true);

            XmlSerializationHelper.SerializeDataAndWriteAsNode(_writer, _project.TranscriptionChanges);
            XmlSerializationHelper.SerializeDataAndWriteAsNode(_writer, _project.AmbiguousSequences);

            if (_project.IgnoredSymbolsInCVCharts.Count > 0)
            {
                ProcessHelper.WriteStartElementWithAttrib(_writer, "symbols", "class", "ignoredInChart");
                foreach (var symbol in _project.IgnoredSymbolsInCVCharts)
                {
                    ProcessHelper.WriteStartElementWithAttribAndEmptyValue(_writer, "symbol", "literal", symbol);
                }

                _writer.WriteEndElement();
            }
            else
            {
                if (!File.Exists(_project.CssFileName.Replace(".css", ".PhoneticInventory.xml")))
                {
                    ProcessHelper.WriteStartElementWithAttrib(_writer, "symbols", "class", "ignoredInChart");
                    ProcessHelper.WriteStartElementWithAttribAndEmptyValue(_writer, "symbol", "literal", "̩");
                    _writer.WriteEndElement();

                    _project.IgnoredSymbolsInCVCharts = new List <string> {
                        "̩"
                    };
                    _project.Save();
                    ProjectInventoryBuilder.Process(_project);
                }
            }

            _writer.WriteStartElement("segments");
            WritePhones();
            _writer.WriteEndElement();

            // Close inventory
            _writer.WriteEndElement();
        }
예제 #2
0
        /// ------------------------------------------------------------------------------------
        public static bool Process(PaProject project)
        {
            if (project == null || SkipProcessingForTests ||
                Properties.Settings.Default.SkipAdditionalProcessingWhenPhonesAreLoaded)
            {
                return(false);
            }

            App.MsgMediator.SendMessage("BeforeBuildProjectInventory", project);

            var bldr        = new ProjectInventoryBuilder(project);
            var buildResult = bldr.InternalProcess();

            App.MsgMediator.SendMessage("AfterBuildProjectInventory",
                                        new object[] { project, buildResult });

            //CVChartBuilder.Process(project, CVChartType.Consonant);
            //CVChartBuilder.Process(project, CVChartType.Vowel);

            return(buildResult);
        }