Code Monkey home page Code Monkey logo

cadence's People

Contributors

quadrismegistus avatar tomaarsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cadence's Issues

parsing error with python-3.10

I'm getting following error when trying to use example from readme:

>>> sonnet.words()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/slg/projects/poetry/.cadence-venv/lib/python3.10/site-packages/cadence/parsers/docs.py", line 155, in words
    def words(self,para_i=None,**kwargs): return self.get_data(para_i,'words',**kwargs)
  File "/home/slg/projects/poetry/.cadence-venv/lib/python3.10/site-packages/cadence/parsers/docs.py", line 147, in get_data
    odf=func(index=index,**self.kwargs(kwargs))
  File "/home/slg/projects/poetry/.cadence-venv/lib/python3.10/site-packages/cadence/parsers/docs.py", line 222, in words
    return setindex(self._words) if index else resetindex(self._words)
  File "/home/slg/projects/poetry/.cadence-venv/lib/python3.10/site-packages/cadence/tools/tools.py", line 211, in setindex
    df = df[set(df.columns) - set(df.index.names)]
  File "/home/slg/projects/poetry/.cadence-venv/lib/python3.10/site-packages/pandas/core/frame.py", line 3713, in __getitem__
    check_dict_or_set_indexers(key)
  File "/home/slg/projects/poetry/.cadence-venv/lib/python3.10/site-packages/pandas/core/indexing.py", line 2611, in check_dict_or_set_indexers
    raise TypeError(
TypeError: Passing a set as an indexer is not supported. Use a list instead.

The same issue with python-3.9
Let me know if you need more info.
Thanks.

Phonetic transcription of some words with apostrophe contain `bæk.slæʃ`

Here is a minimal example to reproduce the problem:

import cadence as cd

words_with_apostrophe = cd.Prose("Feed'st beauty's light's mak'st")
words_with_apostrophe.sylls()
para_i sent_i sentpart_i line_i word_i word_str  word_tok word_ipa_i word_ipa               syll_i syll_str syll_ipa syll_stress syll_weight                 ...            
1      1      1          1      1      Feed'st   feedst   1          'fidst                 1      Feed'st  'fidst   P           H                      NaN  ...           1
                                2       beauty's beautys  1          'bjʉː.tɪ.'bæk.slæ.'ʃɛs 1      bea      'bjʉː    P           L                      1.0  ...           5
                                                                                            2      u        tɪ       U           L                      0.0  ...           5
                                                                                            3      ty       'bæk     P           H                      1.0  ...           5
                                                                                            4      '        slæ      U           L                      0.0  ...           5
                                                                                            5      s        'ʃɛs     P           H                      1.0  ...           5
                                3       light's  lights   1          'laɪts                 1      light's  'laɪts   P           H                      NaN  ...           1
                                4       mak'st   makst    1          'mæk.'bæk.slæʃ.sʌnt    1      mak      'mæk     P           H                      NaN  ...           4
                                                                                            2      '        'bæk     P           H                      1.0  ...           4
                                                                                            3      s        slæʃ     U           H                      0.0  ...           4
                                                                                            4      t        sʌnt     U           H                      NaN  ...           4

[11 rows x 6 columns]

Feed'st and light's are transcribed correctly, while beauty's and mak'st are transcribed as 'bjʉː.tɪ.'bæk.slæ.'ʃɛs and 'mæk.'bæk.slæʃ.sʌnt

The issue seems related to quadrismegistus/prosodic#44

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.