Skip to content

Commit

Permalink
Merge pull request #217 from NationalLibraryOfNorway/feat/fields
Browse files Browse the repository at this point in the history
added literaryform and genres
  • Loading branch information
magbb authored Oct 1, 2024
2 parents 0d8293f + 2c45ed4 commit e1c3cee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dhlab/api/dhlab_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,8 @@ def document_corpus(
ddk: str = None,
subject: str = None,
publisher: str = None,
literaryform: str = None,
genres: str = None,
city: str = None,
lang: str = None,
limit: int = None,
Expand All @@ -663,7 +665,9 @@ def document_corpus(
<https://no.wikipedia.org/wiki/Deweys_desimalklassifikasjon>`_ identifier.
:param str subject: subject (keywords) of the publication.
:param str publisher: Name of publisher.
:param str city: place of publication.
:param str literaryform: literary form of the publication (books)
:param str genres: genre of the publication.
:param str city: place of publication
:param str lang: Language of the publication, as a 3-letter ISO code.
Example: ``"nob"`` or ``"nno"``
:param int limit: number of items to sample.
Expand Down
8 changes: 8 additions & 0 deletions dhlab/text/corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def __init__(
ddk=None,
subject=None,
publisher=None,
literaryform=None,
genres=None,
city=None,
lang=None,
limit=10,
Expand All @@ -68,6 +70,8 @@ def __init__(
_ identifier.
:param str subject: subject (keywords) of the publication.
:param str publisher: Name of publisher.
:param str literaryform: literary form of the publication (books)
:param str genres: genre of the publication.
:param str city: place of publication.
:param str lang: Language of the publication, as a 3-letter ISO code.
Example: ``"nob"`` or ``"nno"``
Expand All @@ -87,6 +91,8 @@ def __init__(
or ddk
or lang
or publisher
or literaryform
or genres
or city
):
self.corpus = document_corpus(
Expand All @@ -102,6 +108,8 @@ def __init__(
ddk,
subject,
publisher,
literaryform,
genres,
city,
lang,
limit,
Expand Down

0 comments on commit e1c3cee

Please sign in to comment.