Skip to content

Commit

Permalink
Return Poetry as fiction=True
Browse files Browse the repository at this point in the history
  • Loading branch information
natlibfi-kaisa committed Oct 2, 2024
1 parent 77111fc commit 99109fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/classifier/bisac.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class BISACClassifier(Classifier):
m(True, "Literary Collections"),
m(stop, "Humor"),
m(stop, "Drama"),
m(stop, "Poetry"),
m(True, "Poetry"),
m(False, anything),
]

Expand Down
12 changes: 11 additions & 1 deletion core/model/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,12 +501,22 @@ def __repr__(self):
length = len(classifier.genres[self.name].subgenres)
else:
length = 0
return "<Genre %s (%d subjects, %d works, %d subcategories)>" % (
genre_data = "<Genre %s (%d subjects, %d works, %d subcategories)>" % (
self.name,
len(self.subjects),
len(self.works),
length,
)
genre_data += "\n <Subjects: %s>" % (
", ".join(
[
f"{subject.name} ({subject.type}, {subject.identifier})"
for subject in self.subjects
]
)
)

return genre_data

def cache_key(self):
return self.name
Expand Down

0 comments on commit 99109fa

Please sign in to comment.