function toJSON( file, data ) {
	var parts;
	var out;
	var v;

	parts = file.match( RE );
	out = {};

	v = parseInt( parts[ 1 ], 10 );
	debug( 'Year: %d', v );
	out.year = v;

	v = unsnakecase( parts[ 2 ] );
	debug( 'Name: %s', v );
	out.name = v;

	v = PARTY[ parts[ 3 ] ];
	debug( 'Party: %s', v );
	out.party = v;

	out.text = data;

	// Remove newline characters inserted by text editors at the end of each file:
	out.text = replace( out.text, RE_TRAILING_NEWLINE, '' );

	return JSON.stringify( out );
}
Converts file data to JSON.

@private
@param {string} file - file name
@param {string} data - file data
@returns {string} data as JSON