Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +1 points for every 100 words
- +1 points for every child element that has > 100 words
- -1 points if the section name contains the word 'nav'
- -2 points if the section name contains the word 'advert'
- # Import the Template class.
- >>> from templatemaker import Template
- # Create a Template instance.
- >>> t = Template()
- # Learn a Sample String.
- >>> t.learn('<b>this and that</b>')
- # Output the template so far, using the "!" character to mark holes.
- # We've only learned a single string, so the template has no holes.
- >>> t.as_text('!')
- '<b>this and that</b>'
- # Learn another string. The True return value means the template gained
- # at least one hole.
- >>> t.learn('<b>alex and sue</b>')
- True
- # Sure enough, the template now has some holes.
- >>> t.as_text('!')
- '<b>! and !</b>'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement