from typing import Sequence


def _get_matches(prediction: Sequence[str], reference: Sequence[str]
                 ) -> Sequence[bool]:
  """Get the token matches as a list of boolean.

  Args:
    prediction: The predicted token list.
    reference: The ground truth token list.

  Returns:
    A list of boolean. l[i] == True means that i:th token matched between the
    prediction and reference
  """
  matches = []
  for i in range(max(len(prediction), len(reference))):
    if i < len(prediction) and i < len(reference):
      matches.append(prediction[i] == reference[i])
    else:
      matches.append(False)
  return matches