<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_chain(cls, chain_json, corpus=None, parsed_sentences=None):
 """ Init a Text class based on an existing chain JSON string or object If corpus is None, overlap checking won't work. """

        chain = Chain.from_json(chain_json)
        return cls(corpus or None, parsed_sentences=parsed_sentences, state_size=chain.state_size, chain=chain)