Skip to content

Commit 7efd8ef

Browse files
committed
Docs: Explain why we have return "" in PostProcessor._last_non_punc_token_pos
1 parent 4c58b5b commit 7efd8ef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ingredient_parser/en/postprocess.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,9 @@ def _last_non_punc_token_pos(self, token_idx: list[int]) -> str:
568568

569569
return self.pos_tags[idx]
570570

571+
# Return empty string so we don't try to merge this with the next name.
572+
# This should never occur because self._postprocess_indices is called before
573+
# this and that function skips over any potential name that is all punctuation.
571574
return ""
572575

573576
def _postprocess_indices(

0 commit comments

Comments
 (0)