Example #1
0
        private void ConvertAdHocFailures(XmlDocument doc, bool fTesting, AdhocTraceTest tt)
        {
            string sXPath = "//failure[contains(@test,'" + tt.Name +
                            "') and not(contains(@test,'ExcpFeat')) and not(contains(@test,'StemName')) and not(contains(@test,'IrregInflForm'))]";
            XmlNodeList nl = doc.SelectNodes(sXPath);

            if (nl != null)
            {
                m_iTestingCount = 0;
                foreach (XmlNode node in nl)
                {
                    XmlNode  test         = node.Attributes.GetNamedItem("test");
                    string   s            = test.InnerText;
                    int      iStartingPos = s.IndexOf("::") + 2;                // skip to the double colon portion
                    string[] sa           = s.Substring(iStartingPos).Split(m_space);

                    StringBuilder sb = new StringBuilder();
                    sb.Append(tt.Name);
                    sb.Append(":");
                    foreach (string str in sa)
                    {
                        sb.Append(" ");
                        if (str.IndexOfAny(m_digits) >= 0)
                        {
                            if (fTesting)
                            {
                                if (m_iTestingCount > 5)
                                {
                                    m_iTestingCount = 0;
                                }
                                sb.Append(m_saTesting[m_iTestingCount++]);
                            }
                            else
                            {
                                string sHvo = str;
                                int    hvo  = Convert.ToInt32(sHvo);
                                sb.Append(tt.GetHvoRepresentation(m_cache, hvo));
                                // get msa PhNCSegments nc = m_cache.ServiceLocator.GetInstance<IPhNCSegmentsRepository>().GetObject(hvo);
                                // string name = nc.Name.BestAnalysisAlternative.Text;
                            }
                        }
                        else
                        {
                            sb.Append(str);
                        }
                    }
                    test.InnerText = sb.ToString();
                }
            }
        }
Example #2
0
		private void ConvertAdHocFailures(XmlDocument doc, bool fTesting, AdhocTraceTest tt)
		{
			string sXPath = "//failure[contains(@test,'" + tt.Name + "') and not(contains(@test,'ExcpFeat')) and not(contains(@test,'StemName'))]";
			XmlNodeList nl = doc.SelectNodes(sXPath);
			if (nl != null)
			{
				m_iTestingCount = 0;
				foreach (XmlNode node in nl)
				{
					XmlNode test = node.Attributes.GetNamedItem("test");
					string s = test.InnerText;
					int iStartingPos = s.IndexOf("::") + 2; // skip to the double colon portion
					string[] sa = s.Substring(iStartingPos).Split(m_space);

					StringBuilder sb = new StringBuilder();
					sb.Append(tt.Name);
					sb.Append(":");
					foreach (string str in sa)
					{
						sb.Append(" ");
						if (str.IndexOfAny(m_digits) >= 0)
						{
							if (fTesting)
							{
								if (m_iTestingCount > 5)
									m_iTestingCount = 0;
								sb.Append(m_saTesting[m_iTestingCount++]);
							}
							else
							{
								string sHvo = str;
								int hvo = Convert.ToInt32(sHvo);
								sb.Append(tt.GetHvoRepresentation(m_cache, hvo));
								// get msa PhNCSegments nc = PhNCSegments.CreateFromDBObject(m_cache, hvo);
								// string name = nc.Name.BestAnalysisAlternative.Text;
							}
						}
						else
							sb.Append(str);
					}
					test.InnerText = sb.ToString();
				}
			}
		}