oyiptong / up-headliner

Headliner is a JSON API that returns personalized content obtained from providers
Mozilla Public License 2.0
0 stars 2 forks source link

Allow __DEFAULT under __PATH for catch-all-else paths #11

Closed Mardak closed 10 years ago

Mardak commented 10 years ago

I'm not sure if this is the expected behavior or if it's intended to match subsections that aren't explicitly listed. E.g., "arts" has 4 explicit subsections plus __NONE, and there's no explicit match for "dance" which could be classified as "Arts".

http://www.nytimes.com/2014/01/27/arts/dance/a-giant-photo-connects-fans-to-ballet-stars.html

Results in an article object with labels: []

oyiptong commented 10 years ago

Yes, that was the intended behavior, so as to create a precise, albeit verbose, mapping

oyiptong commented 10 years ago

I suggest another operator, inside of PATH: "DEFAULT", which matches all except the cited paths and __NONE

Mardak commented 10 years ago

Updated issue summary to allow for a default label if none of the explicit paths matched.

Mardak commented 10 years ago

Added Arts as a default under arts. https://github.com/oyiptong/up-headliner/commit/207b2483818252708f3064e40b82e02bf60dedb6