Giter Club home page Giter Club logo

jumble-words-solver-using-webapp2's Introduction

Jumble words solver using Python and webapp2

Anargam

is_anagram:

def is_anagram(word1, word2):
    """Returns True if anagram is found. Else return False."""
    count = 0
    word1, word2 = list(word1), list(word2)  #get a list of charectors in the words
    if len(word1) == len(word2):             #match the dictionary word only if same length
          for i in word1:                    #removes a letter from the word and increase count
                   if i in word2:
                    word2.remove(i)
                    count += 1
          if count == len(word1):           #if count == lenght then its a match
               return True
    return False

anagramFind:

def anagramFind(wd_in):
    file = open('words.txt')              #open dictionary 
    wd_in=wd_in.lower();                  #make input string to lower case
    tmpString = ""                        #string of matched words
    found = 0
    for line in file:                     #loop through the dictionay
     if is_anagram(wd_in,line.strip()):
        found += 1
        tmpString += line.strip() + ", " 
    return tmpString, found

Run locally

Requrements: Python 2.7.10, google-cloud-sdk

git clone https://github.com/indrajithi/Jumble-words-Solver-using-webapp2

cd Jumble-words-Solver-using-webapp2/

dev_appserver .

If everything goes smooth the server will be up and running at http://localhost:8080/

jumble-words-solver-using-webapp2's People

Contributors

indrajithi avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

bowserinator

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.