Open baieric opened 6 years ago
Looks great! All i need in order to test this is to get a local instance of glottolog3 running. Any chance you could update the readme there with instructions on how to get it running? Got requirements installed but couldn't quite get setup.py or serve.py running.
@baieric I've gone ahead and updated the url to reference an environment variable which points to the Heroku deploy of the ontology, but have started to get this error: Failed to open TCP connection to :80 (Connection refused - connect(2) for nil port 80)
. Any thoughts? Might I need some form of API key or config beyond just the url?
@FredericoAndrade Do you have a typo somewhere? Sounds similar to this issue: https://github.com/jnunemaker/httparty/issues/393
This PDF has setup instructions for glottolog3. You'll need to get a local DB running as well. The instructions are intended for Heroku, but if you do steps 1-4 and step 6, it should run locally.
These are backend changes for eventually supporting the use the Language Ontology API in Poly. Hopefully these changes can be merged immediately.
There are some
TODO
comments where the code could be cleaner. I'll add Github comments to these for visibility.There are two user-facing changes in this PR:
1) The search URL can now be
/search?q=<query_string>&glottocode=<glottocode_string>
. Theglottocode
parameter is optional and not used currently (unless the user manually puts it in the URL). This will match all results containingquery_string
OR with language ID equal toglottocode_string
. Let me know how you feel about this. 2) I got rid of the use of theare_close?
function, meaning that search results will work differently. I noticed some annoying results where "English" was close to "Spanish", which seems very undesirable. I didn't play around with thedesired_distance
constant, but maybe lowering it could fix this, rather than completely getting rid of it.