WikiCrawler/Batch/BatchUploader.cs
/// <summary>
/// Parses an object's physical description (dimensions, medium).
/// </summary>
Parses an object's physical description (dimensions, medium).
Parses an object ' s physical description ( dimensions medium ) .
protected void ParsePhysicalDescription(string raw, out string medium, out Dimensions dimensions)
	{
		string[] split = raw.Split(';');
		for (int i = 0; i < split.Length; i++)
		{
			split[i] = split[i].Trim();
			if (Dimensions.TryParse(split[i], out dimensions))
			{
				dimensions = dimensions.Flip();
				medium = "";
				for (int j = 0; j < split.Length; j++)
				{
					if (j != i)
					{
						medium = StringUtility.Join("; ", medium, split[j]);
					}
				}
				return;
			}
		}
		dimensions = Dimensions.Empty;
		medium = raw;
		return;
	}
protected void ParsePhysicalDescription ( string raw , out string medium , out Dimensions dimensions ) { string [ ] split = raw . Split ( ' ' ) ; for ( int i = 0 ; i < split . Length ; i ++ ) { split [ i ] = split [ i ] . Trim ( ) ; if ( Dimensions . TryParse ( split [ i ] , out dimensions ) ) { dimensions = dimensions . Flip ( ) ; medium = " " ; for ( int j = 0 ; j < split . Length ; j ++ ) { if ( j != i ) { medium = StringUtility . Join ( " " , medium , split [ j ] ) ; } } return ; } } dimensions = Dimensions . Empty ; medium = raw ; return ; }
Parses an object's physical description (dimensions, medium).
Parses an object ' s physical description ( dimensions medium ) .
// does this look like a dimension? // these are usually backwards //TODO: check image aspect ratio // the medium is everything else
raw
string
string
out
Dimensions
out