From 10d44fe5262f57396cca2453caf5d088778cc382 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Sat, 6 Feb 2016 07:46:31 +0100 Subject: [PATCH 1/3] Add some more docs to canonicalization with example It really didn't make sense to me before I did some further research. You shouldn't have to do further research to understand this apart form reading the docs. --- docs/plugins/lastgenre.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/plugins/lastgenre.rst b/docs/plugins/lastgenre.rst index 69db32877..097a6cbaa 100644 --- a/docs/plugins/lastgenre.rst +++ b/docs/plugins/lastgenre.rst @@ -47,6 +47,16 @@ be turned into coarser-grained ones that are present in the whitelist. This works using a `tree of nested genre names`_, represented using `YAML`_, where the leaves of the tree represent the most specific genres. +The most common way to use this would be with a custom whitelist containing only +a desired subset of genres. For example, if the custom whitelist contains `rock` +and `heavy metal` (which is a child node of `rock` in the default genre tree) +then an item that has its genre specified as `viking metal` would actually be +tagged as `heavy metal` because neither `viking metal` nor its parent +`black metal` are in the whitelist. Considering that, it's not very useful to +use the default whitelist (which contains about any genre contained in the tree) +with canonicalization because nothing would ever be matched to a more generic +node since all the specific subgenres are in the whitelist to begin with. + .. _YAML: http://www.yaml.org/ .. _tree of nested genre names: https://raw.githubusercontent.com/beetbox/beets/master/beetsplug/lastgenre/genres-tree.yaml From 14db7ea6ec21acd02f7c9fdba0d6328bc376edf1 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Sat, 6 Feb 2016 08:44:17 +0100 Subject: [PATCH 2/3] Add snippets for canonicalization --- docs/plugins/lastgenre.rst | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/docs/plugins/lastgenre.rst b/docs/plugins/lastgenre.rst index 097a6cbaa..5c3f0b77e 100644 --- a/docs/plugins/lastgenre.rst +++ b/docs/plugins/lastgenre.rst @@ -48,14 +48,29 @@ works using a `tree of nested genre names`_, represented using `YAML`_, where th leaves of the tree represent the most specific genres. The most common way to use this would be with a custom whitelist containing only -a desired subset of genres. For example, if the custom whitelist contains `rock` -and `heavy metal` (which is a child node of `rock` in the default genre tree) -then an item that has its genre specified as `viking metal` would actually be -tagged as `heavy metal` because neither `viking metal` nor its parent -`black metal` are in the whitelist. Considering that, it's not very useful to -use the default whitelist (which contains about any genre contained in the tree) -with canonicalization because nothing would ever be matched to a more generic -node since all the specific subgenres are in the whitelist to begin with. +a desired subset of genres. Consider for a example this minimal whitelist:: + + rock + heavy metal + pop + +together with the default genre tree. Then an item that has its genre specified +as `viking metal` would actually be tagged as `heavy metal` because neither +`viking metal` nor its parent `black metal` are in the whitelist. It always +tries to use the most specific genre that's available in the whitelist. + +The relevant subtree path in the default tree looks like this:: + + - rock: + - heavy metal: + - black metal: + - viking metal + +Considering that, it's not very useful to use the default whitelist (which +contains about any genre contained in the tree) with canonicalization because +nothing would ever be matched to a more generic node since all the specific +subgenres are in the whitelist to begin with. + .. _YAML: http://www.yaml.org/ .. _tree of nested genre names: https://raw.githubusercontent.com/beetbox/beets/master/beetsplug/lastgenre/genres-tree.yaml From 945ef18164b7579605abfc02ee47bec8350c5468 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Sat, 6 Feb 2016 08:45:32 +0100 Subject: [PATCH 3/3] Some typesetting --- docs/plugins/lastgenre.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/plugins/lastgenre.rst b/docs/plugins/lastgenre.rst index 5c3f0b77e..8db198151 100644 --- a/docs/plugins/lastgenre.rst +++ b/docs/plugins/lastgenre.rst @@ -55,8 +55,8 @@ a desired subset of genres. Consider for a example this minimal whitelist:: pop together with the default genre tree. Then an item that has its genre specified -as `viking metal` would actually be tagged as `heavy metal` because neither -`viking metal` nor its parent `black metal` are in the whitelist. It always +as *viking metal* would actually be tagged as *heavy metal* because neither +*viking metal* nor its parent *black metal* are in the whitelist. It always tries to use the most specific genre that's available in the whitelist. The relevant subtree path in the default tree looks like this::