java-sdk icon indicating copy to clipboard operation
java-sdk copied to clipboard

AlchemyLanguage getLanguage() not accepting String with less than 15 characters.

Open akosialz opened this issue 10 years ago • 2 comments

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().

akosialz avatar Jul 28 '16 18:07 akosialz

This is an API restriction. I don't see the problem with the SDK here.

germanattanasio avatar Aug 01 '16 18:08 germanattanasio

I'm closing this one @akosialz feel free to open if you think this is a problem in the SDK

germanattanasio avatar Aug 01 '16 21:08 germanattanasio