from typing import List


def _convert_nom_indices_to_wordpiece_indices(nom_indices: List[int], end_offsets: List[int]):
    """
    Converts binary nom indicators to account for a wordpiece tokenizer.

    Parameters:

    nom_indices: `List[int]`
        The binary nom indicators: 0 for not the nom, 1 for the nom.
    end_offsets: `List[int]`
        The wordpiece end offsets, including for separated hyphenations.

    Returns:

    The new nom indices.
    """
    j = 0
    new_nom_indices = []
    for i, offset in enumerate(end_offsets): # For each word's offset (includes separated hyphenation)
        indicator = nom_indices[i] # 1 if word at i is part of nominal predicate, 0 if not.
        while j < offset: # Append indicator over lenth of wordpieces for word.
            new_nom_indices.append(indicator) 
            j += 1

    # Add 0 incidators for cls and sep tokens.
    return [0] + new_nom_indices + [0]