<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sentence2freqt(docgraph, root, successors=None, include_pos=False, escape_func=FREQT_ESCAPE_FUNC):
 """convert a sentence subgraph into a FREQT string."""

    if successors is None:
        successors = sorted_bfs_successors(docgraph, root)

    if root in successors:  # root node has children / subgraphs
        embed_str = u"".join(sentence2freqt(docgraph, child, successors,
                                            include_pos=include_pos,
                                            escape_func=escape_func)
                             for child in successors[root])
        return node2freqt(
            docgraph, root, embed_str, include_pos=include_pos,
            escape_func=escape_func)
    else:  # root node has no children / subgraphs
        return node2freqt(docgraph, root, include_pos=include_pos,
                          escape_func=escape_func)