java-sdk
java-sdk copied to clipboard
AlchemyLanguage getLanguage() not accepting String with less than 15 characters.
Using this code block:
(type of variable al is AlchemyLanguage; length of message is < 15):
Map<String, Object> params = new HashMap<>();
params.put(AlchemyLanguage.TEXT, message);
String language = al.getLanguage(params).execute().getIso6393();
Whenever I execute the getLanguage() from al, the error pops out stating that
com.ibm.watson.developer_cloud.service.exception.BadRequestException: not-enough-text-for-language-id
And after a thorough investigation found out that we need at least 15 characters (white spaces not included) in order to execute getLanguage().
This is an API restriction. I don't see the problem with the SDK here.
I'm closing this one @akosialz feel free to open if you think this is a problem in the SDK