MCPcopy Index your code
hub / github.com/clips/pattern / _parse_article_section_structure

Method _parse_article_section_structure

pattern/web/__init__.py:1746–1754  ·  view source on GitHub ↗
(self, article)

Source from the content-addressed store, hash-verified

1744 return article
1745
1746 def _parse_article_section_structure(self, article):
1747 # Sections with higher level are children of previous sections with lower level.
1748 for i, s2 in enumerate(article.sections):
1749 for s1 in reversed(article.sections[:i]):
1750 if s1.level < s2.level:
1751 s2.parent = s1
1752 s1.children.append(s2)
1753 break
1754 return article
1755
1756class MediaWikiArticle(object):
1757

Callers 1

searchMethod · 0.95

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected