From 1ddcefea5f7e6aea200aef11e431810e0eb1c5d4 Mon Sep 17 00:00:00 2001 From: Arkadiusz Janz <arkadiusz.janz@pwr.edu.pl> Date: Fri, 12 Jan 2024 21:17:31 +0100 Subject: [PATCH] plWordNet api docs extended, database downloading added --- README.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5747759..ee8abdb 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,28 @@ PLWN API PLWN API is a library for accessing the plWordNet lexicon in a Python program. +Setup +===== + +To use the api one has to download a default data dump. To setup the api you have to `download` command from plwn library. + +```python +import plwn + +plwn.download() +``` + +The script will download a default plWordNet dump in sqlite format. The default dump is a compressed version of plWordNet 4.5 - a database file `default_model` should be downloaded to your disk. + + Usage ===== Access is provided using a PLWordNet object, with data loaded from the database -dump. +dump. To get thethe database dump use the `download` method (see ,,Setup'' section). >>> import plwn - >>> wn = plwn.load_default() + >>> wn = plwn.load("./default_model") Using that object, it's possible to obtain synset and lexical unit data. @@ -80,7 +94,7 @@ To load this version at a later date, use `plwn.load(path)` instead of `plwn.loa >>> api = plwn.load("storage-dumps/plwn-new.db") -Downloading API dumps +Manually downloading API dumps ===================== In order to download one of the dumps available at https://minio.clarin-pl.eu/minio/public/models/: -- GitLab