Skip to content

Commit 21557d3

Browse files
merla18lesv
authored andcommitted
no need to test lang (GoogleCloudPlatform#629)
as NL does autodetect of language
1 parent 5965fb7 commit 21557d3

File tree

1 file changed

+1
-3
lines changed
  • language/analysis/src/main/java/com/google/cloud/language/samples

1 file changed

+1
-3
lines changed

language/analysis/src/main/java/com/google/cloud/language/samples/AnalyzeBeta.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ public static void printEntities(PrintStream out, List<Entity> entities) {
131131
* Gets {@link Sentiment} from the string {@code text}.
132132
*/
133133
public Sentiment analyzeSentimentText(String text, String lang) throws IOException {
134-
if (lang == null || lang.length() < 2) {
135-
lang = "EN";
136-
}
134+
// NL autodetects the language
137135

138136
// Note: This does not work on App Engine standard.
139137
Document doc = Document.newBuilder()

0 commit comments

Comments
 (0)