File tree Expand file tree Collapse file tree 2 files changed +23
-7
lines changed
Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -304,12 +304,27 @@ def stripAccents(inputString: str) -> str:
304304 >>> common.stripAccents(s)
305305 'tres vite'
306306
307- Also handles the German Eszett
307+ Also handles the German Eszett and smart quotes
308308
309309 >>> common.stripAccents('Muß')
310310 'Muss'
311+ >>> common.stripAccents('Süss, “êtré”')
312+ 'Suss, "etre"'
313+
314+ Note -- is is still possible to have non-Ascii characters after this,
315+ like in this Japanese expression for music:
316+
317+ >>> common.stripAccents('音楽')
318+ '音楽'
311319 '''
312- nfkd_form = unicodedata .normalize ('NFKD' , inputString ).replace ('ß' , 'ss' )
320+ nfkd_form = (
321+ unicodedata .normalize ('NFKD' , inputString )
322+ .replace ('ß' , 'ss' )
323+ .replace ('“' , '"' )
324+ .replace ('”' , '"' )
325+ .replace ('‘' , "'" )
326+ .replace ('’' , "'" )
327+ )
313328 return '' .join ([c for c in nfkd_form if not unicodedata .combining (c )])
314329
315330
@@ -324,7 +339,7 @@ def normalizeFilename(name: str) -> str:
324339 without any accented characters.
325340
326341 >>> common.normalizeFilename('03-Niccolò all’lessandra.not really.xml')
327- '03-Niccolo_alllessandra_not_really .xml'
342+ '03-Niccolo_all_lessandra_not_really .xml'
328343 '''
329344 extension = None
330345 lenName = len (name )
Original file line number Diff line number Diff line change 175175
176176class Metadata (base .Music21Object ):
177177 r'''
178- Metadata represent data for a work or fragment, including title, composer,
179- dates, and other relevant information.
178+ Metadata objects contain information about a work, including title, composer,
179+ dates, and other relevant information. Metadata objects can also cover a fragment
180+ of a Score such as individual parts or a range of measures.
180181
181182 Metadata is a :class:`~music21.base.Music21Object` subclass, meaning that it
182183 can be positioned on a Stream by offset and have a
183184 :class:`~music21.duration.Duration`.
184185
185- In many cases, each Stream will have a single Metadata object at the zero
186- offset position.
186+ In many cases, each Stream will have a single Metadata object at the zero-offset
187+ position.
187188
188189 To get a simple string, use attribute-style access by unique name.
189190 Some workIds from music21 v7 have been renamed (e.g. 'date' has been renamed
You can’t perform that action at this time.
0 commit comments