code: function removeUnfinishedItems(states) {
    return states.map((state) => state.filter((earleyItem) => {
      return earleyItem.position >= earleyItem.rule.length;
    }));
  }
docs: Removes earley items from each state that failed to completely parse through.
  In other words, removes earley items whose position is less than the length
  of its rule
  
  @function removeUnfinishedItems
  @param {state[]} states - Set of lists of earley items
  @return {state[]} Set of lists of completed earley items