public GetDisambiguationPagesFromWikiDump ( string rawInput ) : List |
||
rawInput | string | |
return | List |
public void GetDisambiguationPagesFromWikiDump_test() { // arrange string rawInput = @"C:\Users\Pleto\Documents\Visual Studio 2013\Projects\WikiParser\WikiParser\bin\Debug\vstup.xml"; int parsedCount; int expectedCount = 5; Parser parser = new Parser(); // act parsedCount = parser.GetDisambiguationPagesFromWikiDump(rawInput)[0].pages.Count; // assert Assert.AreEqual(expectedCount, parsedCount, "Wrong number of parsed pages for Rontgen!"); }
/// <summary> /// Click button event handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnParse_Click(object sender, EventArgs e) { fromParsedDump = false; DateTime start = DateTime.Now; disambiguationPages = parser.GetDisambiguationPagesFromWikiDump(rawInput); ShowDisambPages(); DateTime end = DateTime.Now; RtbProgramInfo.Text += "Elapsed time: " + String.Format("{0:g}", (end - start)) + Environment.NewLine; RtbProgramInfo.Text += "Disambiguation pages: " + disambiguationPages.Count + Environment.NewLine; int childPageCount = 0; foreach (DisambiguationPageInfo disambPage in disambiguationPages) { childPageCount += disambPage.pages.Count; } RtbProgramInfo.Text += "Child pages: " + childPageCount; }