Skip to content

Commit 156249c

Browse files
authored
Merge pull request #20 from bazzdg/master
Added TA REST API sample maven project for java
2 parents a8718af + 82b745a commit 156249c

File tree

17 files changed

+459
-0
lines changed

17 files changed

+459
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
10+
<attributes>
11+
<attribute name="optional" value="true"/>
12+
<attribute name="maven.pomderived" value="true"/>
13+
<attribute name="test" value="true"/>
14+
</attributes>
15+
</classpathentry>
16+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
17+
<attributes>
18+
<attribute name="maven.pomderived" value="true"/>
19+
</attributes>
20+
</classpathentry>
21+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
22+
<attributes>
23+
<attribute name="maven.pomderived" value="true"/>
24+
</attributes>
25+
</classpathentry>
26+
<classpathentry kind="src" path="target/generated-sources/annotations">
27+
<attributes>
28+
<attribute name="optional" value="true"/>
29+
<attribute name="maven.pomderived" value="true"/>
30+
<attribute name="ignore_optional_problems" value="true"/>
31+
<attribute name="m2e-apt" value="true"/>
32+
</attributes>
33+
</classpathentry>
34+
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
35+
<attributes>
36+
<attribute name="optional" value="true"/>
37+
<attribute name="maven.pomderived" value="true"/>
38+
<attribute name="ignore_optional_problems" value="true"/>
39+
<attribute name="m2e-apt" value="true"/>
40+
<attribute name="test" value="true"/>
41+
</attributes>
42+
</classpathentry>
43+
<classpathentry kind="output" path="target/classes"/>
44+
</classpath>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<factorypath>
2+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure/1.3.0/azure-1.3.0.jar" enabled="true" runInBatchMode="false"/>
3+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-client-runtime/1.6.6/azure-client-runtime-1.6.6.jar" enabled="true" runInBatchMode="false"/>
4+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/rest/client-runtime/1.6.6/client-runtime-1.6.6.jar" enabled="true" runInBatchMode="false"/>
5+
<factorypathentry kind="VARJAR" id="M2_REPO/com/google/guava/guava/20.0/guava-20.0.jar" enabled="true" runInBatchMode="false"/>
6+
<factorypathentry kind="VARJAR" id="M2_REPO/com/squareup/retrofit2/retrofit/2.5.0/retrofit-2.5.0.jar" enabled="true" runInBatchMode="false"/>
7+
<factorypathentry kind="VARJAR" id="M2_REPO/com/squareup/okhttp3/okhttp/3.11.0/okhttp-3.11.0.jar" enabled="true" runInBatchMode="false"/>
8+
<factorypathentry kind="VARJAR" id="M2_REPO/com/squareup/okio/okio/1.14.0/okio-1.14.0.jar" enabled="true" runInBatchMode="false"/>
9+
<factorypathentry kind="VARJAR" id="M2_REPO/com/squareup/okhttp3/logging-interceptor/3.11.0/logging-interceptor-3.11.0.jar" enabled="true" runInBatchMode="false"/>
10+
<factorypathentry kind="VARJAR" id="M2_REPO/com/squareup/okhttp3/okhttp-urlconnection/3.11.0/okhttp-urlconnection-3.11.0.jar" enabled="true" runInBatchMode="false"/>
11+
<factorypathentry kind="VARJAR" id="M2_REPO/com/squareup/retrofit2/converter-jackson/2.5.0/converter-jackson-2.5.0.jar" enabled="true" runInBatchMode="false"/>
12+
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/core/jackson-databind/2.9.4/jackson-databind-2.9.4.jar" enabled="true" runInBatchMode="false"/>
13+
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/datatype/jackson-datatype-joda/2.9.8/jackson-datatype-joda-2.9.8.jar" enabled="true" runInBatchMode="false"/>
14+
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar" enabled="true" runInBatchMode="false"/>
15+
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar" enabled="true" runInBatchMode="false"/>
16+
<factorypathentry kind="VARJAR" id="M2_REPO/com/squareup/retrofit2/adapter-rxjava/2.4.0/adapter-rxjava-2.4.0.jar" enabled="true" runInBatchMode="false"/>
17+
<factorypathentry kind="VARJAR" id="M2_REPO/org/slf4j/slf4j-api/1.7.22/slf4j-api-1.7.22.jar" enabled="true" runInBatchMode="false"/>
18+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-client-authentication/1.6.6/azure-client-authentication-1.6.6.jar" enabled="true" runInBatchMode="false"/>
19+
<factorypathentry kind="VARJAR" id="M2_REPO/commons-codec/commons-codec/1.11/commons-codec-1.11.jar" enabled="true" runInBatchMode="false"/>
20+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/adal4j/1.6.2/adal4j-1.6.2.jar" enabled="true" runInBatchMode="false"/>
21+
<factorypathentry kind="VARJAR" id="M2_REPO/com/nimbusds/oauth2-oidc-sdk/5.64.4/oauth2-oidc-sdk-5.64.4.jar" enabled="true" runInBatchMode="false"/>
22+
<factorypathentry kind="VARJAR" id="M2_REPO/com/sun/mail/javax.mail/1.6.1/javax.mail-1.6.1.jar" enabled="true" runInBatchMode="false"/>
23+
<factorypathentry kind="VARJAR" id="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar" enabled="true" runInBatchMode="false"/>
24+
<factorypathentry kind="VARJAR" id="M2_REPO/com/github/stephenc/jcip/jcip-annotations/1.0-1/jcip-annotations-1.0-1.jar" enabled="true" runInBatchMode="false"/>
25+
<factorypathentry kind="VARJAR" id="M2_REPO/net/minidev/json-smart/2.3/json-smart-2.3.jar" enabled="true" runInBatchMode="false"/>
26+
<factorypathentry kind="VARJAR" id="M2_REPO/net/minidev/accessors-smart/1.2/accessors-smart-1.2.jar" enabled="true" runInBatchMode="false"/>
27+
<factorypathentry kind="VARJAR" id="M2_REPO/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar" enabled="true" runInBatchMode="false"/>
28+
<factorypathentry kind="VARJAR" id="M2_REPO/com/nimbusds/lang-tag/1.4.4/lang-tag-1.4.4.jar" enabled="true" runInBatchMode="false"/>
29+
<factorypathentry kind="VARJAR" id="M2_REPO/com/nimbusds/nimbus-jose-jwt/7.1/nimbus-jose-jwt-7.1.jar" enabled="true" runInBatchMode="false"/>
30+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-annotations/1.7.0/azure-annotations-1.7.0.jar" enabled="true" runInBatchMode="false"/>
31+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-resources/1.3.0/azure-mgmt-resources-1.3.0.jar" enabled="true" runInBatchMode="false"/>
32+
<factorypathentry kind="VARJAR" id="M2_REPO/org/slf4j/slf4j-simple/1.7.5/slf4j-simple-1.7.5.jar" enabled="true" runInBatchMode="false"/>
33+
<factorypathentry kind="VARJAR" id="M2_REPO/io/reactivex/rxjava/1.2.4/rxjava-1.2.4.jar" enabled="true" runInBatchMode="false"/>
34+
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/httpcomponents/httpcore/4.4.5/httpcore-4.4.5.jar" enabled="true" runInBatchMode="false"/>
35+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-storage/1.3.0/azure-mgmt-storage-1.3.0.jar" enabled="true" runInBatchMode="false"/>
36+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-network/1.3.0/azure-mgmt-network-1.3.0.jar" enabled="true" runInBatchMode="false"/>
37+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-compute/1.3.0/azure-mgmt-compute-1.3.0.jar" enabled="true" runInBatchMode="false"/>
38+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-graph-rbac/1.3.0/azure-mgmt-graph-rbac-1.3.0.jar" enabled="true" runInBatchMode="false"/>
39+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-keyvault/1.3.0/azure-mgmt-keyvault-1.3.0.jar" enabled="true" runInBatchMode="false"/>
40+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-batch/1.3.0/azure-mgmt-batch-1.3.0.jar" enabled="true" runInBatchMode="false"/>
41+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-trafficmanager/1.3.0/azure-mgmt-trafficmanager-1.3.0.jar" enabled="true" runInBatchMode="false"/>
42+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-dns/1.3.0/azure-mgmt-dns-1.3.0.jar" enabled="true" runInBatchMode="false"/>
43+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-redis/1.3.0/azure-mgmt-redis-1.3.0.jar" enabled="true" runInBatchMode="false"/>
44+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-appservice/1.3.0/azure-mgmt-appservice-1.3.0.jar" enabled="true" runInBatchMode="false"/>
45+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-cdn/1.3.0/azure-mgmt-cdn-1.3.0.jar" enabled="true" runInBatchMode="false"/>
46+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-sql/1.3.0/azure-mgmt-sql-1.3.0.jar" enabled="true" runInBatchMode="false"/>
47+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-containerinstance/1.3.0/azure-mgmt-containerinstance-1.3.0.jar" enabled="true" runInBatchMode="false"/>
48+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-storage/4.4.0/azure-storage-4.4.0.jar" enabled="true" runInBatchMode="false"/>
49+
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/core/jackson-core/2.6.0/jackson-core-2.6.0.jar" enabled="true" runInBatchMode="false"/>
50+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-keyvault-core/0.8.0/azure-keyvault-core-0.8.0.jar" enabled="true" runInBatchMode="false"/>
51+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-containerregistry/1.3.0/azure-mgmt-containerregistry-1.3.0.jar" enabled="true" runInBatchMode="false"/>
52+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-cosmosdb/1.3.0/azure-mgmt-cosmosdb-1.3.0.jar" enabled="true" runInBatchMode="false"/>
53+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-search/1.3.0/azure-mgmt-search-1.3.0.jar" enabled="true" runInBatchMode="false"/>
54+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/azure-mgmt-servicebus/1.3.0/azure-mgmt-servicebus-1.3.0.jar" enabled="true" runInBatchMode="false"/>
55+
<factorypathentry kind="VARJAR" id="M2_REPO/joda-time/joda-time/2.1/joda-time-2.1.jar" enabled="true" runInBatchMode="false"/>
56+
<factorypathentry kind="VARJAR" id="M2_REPO/commons-net/commons-net/3.3/commons-net-3.3.jar" enabled="true" runInBatchMode="false"/>
57+
<factorypathentry kind="VARJAR" id="M2_REPO/com/microsoft/azure/cognitiveservices/azure-cognitiveservices-language/0.0.1-beta/azure-cognitiveservices-language-0.0.1-beta.jar" enabled="true" runInBatchMode="false"/>
58+
<factorypathentry kind="VARJAR" id="M2_REPO/com/google/code/gson/gson/2.1/gson-2.1.jar" enabled="true" runInBatchMode="false"/>
59+
</factorypath>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>azure-textanalytics-sample</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.apt.aptEnabled=false
3+
org.eclipse.jdt.apt.genSrcDir=target\\generated-sources\\annotations
4+
org.eclipse.jdt.apt.genTestSrcDir=target\\generated-test-sources\\test-annotations
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
3+
org.eclipse.jdt.core.compiler.compliance=1.7
4+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
5+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
6+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
7+
org.eclipse.jdt.core.compiler.processAnnotations=disabled
8+
org.eclipse.jdt.core.compiler.release=disabled
9+
org.eclipse.jdt.core.compiler.source=1.7
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"configurations": [
3+
{
4+
"type": "java",
5+
"name": "CodeLens (Launch) - TextAnalytics",
6+
"request": "launch",
7+
"mainClass": "com.microsoft.azure.textanalytics.samples.TextAnalytics",
8+
"projectName": "azure-textanalytics-sample"
9+
}
10+
]
11+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Quickstart for Text Analytics API with Java
2+
<a name="HOLTop"></a>
3+
4+
This article shows you how to detect language, analyze sentiment, and extract key phrases using the [Text Analytics APIs](//go.microsoft.com/fwlink/?LinkID=759711) with Java.
5+
6+
Refer to the [API definitions](//go.microsoft.com/fwlink/?LinkID=759346) for technical documentation for the APIs.
7+
8+
## Prerequisites
9+
10+
You must have a [Cognitive Services API account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) with **Text Analytics API**. You can use the **free tier for 5,000 transactions/month** to complete this quickstart.
11+
12+
You must also have the [endpoint and access key](../How-tos/text-analytics-how-to-access-key.md) that was generated for you during sign up.
13+
14+
15+
### Quickstart
16+
17+
To get these samples running locally, simply get the pre-requisites above, then:
18+
19+
1. git clone https://github.com/Azure-Samples/cognitive-services-java-sdk-samples.git
20+
2. cd cognitive-services-java-sdk-samples/TextAnalytics
21+
3. mvn compile
22+
4. set env variable AZURE_TEXTANALYTICS_API_KEY to your cognitive services API key.
23+
5. mvn exec:java -Dexec.mainClass="com.microsoft.azure.textanalytics.samples.Samples"
24+
25+
## See also
26+
27+
[Text Analytics overview](../overview.md)
28+
[Frequently asked questions (FAQ)](../text-analytics-resource-faq.md)
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com.microsoft.azure</groupId>
6+
<artifactId>azure-textanalytics-sample</artifactId>
7+
<version>0.0.1-SNAPSHOT</version>
8+
<name>Simple.java</name>
9+
<description></description>
10+
<url>https://github.com/Azure/bing-search-java</url>
11+
<build>
12+
<plugins>
13+
<plugin>
14+
<groupId>org.codehaus.mojo</groupId>
15+
<artifactId>exec-maven-plugin</artifactId>
16+
<version>1.4.0</version>
17+
<configuration>
18+
<mainClass>com.microsoft.azure.textanalytics.samples.Samples</mainClass>
19+
</configuration>
20+
</plugin>
21+
<plugin>
22+
<artifactId>maven-compiler-plugin</artifactId>
23+
<version>3.0</version>
24+
<configuration>
25+
<source>1.7</source>
26+
<target>1.7</target>
27+
</configuration>
28+
</plugin>
29+
<plugin>
30+
<artifactId>maven-assembly-plugin</artifactId>
31+
<executions>
32+
<execution>
33+
<phase>package</phase>
34+
<goals>
35+
<goal>attached</goal>
36+
</goals>
37+
<configuration>
38+
<descriptorRefs>
39+
<descriptorRef>jar-with-dependencies</descriptorRef>
40+
</descriptorRefs>
41+
<archive>
42+
<manifest>
43+
<mainClass>com.microsoft.azure.textanalytics.samples.Samples</mainClass>
44+
</manifest>
45+
</archive>
46+
</configuration>
47+
</execution>
48+
</executions>
49+
</plugin>
50+
</plugins>
51+
</build>
52+
<dependencies>
53+
<dependency>
54+
<groupId>com.google.code.gson</groupId>
55+
<artifactId>gson</artifactId>
56+
<version>2.1</version>
57+
<scope>provided</scope>
58+
</dependency>
59+
</dependencies>
60+
</project>

0 commit comments

Comments
 (0)