Expand description
Text normalization: this is the piece that decides whether “The Beatles”, “Beatles, The” and “beatles” designate the same entity.
All entity matching rests on normalize, until M1 brings identifiers
that do not depend on spelling.
When MusicBrainz arrives (M1), these normalized keys will remain the safety
net for unidentified files.
Functions§
- disc_
folder - The disc a folder name announces, when it announces one.
- extract_
year - Extracts the first year from a tag date, whatever its shape
(
1986,1986-03-05,05/03/1986,1986.03). - file_
name - Last component of a path, extension included.
- folder
- Containing directory of a path, without its trailing separator.
- format_
duration - Formats a duration as
h:mm:ssorm:ss. - format_
size - Formats a size in bytes in a readable way.
- is_
under truewhen a path is the folder itself or something inside it.- normalize
- Matching key: lowercase, without diacritics, without punctuation, with normalized spacing and the leading article moved.
- parse_
track_ number - Reads a track number in the
5or5/12form, returning(number, total). - plural
- A count and its noun, agreeing:
1 track,2 tracks,3 analyses. - relative_
under - A portable relative path under a catalog folder, or
Noneoutside it. - sort_
name - Sort name: “The Beatles” -> “Beatles, The”, as discographic usage requires.
- split_
artists - Splits multiple artists out of a single tag field.
- without_
restatements - Drops, from one tag’s list of names, the ones that only say again what the other entries of that same list already say.