Skip to content

Commit 1a290a5

Browse files
committed
Lint: Add __repr__ method for SentenceStructureFeatures class
1 parent 408c510 commit 1a290a5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ingredient_parser/en/_structure_features.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ def __init__(self, tokenized_sentence: list[Token]):
7474
self.sentence_splits = self.detect_sentences_splits(tokenized_sentence)
7575
self.example_phrases = self.detect_examples(tokenized_sentence)
7676

77+
def __repr__(self) -> str:
78+
return (
79+
"SentenceStrucureFeatures("
80+
+ f"mip_phrases: {self.mip_phrases}, "
81+
+ f"sentence_splits: {self.sentence_splits}, "
82+
+ f"example_phrases: {self.example_phrases})"
83+
)
84+
7785
def _get_subtree_indices(
7886
self, parent_tree: nltk.Tree, subtree: nltk.Tree
7987
) -> list[int]:

0 commit comments

Comments
 (0)