def _union_lcs(evaluated_sentences, reference_sentence, prev_union=None):
if prev_union is None:<EOL><INDENT>prev_union = set()<EOL><DEDENT>if len(evaluated_sentences) <= <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>lcs_union = prev_union<EOL>prev_count = len(prev_union)<EOL>reference_words = _split_into_words([reference_sentence])<EOL>combined_lcs_length = <NUM_LIT:0><EOL>for eval_s in evaluated_sentences:<EOL><INDENT>evaluated_words = _split_into_words([eval_s])<EOL>lcs = set(_recon_lcs(reference_words, evaluated_words))<EOL>combined_lcs_length += len(lcs)<EOL>lcs_union = lcs_union.union(lcs)<EOL><DEDENT>new_lcs_count = len(lcs_union) - prev_count<EOL>return new_lcs_count, lcs_union<EOL>
Returns LCS_u(r_i, C) which is the LCS score of the union longest common
subsequence between reference sentence ri and candidate summary C.
For example:
if r_i= w1 w2 w3 w4 w5, and C contains two sentences: c1 = w1 w2 w6 w7 w8
and c2 = w1 w3 w8 w9 w5, then the longest common subsequence of r_i and c1
is "w1 w2" and the longest common subsequence of r_i and c2 is "w1 w3 w5".
The union longest common subsequence of r_i, c1, and c2 is "w1 w2 w3 w5"
and LCS_u(r_i, C) = 4/5.

Args:
  evaluated_sentences: The sentences that have been picked by the
                       summarizer
  reference_sentence: One of the sentences in the reference summaries

Returns:
  float: LCS_u(r_i, C)

ValueError:
  Raises exception if a param has len <= 0