private void InsertRow() { var item = new MonthText(); Citations = Citations == null ? new ObservableCollection <MonthText>() : Citations; Citations.Add(item); }
/// <summary> /// Categorize properties of page to Infobox, Citation, Geobox /// </summary> /// <param name="pages">List of pages</param> private static void CategorizeProperties(List <Page> pages) { foreach (var page in pages) { foreach (var item in page.Infoboxes) { var type = item.GetType(); item.SetRegexAttributes(); if (type == typeof(Infobox)) { var info = item as Infobox; Locations.AddRange(GetNamedEntities(info, NamedEntityType.Location)); Persons.AddRange(GetNamedEntities(info, NamedEntityType.Person)); Organizations.AddRange(GetNamedEntities(info, NamedEntityType.Organization)); Infoboxes.Add(info); } else if (type == typeof(Citation)) { var cit = item as Citation; cit.AddFullNames(); Locations.AddRange(GetNamedEntities(cit, NamedEntityType.Location)); Persons.AddRange(GetNamedEntities(cit, NamedEntityType.Person)); Organizations.AddRange(GetNamedEntities(cit, NamedEntityType.Organization)); Citations.Add(cit); } else if (type == typeof(Geobox)) { var geo = item as Geobox; Locations.AddRange(GetNamedEntities(geo, NamedEntityType.Location)); Persons.AddRange(GetNamedEntities(geo, NamedEntityType.Person)); Geoboxes.Add(geo); } } } }