Skip to content
This repository has been archived by the owner on Aug 28, 2020. It is now read-only.

Get Perseus definitions #26

Open
kylepjohnson opened this issue Mar 19, 2016 · 16 comments
Open

Get Perseus definitions #26

kylepjohnson opened this issue Mar 19, 2016 · 16 comments
Assignees

Comments

@kylepjohnson
Copy link
Member

Cross-referencing Issue cltk/cltk_frontend#60 by @lukehollis.

@manu-chroma
Copy link
Contributor

@kylepjohnson I would like to implement the definition endpoint. How to get started on this one ?

@manu-chroma
Copy link
Contributor

I'm assuming the json format to be {‘word’ : ‘definition’}
Proposed query URLhttps://api.cltk.org/<lang>/<define>?q=<word>
This is what I had in mind.

@lukehollis
Copy link
Member

Great--looks good. Here is a proposed data format I have been working with for the definitions so far: https://github.com/cltk/cltk_frontend/blob/master/client/views/reading/DefinitionsPanel.jsx#L18

@manu-chroma
Copy link
Contributor

Thanks for the link. I'll post a more detailed overview, considering your implementation on the front end.

@manu-chroma
Copy link
Contributor

@lukehollis Can you please give me the link to definitions in the corpus ? Thanks!

@lukehollis
Copy link
Member

We will need to look these up programmatically based on an input string. I'm indifferent on whether that input string should be a single word or a sentence/line of poetry.

@lukehollis
Copy link
Member

Here's an example query for the first word of the Aeneid: http://www.perseus.tufts.edu/hopper/morph?l=Arma&la=la

@manu-chroma
Copy link
Contributor

@lukehollis @kylepjohnson If I am not wrong, whenever a user queries for a definition, we want to extract data from the following source: http://www.perseus.tufts.edu/hopper/morph?l=Arma&la=la

  1. I am not able to find a exposed API for search results on the given website, thus we might have to scrape which is not bad as it has bare minimum html code.
    There is a XML option which has incomplete info. http://www.perseus.tufts.edu/hopper/xmlmorph?lang=la&lookup=virum
  2. The query URL for the site is very intuitive and can easily be worked out to provide different options in our API
  3. Should this not be included in the core CLTK and then exposed using the API directly from the core ?

Give me a heads up and I'll implement this feature right on.
Thanks.

@lukehollis
Copy link
Member

That's a good question, @manu-chroma--and thanks for tracking down the xmlmorph version. I can see both sides and don't have a very strong opinion one way or the other, but I think that since this is specifically an issue dealing with hitting an external web API, it should exist in the cltk_api instead of core. @kylepjohnson will have a better sense of the direction for the core package though.

@manu-chroma
Copy link
Contributor

@lukehollis I get your point. By the way, the xmlmorph version looks incomplete to me. It doesn't contain the definition. I think scraping is the way to go. What do you think ?

@kylepjohnson
Copy link
Member Author

Hey guys, An alternative to using the Perseus API would be to use the same lexicon they're using.

Somehow accidentally deleted the relevant files for Latin (needs to be re-added to cltk/latin_lexica_perseus), here's Greek:

The Latin works the same. @lukehollis does the Perseus API offer more than what's in greek-lemmata.txt, other than parsing it into XML for us?

Note: I'm going to open a new ticket that the Latin lemmata files get re-added to latin_lexica_perseus.

@kylepjohnson
Copy link
Member Author

Referencing Issue #30. @manu-chroma would you like to do this? It's related and I bet will answer your question about whether to use the API or parse the files ourselves.

@lukehollis
Copy link
Member

Not that I know of, and if we can use our own servers it seems like it'd be nicer to their systems not to be hitting their API all the time (not sure of the usage restraints there). Working from the cltk lexica repos here seems like a better solution if possible. All for it. 👍

@lukehollis
Copy link
Member

Hey @manu-chroma, any updates here? Would it be possible to push any progress that you've made?

@manu-chroma
Copy link
Contributor

Hey @lukehollis, I've mailed you regarding the same. Please check.

@lukehollis
Copy link
Member

Thanks so much, @manu-chroma--and good luck with the switch!

@lukehollis lukehollis assigned suheb and unassigned manu-chroma May 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants