Giter VIP home page Giter VIP logo

metroscope's People

Contributors

dependabot[bot] avatar syvwlch avatar

Stargazers

 avatar

Watchers

 avatar

metroscope's Issues

Add support for alternate pronunciations from cmu_dict & custom_dict

So after some refactoring in PR #68, the only thing I pull from CMU dict are the phones.
Currently, when I do, I use the first item in the list and ignore any others, and in the custom dict I only store one.

So to support multiple pronunciations, I would need to:

  • Make the 'phones' key in custom dict point to a list containing the current string.

  • Add a new property which represents the index into the word's phones list, and which raises an IndexError when set out of range and is irrelevant when the list is None.

  • Update all the consumers of _phones to use the index, not zero.

Store the phones for the original word in WordBuilder instance and custom dict

Store the entire phones, because that's the underlying data for both the stresses() method and the rhyming_part() method of the pronouncing package.
Which means that once I have the phones in custom_dict, I should stop using stresses_for_word() and instead call stresses() directly, and add a _phones property to WordBuilder.

Make custom_dict fail safe

Add default values for when a particular key is missing in the dict for an entry, eg the entry has syllables but no stresses.

Move the poems to a database

Instead of storing the poems in text files and running the analysis each time, load the entire data object into a database with the following tables:

  • poems
  • poets
  • meters

Update the run script to:

  • load the four sample poems into the database on start
  • load the poem objects from the database instead of from disk

Check custom dictionary before CMU

Now that there’s a custom dictionary for words that don’t show in CMU, check it first.

Should be faster and would allow overriding UNC if needed?

Add users

So the site can keep track of the scansion proposed by various users.

stress_line marks vowels that are silent/elided

Broke this off from #12 since the fix will be different.

Currently I can force an elision by replacing the offending vowel with an inverted comma in the original text, but that looks weird when the syllable is silent in normal speech.

Alternatively, I can add an entry to the custom dict, but that will only scale for the most common occurrences.

Add database to Flask

  • install SQLAlchemy’s flask plugin

  • create the first table

  • add a shell context processor

  • add data via shell

Add more poems!

Add the major poems from chapter one of the handbook of poetry.

Implement syllable-hyphenation

Use Pyphen with a custom dictionary in front to fix those cases where hyphenation doesn’t break along all syllables, e.g. equi-va-lent versus e/qui/va/lent.

Switch from SonoriPy to NLTK

SonoriPy has been incorporated into NLTK and will no longer be updated, as per recent update to its repository.

Need to plan a transition, probably once I'm really solid on the unit tests for the functions that use it.

Add rhyming_part to custom_dict

Two ways to do this:

  1. Just store the actual phones as if they came from CMU_dict.
  2. Store a word that is in CMU_dict and rhymes with the custom word.

Refactor line-level logic into a class

Current line level logic manipulates strings directly.

Refactor that logic into a class while separating the analysis logic from the display logic. An instance of the line-level class should contain a list of the WordBuilder class instances for all of the words in the line, and build any string representations from that list as needed.

For this refactoring exercise, there will be three string representations:

  • str

  • repr

  • refactored logic to generate the HTML currently shown on the site

Switch to html output

In particular it would be handy to tab each word so that highlighting could be done via css?

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.