quadrismegistus / cadence Goto Github PK
View Code? Open in Web Editor NEWRhythm analysis toolkit in Python
License: MIT License
Rhythm analysis toolkit in Python
License: MIT License
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.