local p = {}; 

function p.marriage(frame)		
	local spouse_name = frame.args[1]  -- spouse name

	local married_start_date = frame.args[2]  -- marriage start date

	local married_end_date = frame.args[3]  -- marriage start date


	local married_end_type = frame.args['end']  -- marriage end type marriage end type could be end= or reason= ; end=    d, d., or died includes died within the parentheses if the marriage ended on the spouse's death.; end= div, div., or divorced includes div. or divorced within the parentheses;end=value includes customized text to be included within parentheses.

	local married_end_reason = frame.args['reason']  -- marriage end type marriage end type could be end= or reason= ; end=    d, d., or died includes died within the parentheses if the marriage ended on the spouse's death.; end= div, div., or divorced includes div. or divorced within the parentheses;end=value includes customized text to be included within parentheses.
    if (married_endtype == nil) then
       marriage_end=married_end_reason
    elseif(married_end_reason==nil) then
       marriage_end=married_end_type
    end
    local reason=""
    if(marriage_end ~= nil )then
       reason='('..marriage_end..')'
    end
	return spouse_name ..'(m.'..married_start_date..'-'..married_end_date..')'..reason

end

return p