

@factory.post_generation
def init(self, create, extracted, **kwargs):
    sentences_amount = 20
    tokens = []
    sentences = [0]
    for sent_tokens in nltk.corpus.treebank.sents()[:sentences_amount]:
        tokens.extend(list(enumerate(sent_tokens)))
        sentences.append((sentences[(- 1)] + len(sent_tokens)))
    self.set_tokenization_result(tokens)
    self.set_sentencer_result(sentences)
    tree_strings = [x.pprint() for x in nltk.corpus.treebank.parsed_sents()[:x]]
    self.set_syntactic_parsing_result(tree_strings)

dataset/ETHPy150Open machinalis/iepy/tests/factories.py SyntacticParsedIEDocFactory.init/VarMisuse@126/157 `sentences_amount`->`x`