WikiCrawler/Utility/CategoryTranslation.cs
/// <summary>
/// If the specified tag is mapped to categories, returns the categories.
/// </summary>
If the specified tag is mapped to categories, returns the categories.
If the specified tag is mapped to categories returns the categories .
public static IEnumerable<string> GetMappedCategories(string tag)
		{
			CategoryMappingData mappedData;
			if (s_categoryMap.TryGetValue(tag, out mappedData))
			{
				for (int i = 0; i < mappedData.Cats.Count; i++)
				{
					if (!CategoryTree.AddToTree(mappedData.Cats[i], 2))
					{
						Console.WriteLine("Failed to find mapped cat '" + mappedData.Cats[i] + "'.");
						mappedData.Cats.RemoveAt(i);
					}
				}
				mappedData.Usage++;
				return mappedData.Cats;
			}
			else
			{
				s_categoryMap[tag] = new CategoryMappingData();
				return null;
			}
		}
public static IEnumerable < string > GetMappedCategories ( string tag ) { CategoryMappingData mappedData ; if ( s_categoryMap . TryGetValue ( tag , out mappedData ) ) { for ( int i = 0 ; i < mappedData . Cats . Count ; i ++ ) { if ( ! CategoryTree . AddToTree ( mappedData . Cats [ i ] , 2 ) ) { Console . WriteLine ( " " + mappedData . Cats [ i ] + " " ) ; mappedData . Cats . RemoveAt ( i ) ; } } mappedData . Usage ++ ; return mappedData . Cats ; } else { s_categoryMap [ tag ] = new CategoryMappingData ( ) ; return null ; } }
If the specified tag is mapped to categories, returns the categories.
If the specified tag is mapped to categories returns the categories .
//verify that the categories are good against the live database //flag this category as needing manual mapping
tag
string