return "v";
}
private InputStream retreiveXMLReply(String partOfSpeech, String word) {
HttpClient client = HttpClientFactory.getHttpClientInstance();
HttpMethod method = new GetMethod(MORPHOLOGICAL_SERVICE_ADRESS);
NameValuePair posValues = new NameValuePair(PART_OF_SPEECH_PARAM, partOfSpeech);
NameValuePair wordValues = new NameValuePair(GLOSS_TERM_PARAM, word);
if (log.isDebug()) {
String url = MORPHOLOGICAL_SERVICE_ADRESS + "?" + PART_OF_SPEECH_PARAM + "=" + partOfSpeech + "&" + GLOSS_TERM_PARAM + "=" + word;
log.debug("Send GET request to morph-service with URL: " + url);
}
method.setQueryString(new NameValuePair[] { posValues, wordValues });
try {
client.executeMethod(method);
int status = method.getStatusCode();
if (status == HttpStatus.SC_NOT_MODIFIED || status == HttpStatus.SC_OK) {
if (log.isDebug()) {
log.debug("got a valid reply!");
}
} else if (method.getStatusCode() == HttpStatus.SC_NOT_FOUND) {
log.error("Morphological Service unavailable (404)::" + method.getStatusLine().toString());
} else {
log.error("Unexpected HTTP Status::" + method.getStatusLine().toString());
}
} catch (Exception e) {
log.error("Unexpected exception trying to get flexions!", e);
}
Header responseHeader = method.getResponseHeader("Content-Type");
if (responseHeader == null) {
// error
log.error("URL not found!");
}
HttpRequestMediaResource mr = new HttpRequestMediaResource(method);