diff --git a/language/analysis/README.md b/language/analysis/README.md index 587999420d3..14836f85f44 100644 --- a/language/analysis/README.md +++ b/language/analysis/README.md @@ -10,6 +10,8 @@ for entity recognition. This sample requires you to have [Java8](https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html). +**Note** The Natural Language client is not supported by App Engine Standard. + ## Download Maven This sample uses the [Apache Maven][maven] build system. Before getting started, be diff --git a/language/analysis/src/main/java/com/google/cloud/language/samples/Analyze.java b/language/analysis/src/main/java/com/google/cloud/language/samples/Analyze.java index 9b4adfcff96..0d6ae43601d 100644 --- a/language/analysis/src/main/java/com/google/cloud/language/samples/Analyze.java +++ b/language/analysis/src/main/java/com/google/cloud/language/samples/Analyze.java @@ -169,6 +169,7 @@ public Analyze(LanguageServiceClient languageApi) { * Gets {@link Entity}s from the string {@code text}. */ public List analyzeEntitiesText(String text) throws IOException { + // Note: This does not work on App Engine standard. Document doc = Document.newBuilder() .setContent(text).setType(Type.PLAIN_TEXT).build(); AnalyzeEntitiesRequest request = AnalyzeEntitiesRequest.newBuilder() @@ -182,6 +183,7 @@ public List analyzeEntitiesText(String text) throws IOException { * Gets {@link Entity}s from the contents of the object at the given GCS {@code path}. */ public List analyzeEntitiesFile(String path) throws IOException { + // Note: This does not work on App Engine standard. Document doc = Document.newBuilder() .setGcsContentUri(path).setType(Type.PLAIN_TEXT).build(); AnalyzeEntitiesRequest request = AnalyzeEntitiesRequest.newBuilder() @@ -195,6 +197,7 @@ public List analyzeEntitiesFile(String path) throws IOException { * Gets {@link Sentiment} from the string {@code text}. */ public Sentiment analyzeSentimentText(String text) throws IOException { + // Note: This does not work on App Engine standard. Document doc = Document.newBuilder() .setContent(text).setType(Type.PLAIN_TEXT).build(); AnalyzeSentimentResponse response = languageApi.analyzeSentiment(doc); @@ -205,6 +208,7 @@ public Sentiment analyzeSentimentText(String text) throws IOException { * Gets {@link Sentiment} from the contents of the object at the given GCS {@code path}. */ public Sentiment analyzeSentimentFile(String path) throws IOException { + // Note: This does not work on App Engine standard. Document doc = Document.newBuilder() .setGcsContentUri(path).setType(Type.PLAIN_TEXT).build(); AnalyzeSentimentResponse response = languageApi.analyzeSentiment(doc); @@ -215,6 +219,7 @@ public Sentiment analyzeSentimentFile(String path) throws IOException { * Gets {@link Token}s from the string {@code text}. */ public List analyzeSyntaxText(String text) throws IOException { + // Note: This does not work on App Engine standard. Document doc = Document.newBuilder() .setContent(text).setType(Type.PLAIN_TEXT).build(); AnalyzeSyntaxRequest request = AnalyzeSyntaxRequest.newBuilder() @@ -228,6 +233,7 @@ public List analyzeSyntaxText(String text) throws IOException { * Gets {@link Token}s from the contents of the object at the given GCS {@code path}. */ public List analyzeSyntaxFile(String path) throws IOException { + // Note: This does not work on App Engine standard. Document doc = Document.newBuilder() .setGcsContentUri(path).setType(Type.PLAIN_TEXT).build(); AnalyzeSyntaxRequest request = AnalyzeSyntaxRequest.newBuilder()