lexonomy icon indicating copy to clipboard operation
lexonomy copied to clipboard

keep examples metadata when pulling

Open mjakubicek opened this issue 6 years ago • 5 comments

such as document metadata and sentence id

mjakubicek avatar Jul 03 '19 17:07 mjakubicek

Adding requests from #62.

When "pulling", optionally filter the example sentences by collocation and/or gramrel. Be able to pull examples from more than one corpus.

iztokkosem avatar Jul 05 '19 06:07 iztokkosem

So I am supposed to use "refs" in GET to ske to include additional metadata. To make this usable by the users, I have come up with a possible implementation in ea58cf5f8b18220462715e17ed3c5e1b63d64730. I am stuck as I don't know how to set/get these global variables (like ske_login). I can see they are in the database, but don't know how to introduce a new one. Or if that is actually the right way to go. When someone has five minutes, please take a look

gareins avatar Jul 17 '19 10:07 gareins

I'm not sure I follow what you mean: the user needs to set them in the configuration (Sketch Engine connection etc.), you shouldn't need to take any care about that.

mjakubicek avatar Jul 17 '19 14:07 mjakubicek

Ok. So then, which settings can add this to the API call? I was told:

it should be enough to add s.id to refs parametr. Various (structure.attribute) metadata are separated with comma: e.g. &refs=s.id,doc.title,p.heading

I see these settings inside lexonomy: Sketch Engine URL, Sketch Engine API URL, Corpus name, Concordance query, Additional search elements. Or do I have to set this somewhere else?

gareins avatar Jul 17 '19 17:07 gareins

Yes - you need to change the API call to get the example from Lexonomy. That is hardcoded except for the API URL prefix. See the handler for ":dictID/skeget/xampl/" in lexonomy.js

If you will be changing anything there it would be good to rewrite it straight to Python. In this case it is extremely easy as it has no further dependences, it is basically just a wrapper to satisfy CORS.

mjakubicek avatar Jul 17 '19 21:07 mjakubicek