Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Anagrams

Name: Fouad Teniou 2010-06-26 22:15

#On the name of ALLAH and may the blessing and peace of Allah
#be upon the Messenger of Allah Mohamed Salla Allahu Aliahi Wassalam.
#Author : Fouad Teniou
#Date : 15/06/10
#version :2.6

from string import *
from itertools import *

"""
My program uses special functions to test, count, and extract vowels and consonants.
However,the string_check function uses isinstance() to check an objects type
and isinstance(obj, str) will be True only if obj is a str, and the
vowel_or_Consonant is a boolean function that accept a text(string)as
an argument and which return either True or False and which you can call in
the program at any time to test every letter within a string to
determine whether it is a vowel or consonant.
Though, Vowel and Consonant functions return the count of each vowel and consonant.
and Anagrams_search function return a set of every possible combination,thus,
every possible Anagram.

"""

def my_try(arg =''):
    """ Raises an error exception if a letter is not in the alphabet or if the letter is not a space character ."""

    for item in arg:
        if item not in 'abcdefghijklmnopqrstuvwxyz ':
            raise TypeError,\
                "\n<Every letter within the text should be in the alphabet. \n"

def string_check(function):
    """
    A function which uses isinstance to determine whether an object is a string.
    """
   
    def wrapper(character):
        # string_check raises assertionError
        # if the character is not a string
        assert isinstance(character, str),\
        "Please enter a string and not %s" % (character)
        return function(character)
    return wrapper
   
def Vowel_or_Consonant(char = ''):
    """
    A boolean function, which return either True or False
    """

    # Determine whether each letter in the text is a vowel or a
    # consonant. if it is a vowel, set test to True, otherwise, set test to false.
    for i in char:
        if str(i)in 'aeiouy':
            test = True
        else :
            test = False
        # Return the value of the test variable   
        return test
       
@string_check   
def Vowel(text = ''):
    """
    A function which return a set of vowels and the total
    number of each vowel in the text.
    """
   
    #empty string
    string_A = ''
    for item in lower(text):
        if Vowel_or_Consonant(str(item)):
            string_A += item
           
    # sort a string_A
    char_A = sorted(string_A)
   
    # vowels' counts
    return "\n<The vowels are : %s \n" % \
           [(arg, len(list(karg))) for arg, karg  in groupby(char_A)]

@string_check          
def Consonant(text = ''):
    """
    A function which return a set of consonants and the total
    number of each consonant in the text.
    """
   
    string_B = ''
    string_C = ''
    for arg in lower(text):
        if not Vowel_or_Consonant(str(arg)) and str(arg) in 'bcdfghjklmnpqrstvwxz':
            string_B += arg
        elif not Vowel_or_Consonant(str(arg)) and str(arg) not in 'bcdfghjklmnpqrstvwxz':
            string_C += arg
    # sort a string_B
    char_B = sorted(string_B)
    char_C = sorted(string_C)
    # consonants and others characters' Counts
    return "<The consonants are :%s \n\n<And the others characters are : %s\n" % \
           ([(arg, len(list(karg))) for arg, karg in groupby(char_B)],\
            [(arg, len(list(karg))) for arg, karg in groupby(char_C)])

def Anagrams_search(phrase = ''):
    """
    A function which return a set of every combination possible and for
    every word within a text.
    """
    #empty list
    mylist = []
    try:
        my_try(lower(phrase))
       
        for word in list(split(phrase)):
            #every possible combination for each word within the text
            split_list = [arg for arg in permutations(lower(word),len(word))]
   
            for item in split_list:
                split_list = join(item,'')
                #append mylist
                mylist.append(split_list)
        # a list of every possible combination including anagrams
        return "<The list of every possible combination and anagrams : %s" % \
               mylist
    #The program raise TypeError if input is not in the alphabet
    except TypeError,exception :
        print exception

if __name__ == "__main__":
 

    vowels = Vowel('Fouad Teniou')
    print vowels
    consonants = Consonant('Fouad Teniou')
    print consonants
    anagrams = Anagrams_search('Ten iou')
    print anagrams
    anagrams1 = Anagrams_search('Ten i7u')
    print anagrams1

#######################################################################

#python "C:\PythonPrograms\Anagrams-vowels-consonants.py"

#<The vowels are : [('a', 1), ('e', 1), ('i', 1), ('o', 2), ('u', 2)]

#<The consonants are :[('d', 1), ('f', 1), ('n', 1), ('t', 1)]

#<And the others characters are : [(' ', 1)]

#<The list of every possible combination and anagrams :
#['ten', 'tne', 'etn', 'ent', 'nte', 'net', 'iou', 'iuo', 'oiu', 'oui', 'uio', 'uoi']

#<Every letter within the text should be in the alphabet.

Name: Anonymous 2010-06-29 5:02

>>40
HAX MY ANUSRAM

Name: Anonymous 2010-06-29 6:56

HAX MY ANAGRAM is an anagram of Max, a angry ham

Name: Anonymous 2010-08-07 5:38

>>31
Fuck you, faggot.

Name: Anonymous 2010-08-07 7:14

>>43
Puma Pant Bus is an anagram of Bampu Pantsu

Name: Anonymous 2010-08-07 7:18

It's like, how much more pathetic could this be?  And the answer is none.  None more pathetic.

Name: Anonymous 2010-08-07 13:50

>>45
None more pathetic is an anagram of Pie motto enhancer

Name: Anonymous 2010-08-07 14:04

MANUAL SHAKE?

Name: Anonymous 2010-08-07 14:09

>>45
It is now that you're here.

Name: Anonymous 2010-08-07 16:48

>>48
OOOH BURNNNNNN!!!!!!!1111one __/10?

Name: Anonymous 2010-08-09 7:52

i am a heron. i haev a long neck and i pick fish out of the water w/ my beak. if you dont repost this comment on 10 other pages i will fly into your kitchen tonight and make a mess of your pots and pans

Name: Polecat 2010-08-12 6:54

Polecat Kebabs

Name: Anonymous 2010-11-27 0:38

>>-,-,-,-,-,-
Polecat kebabs

Name: Anonymous 2010-11-27 1:07

>>52
-,-

Name: Anonymous 2010-11-27 1:36

Kolebat Pecabs

Name: Anonymous 2010-11-27 3:36

Olebats Pebkac

Name: Anonymous 2010-12-21 2:00

Name: Anonymous 2011-01-12 4:37

HAX MY polecat kebaps

Name: Anonymous 2011-01-12 4:49

>>30
SEE‽ I ope you're proud of yourself you anusboard.

Name: Anonymous 2011-01-12 5:02

>>58-59
We'd be even prouder of ourselves if you'd just fuck off, but why yes, thanks for asking.

Name: Anonymous 2011-01-12 7:13

>>60
Mad

Name: Anonymous 2011-01-12 9:09

>>59
I respect >>30, he made an important contribution to /prog/ culture. And what can you be proud of? You, with your barbaric interrobang and lack of sage?!

Name: Anonymous 2011-01-12 11:13

Name: Anonymous 2011-01-12 16:56

/backplate getgoes/
[m][i][o][u]/pocketable aggest/[/i][/o][/i][/m]

Name: Anonymous 2011-01-12 21:14

My Seaweed Rove Dyke is an analgram of Smoke weed everyday.

Name: Anonymous 2011-01-12 21:28

Smoked cheese erry nyoro~n

Name: Anonymous 2011-01-13 3:04

             -‐ '´ ̄ ̄`ヽ、
             / /" `ヽ ヽ  \
         //, '/     ヽハ  、 ヽ
         〃 {_{       リ| l.│ i|  ぬ
         レ!小lノ    `ヽ 从 |、i|  る
          ヽ|l ●   ●  | .|ノ│  ぽ
            |ヘ⊃ 、_,、_,⊂⊃j  | , |.  l
          | /⌒l,、 __, イァト |/ |  ん
.          | /  /::|三/:://  ヽ |
          | |  l ヾ∨:::/ ヒ::::彡, |

Name: Anonymous 2011-02-03 7:08

Name: Anonymous 2011-03-15 10:42

GET

Name: Anonymous 2011-03-15 11:38

Autism is an anagram for Autism.

Name: Anonymous 2011-03-15 17:54

>>70
No it's not.

Name: Anonymous 2011-03-15 19:33

dicks

Name: Anonymous 2011-03-16 4:28

fuque

Name: Anonymous 2011-03-16 4:30

f

Name: Anonymous 2011-03-16 4:32

f

Name: Anonymous 2011-03-16 5:24

Have any of you ever seen his videos on YouTube? Goddamn he is fucking shit.

Name: Anonymous 2011-03-16 5:26

Back to /b/, ``GNAA Faggot''

Name: Anonymous 2012-10-20 12:02

le polecat kebabs face

Name: t make a thread 2012-10-20 12:09

Does someone know what's happening?

Hello /prog/ it's my first time on here.
I'm having a bit of a problem right now.
Well.
I'll just state the details.

My taskbar isn't visible.
I can't see any of my desktop icons on the screen.

The only thing I can see is my wallpaper.
If I restart my laptop it would be back to normal, but this usually happens after the taskbar goes white and blocky ( kind of like the old windows thing.)

It's been bugging me for a while.
Also I'm only able to access the web right now because Avast is open and I clicked Support then Check FAQ.

The browser closes sometimes.
Please help.
Feel free to ask questions.

Name: Anonymous 2012-10-20 13:37

>>30
I don't remember this being so new.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List