Code Monkey home page Code Monkey logo

anagrams_genreator's Introduction

Anagrams Generator

This is a program for computing multiword anagrams. It makes no effort to come up with sentences that make sense; it only finds anagrammatic sentences, irrespective of meaning.

The simplest way to use it:

	find_anagrams(sentence)

This will return, and print on the screen, all the anagrams of sentence

Select the Dictionary

By default, select my dictionary of words is English. You can also select the Spanish dictionary.

find_anagrams(sentence ,dict_file='english.txt')
find_anagrams(sentence ,dict_file='spanish.txt')

Or pass your own dictionary. The dictionary format must be a text document with one word per line. An example of a mini-dictionary would be:

dog
home
fun

Include Words

If there are words that you want to be in your anagram, you include them like this:

find_anagrams(sentence, include=['dog','panda'])

It will only return the anagrams of sentence that contain the word dog and panda.

Exclude Words

If there are words that you dont want to be in your anagram, you exclude them like this:

find_anagrams(sentence, exclude=['cat'])

It will only return the anagrams of sentence that do not contain the word cat.

Console

If you want to use it more quickly you can simply call it from the console in the following way:

python anagrams.py  car has +a -rash -cash
>>> a crash
>>> a chars

anagrams_genreator's People

Contributors

dayfundora avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.