Python  1.0
Functions
_06d_anagrama Namespace Reference

Checking for anagrams. More...

Functions

def anagram (str1, str2)
 Checks whether two words are anagrams. More...
 
def isAnagram (a, b)
 Checks whether two words or phrases are anagrams. More...
 
def containsHiddenWord (hiddenWord, word)
 Determines whether the given hidden word can be obtained from the main word, by erasing some of its letters. More...
 
def main ()
 

Detailed Description

Checking for anagrams.

An anagram is a word or phrase formed by reordering the letters of another word or phrase, such as "satin" to "stain".

Examples:

  1. "porta" and "tropa"
  2. "Mary" and "Army".
  3. "Tom Cruise" and "So I'm cuter"
  4. "Tom Marvolo Riddle" and "I am Lord Voldemort"
  5. "Mother-in-law" and "Woman Hitler"
  6. "The earthquakes" and "That queer shake"
  7. "Debit card" and "Bad credit"
  8. "Slot machines" and "Cash lost in 'em"
  9. "School master" and "The classroom"
  10. "Eleven plus two" and "Twelve plus one"
  11. "Dormitory" and "Dirty room"
  12. "Punishment" and "Nine Thumps"
  13. "Desperation" and "A rope ends it"
  14. "The Morse code" and "Here come dots"
  15. "Snooze alarms" and "Alas! No more Zs"
  16. "A decimal point" and "I'm a dot in place"
  17. "Astronomer" and "Moon starer"
  18. "Fir cones" and "Conifers"
  19. "The eyes" and "They see"
  20. "Payment received" and "Every cent paid me"
  21. "Conversation" and "Voices rant on"
  22. "The public art galleries" and "Large picture halls, I bet"
  23. "Election results" and "Lies – let's recount"
  24. "Halley's Comet" and "Shall yet come"
  25. "The Hurricanes" and "These churn air"
Author
Paulo Roma
See also
http://en.wikipedia.org/wiki/Anagram
http://www.fun-with-words.com/anag_example.html

Function Documentation

◆ anagram()

def _06d_anagrama.anagram (   str1,
  str2 
)

Checks whether two words are anagrams.

An anagram is a type of word play, which is the result of rearranging the letters of a word or phrase to produce a new word or phrase, using all the original letters exactly once.

For example: "orchestra" can be rearranged into "carthorse".

Parameters
str1first string.
str2second string.
Returns
True if str1 and str2 are anagrams, and False otherwise.

Referenced by main().

◆ containsHiddenWord()

def _06d_anagrama.containsHiddenWord (   hiddenWord,
  word 
)

Determines whether the given hidden word can be obtained from the main word, by erasing some of its letters.

Parameters
hiddenWordthe word we're looking for
wordmain word
Returns
true if we can find the hidden word in main word

Referenced by main().

◆ isAnagram()

def _06d_anagrama.isAnagram (   a,
  b 
)

Checks whether two words or phrases are anagrams.

An anagram is a type of word play, which is the result of rearranging the letters of a word or phrase to produce a new word or phrase, using all the original letters exactly once.

For example: "orchestra" can be rearranged into "carthorse".

Parameters
afirst string.
bsecond string.
Returns
True if str1 and str2 are anagrams, and False otherwise.

Referenced by main().

◆ main()

def _06d_anagrama.main ( )