|
21 | 21 | import com.ibm.watson.developer_cloud.http.HttpHeaders; |
22 | 22 | import com.ibm.watson.developer_cloud.http.HttpMediaType; |
23 | 23 | import com.ibm.watson.developer_cloud.http.RequestBuilder; |
24 | | -import com.ibm.watson.developer_cloud.language_translation.v2.model.CreateModelOptions; |
25 | | -import com.ibm.watson.developer_cloud.language_translation.v2.model.IdentifiableLanguage; |
26 | | -import com.ibm.watson.developer_cloud.language_translation.v2.model.IdentifiedLanguage; |
27 | | -import com.ibm.watson.developer_cloud.language_translation.v2.model.IdentifiableLanguageList; |
28 | | -import com.ibm.watson.developer_cloud.language_translation.v2.model.TranslationModel; |
29 | | -import com.ibm.watson.developer_cloud.language_translation.v2.model.TranslationModelList; |
30 | | -import com.ibm.watson.developer_cloud.language_translation.v2.model.TranslationResult; |
| 24 | +import com.ibm.watson.developer_cloud.language_translation.v2.model.*; |
31 | 25 | import com.ibm.watson.developer_cloud.service.WatsonService; |
32 | 26 | import com.ibm.watson.developer_cloud.util.Validate; |
33 | 27 | import com.squareup.okhttp.MultipartBuilder; |
@@ -206,15 +200,14 @@ public List<TranslationModel> getModels(final Boolean showDefault, final String |
206 | 200 | * @param text the text to identify |
207 | 201 | * @return the identified language |
208 | 202 | */ |
209 | | - @SuppressWarnings("unchecked") |
210 | 203 | public List<IdentifiedLanguage> identify(final String text) { |
211 | 204 | final Request request = RequestBuilder.post(PATH_IDENTIFY) |
212 | 205 | .withHeader(HttpHeaders.ACCEPT, HttpMediaType.APPLICATION_JSON) |
213 | 206 | .withBodyContent(text, HttpMediaType.TEXT_PLAIN).build(); |
214 | 207 |
|
215 | | - final IdentifiableLanguageList languages = executeRequest(request, IdentifiableLanguageList.class); |
| 208 | + final IdentifiedLanguageList languages = executeRequest(request, IdentifiedLanguageList.class); |
216 | 209 |
|
217 | | - return (List<IdentifiedLanguage>) (List<?>) languages.getLanguages(); |
| 210 | + return languages.getLanguages(); |
218 | 211 | } |
219 | 212 |
|
220 | 213 | /** |
|
0 commit comments