Returns whether title is a match for a specific section_title. Example: _matches_section_title('Yields', 'yield') == True Args: title: The title to check for matching. section_title: A specific known section title to check against.
(title, section_title)
| 602 | |
| 603 | |
| 604 | def _matches_section_title(title, section_title): |
| 605 | """Returns whether title is a match for a specific section_title. |
| 606 | |
| 607 | Example: |
| 608 | _matches_section_title('Yields', 'yield') == True |
| 609 | |
| 610 | Args: |
| 611 | title: The title to check for matching. |
| 612 | section_title: A specific known section title to check against. |
| 613 | """ |
| 614 | title = title.lower() |
| 615 | section_title = section_title.lower() |
| 616 | return section_title in (title, title[:-1]) # Supports plurals / some typos. |
| 617 | |
| 618 | |
| 619 | def _matches_section(title, section): |