-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Engine endpoints #9
Conversation
<supportsLanguageCode>grc</supportsLanguageCode> | ||
<supportsLanguageCode>la</supportsLanguageCode> | ||
<supportsLanguageCode>lat</supportsLanguageCode> | ||
<supportsOption>strictCase=^1$</supportsOption> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Perseids version of Morphsvc has the options strictCase
and checkPreverbs
. I removed checkPreverbs
because it doesn't seem to do anything. The functionality is commented out in the Morpheus code.
The Alpheios version supports noAposRetry
(code). @balmas do you think it's worth adding this functionality? Was there a particular word or set of words that caused you to add this to the Alpheios version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the issue from Alpheios that led to this change: alpheios-project/data-models#61
The need (or not) for it depends upon how sensitive you want to be to tokenization and encoding errors. Alpheios tries to work with any Greek text on the web, which means we have to account for various possibilities that might not be so important for Perseids.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that makes sense.
set :port, Config::PORT | ||
|
||
namespace '/raw' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the files changed in this PR are a changed as a result of splitting this up into multiple files. The changes relevant to the engine functionality are:
lib/engine.rb
lib/engine_list.rb
routes/engine.rb
code = 404 | ||
response = Error.new('unknown engine') | ||
else | ||
code = 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've replicated the functionality in Morphsvc. But I'm confused about why the /engine
endpoints return a 200 ok
while the /analysis
endpoints return 201 created
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 201 response was a continuation of the concept that what the morphology service was doing was creating a new Annotation resource for each request, as opposed to returning a static document. It's a legacy of the infrastructure it was meant to be a part of. Under the current implementation, it probably makes more sense for it to return 200 for the /analysis endpoint.
Implement the `/engine` and `/engine/:engine` endpoints in both JSON and XML. The `/engine` endpoint lists all available engines. The `/engine/:engine` endpoint lists information about one particular engine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me!
<supportsLanguageCode>grc</supportsLanguageCode> | ||
<supportsLanguageCode>la</supportsLanguageCode> | ||
<supportsLanguageCode>lat</supportsLanguageCode> | ||
<supportsOption>strictCase=^1$</supportsOption> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the issue from Alpheios that led to this change: alpheios-project/data-models#61
The need (or not) for it depends upon how sensitive you want to be to tokenization and encoding errors. Alpheios tries to work with any Greek text on the web, which means we have to account for various possibilities that might not be so important for Perseids.
code = 404 | ||
response = Error.new('unknown engine') | ||
else | ||
code = 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 201 response was a continuation of the concept that what the morphology service was doing was creating a new Annotation resource for each request, as opposed to returning a static document. It's a legacy of the infrastructure it was meant to be a part of. Under the current implementation, it probably makes more sense for it to return 200 for the /analysis endpoint.
Thanks for reviewing! |
Implement the
/engine
and/engine/:engine
endpoints in both JSON and XML.The
/engine
endpoint lists all available engines. The/engine/:engine
endpoint lists information about one particular engine.This PR also adds the
strictCase
option.