Giter Club home page Giter Club logo

recurse-words's Introduction

Documentation Status

recurse-words

find words that have other words in them that when you remove the inner word what's left is still a word

An example word tree of such a kind

and do other stuff too like evaluate the modular phonetic structure of English like

from recurse_words import Graph_Recurser, Graph
recurser = Graph_Recurser('phonetic_common')
recurser.recurse_all_words(
    min_include_word = 3,
    min_test_word    = 2,
    min_clipped_word = 2
)
Graph(recurser).render_graph('img').save('/some/path.png')

The replacement, addition, and subtraction structure of the phonetic transcription of the 10,000 most common english words

main docs at https://recurse-words.readthedocs.io/

   ______________________________
 / \                             \.
|   |      p l e s               |.
 \_ |        t a k e             |.
    |          n o t e           |.
    |     -------------------    |.
    |                            |.
    |     this software is       |.
    |     developed expressly    |.
    |     for the purpose of     |.
    |     "funzies"              |.
    |                            |.
    |     i make no promises     |.
    |     that it works          |.
    |     or is good             |.
    |                            |.
    |   _________________________|___
    |  /                            /.
    \_/dc__________________________/.

installation

From pypi:

pip install recurse-words

From github:

git clone https://github.com/sneakers-the-rat/recurse-words
pip install ./recurse-words
# or
poetry install ./recurse-words

usage

Point the recurser at a file that has a list of words, for example this one, and let 'er rip

from recurse_words import Recurser

recurser = Recurser('path/to/some/words.txt')
recurser.recurse_all_words()
recurser.save('word_trees.pck')

# see word trees by a few metrics
# max tree depth
recurser.by_depth
# total number of leaves
recurser.by_leaves
# total number of edges
recurser.by_density

Draw network graphs!

recurser.draw_graph('some_word', '/output/directory')

Auto-download different corpuses!

recurser = Recurser(corpus='english')
recurser = Recurser(corpus='phonetic')

recurse-words's People

Contributors

sneakers-the-rat avatar

Watchers

James Cloos 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.