-
Notifications
You must be signed in to change notification settings - Fork 2k
lastgenre: Genre spelling normalization (aliases) #6466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JOJ0
wants to merge
9
commits into
master
Choose a base branch
from
lastgenre_aliases
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b20d0ad
lastgenre: Test aliases and ship default config
JOJ0 889731c
lastgenre: Docs for genre normalization (aliases)
JOJ0 5ee9630
lastgenre: Docs hint on canonical without whitelist
JOJ0 facd175
lastgenre: Implement genre alias normalization
JOJ0 faa3808
lastgenre: Slightly optimize filter_valid performance
JOJ0 c1c8be4
Fixes/additions to default aliases
JOJ0 df60f31
Fix normalize_genre docstring wording
JOJ0 bc682d2
Test invalid alias template catch
JOJ0 6dd4a4c
Catch exception on invalid alias template
JOJ0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| # Default genre aliases for the lastgenre plugin. | ||
| # | ||
| # Keys are canonical names and support \g<N> back-references to pattern groups. | ||
| # Patterns are case-insensitive full-matches. Order matters: first match wins. | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Ampersands / Delimiters | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| # drum and bass (d&b, dnb, drum n bass, ...) | ||
| drum and bass: | ||
| - d(rum)?[ &n/]*b(ass)? | ||
|
|
||
| # rhythm and blues (r&b, rnb, ...) | ||
| rhythm and blues: | ||
| - r(hythm)?[ &n/]*b(lues)? | ||
|
|
||
| # rock and roll (rock & roll, rock'n'roll, rock-n-roll, ...) | ||
| rock and roll: | ||
| - rock[ '‐&n/ \-]*roll | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Consistent Delimiters (Hyphenation) | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
|
|
||
| # Hyphenate j-pop, k-pop, c-pop, post-rock, etc. | ||
| # Matches: kpop, k pop -> k-pop; j rock -> j-rock; post rock -> post-rock | ||
| # | ||
| # Hyphenate neo-soul, euro-house, tech-house, etc. | ||
| # (Negative lookaheads exclude 'european' and 'techno'/'technic*'.) | ||
| \g<1>-\g<2>: | ||
| - (c|k|j)[ /-]*(folk|goth|hip hop|pop|rock|ska|trance) | ||
| - (euro(?!p[ae]+n?)|neo|post|tech(?!n[io]))[ /-]*(\w+) | ||
|
|
||
| # lo-fi, glo-fi (lofi, lo fi -> lo-fi) | ||
| lo-fi: | ||
| - (g?lo)[ /-]*fi | ||
|
|
||
| # p-funk, g-funk, etc. (p funk -> p-funk) | ||
| \g<1>-funk: | ||
| - (p|g)[ /-]*funk | ||
|
|
||
| # synthpop, synthwave, etc. (synth pop -> synthpop) | ||
| synth\g<1>: | ||
| - synth[ /-]+(\w+) | ||
|
|
||
| # avant-garde (avantgarde, avant gard, avant-gard) | ||
| avant-garde: | ||
| - avant[ /-]*(gard(e)?)? | ||
| - avant-gard | ||
| - avant | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Nu- Genre Spelling (nu jazz, nu-disco, etc.) | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| # Matches: nu-jazz -> nu jazz; nu disco -> nu disco | ||
| # Note: 'nu-disco' is hyphenated in the tree but 'nu jazz' isn't in genres.txt | ||
| nu \g<1>: | ||
| - nu[ /-]*(disco|jazz|metal|soul) | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Terminology / Synonym / Translation fixes | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| # electronic (electronic music, elektronika) | ||
| electronic: | ||
| - electronic[ /]music | ||
| - elektronika | ||
|
|
||
| # downtempo (downbeat) | ||
| downtempo: | ||
| - down[ /-]*beat | ||
|
|
||
| # shoegaze (shoegazer, shoegazing) | ||
| shoegaze: | ||
| - shoegaze?r? | ||
| - shoegazing | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Form Fixes (Hip Hop, Trip Hop, etc.) | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| # Normalized spacing: hip-hop, hiphop -> hip hop | ||
| \g<1> hop: | ||
| - (glitch|hip|jazz|trip)y?([ /-]*hip)?[ /-]*hop | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Abbreviations & International Spellings | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| # alternative rock (alt, alternative, alt rock, ...) | ||
| # indie rock (indie, indie rock) | ||
| \g<1> rock: | ||
| - (alt|alternative|indie)([ /-]*rock)? | ||
|
|
||
| # gothic rock (goth, goth rock) - doesn't catch gothic metal | ||
| gothic rock: | ||
| - goth(?!ic)([ /-]*rock)? | ||
| - gothic[ /-]*rock | ||
|
|
||
| # progressive rock (prog, prog rock, progressive rock) | ||
| # Note: mapping standalone 'progressive' is avoided to prevent catching 'progressive metal', etc. | ||
| progressive rock: | ||
| - prog([ /-]*rock)? | ||
| - progressive[ /-]*rock | ||
|
|
||
| # traditional folk (trad, traditional) | ||
| # Note: avoids matching 'trad jazz' or 'traditional country'. | ||
| traditional folk: | ||
| - trad(/|ition(/|al)?)?-? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.