Exemple #1
0
        private XmlElement log_properties(ISpeechPhraseProperty property, XmlDocument writer, ISpeechPhraseInfo info)
        {
            XmlElement element = writer.CreateElement("property");

            element.SetAttribute("name", property.Name);
            element.SetAttribute("value", property.Value.ToString());
            element.SetAttribute("confidence", property.EngineConfidence.ToString());
            string text = info.GetText(property.FirstElement, property.NumberOfElements, true);

            if (text != null)
            {
                XmlElement text_element = writer.CreateElement("text");
                element.AppendChild(text_element);
            }

            if (property.Children != null)
            {
                foreach (ISpeechPhraseProperty child in property.Children)
                {
                    element.AppendChild(log_properties(child, writer, info));
                }
            }
            return(element);
        }
 public string get_text(int start, int end)
 {
     return(phrase.GetText(start, end, true));
 }