8000 Updates readme instructions and changes quickstart to avoid mvn run h… · loosebazooka/java-docs-samples@97ebecb · GitHub
[go: up one dir, main page]

Skip to content

Commit 97ebecb

Browse files
committed
Updates readme instructions and changes quickstart to avoid mvn run harness
1 parent 9570885 commit 97ebecb

File tree

3 files changed

+49
-19
lines changed

3 files changed

+49
-19
lines changed

language/analysis/README.md

Lines changed: 24 additions & 11 deletions
< 8000 td data-grid-cell-id="diff-2f47bc1b740ad20282f8451de44668e648033e573a049e0d23025226a54828ea-47-48-2" data-line-anchor="diff-2f47bc1b740ad20282f8451de44668e648033e573a049e0d23025226a54828eaR48" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);padding-right:24px" tabindex="-1" valign="top" class="focusable-grid-cell diff-text-cell right-side-diff-cell left-side">
Analyze entities
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ java -cp target/language-entities-1.0-jar-with-dependencies.jar \
4343
<text | GCS path>
4444
```
4545

46-
### Usage Examples
46+
### Usage Examples (stable)
47+
4748
4849
```
4950
java -cp target/language-entities-1.0-jar-with-dependencies.jar \
@@ -68,16 +69,6 @@ java -cp target/language-entities-1.0-jar-with-dependencies.jar \
6869
"The quick brown fox jumped over the lazy dog."
6970
```
7071

71-
Analyze sentiment with Beta Languages such as German
72-
```
73-
java -cp target/language-entities-1.0-jar-with-dependencies.jar \
74-
com.google.cloud.language.samples.AnalyzeBeta sentiment "Ich habe eine wundervolle Zeit." "DE"
75-
```
76-
Analyze entity sentiment - Beta
77-
```
78-
java -cp target/language-entities-1.0-jar-with-dependencies.jar com.google.cloud.language.samples.AnalyzeBeta entities-sentiment "The quick brown fox jumped over the lazy dog."
79-
```
80-
8172
Included with the sample are `demo.sh` and `demo.bat` which show additional
8273
examples of usage.
8374

@@ -90,3 +81,25 @@ Run demo from Windows
9081
```
9182
demo
9283
```
84+
85+
### Usage Examples (beta)
86+
87+
Analyze sentiment beta
88+
```
89+
java -cp target/language-entities-1.0-jar-with-dependencies.jar \
90+
com.google.cloud.language.samples.AnalyzeBeta \
91+
sentiment \
92+
"Der schnelle braune Fuchs sprang über den faulen Hund."
93+
```
94+
95+
Analyze entity sentiment Beta
96+
```
97+
java -cp target/language-entities-1.0-jar-with-dependencies.jar \
98+
com.google.cloud.language.samples.AnalyzeBeta entities-sentiment \
99+
"There's nothing better than searching for ice cream on Google."
100+
```
101+
102+
Run beta demo from *nix or OSX
103+
```
104+
demo-beta.sh
105+
```
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ Install [Maven](http://maven.apache.org/).
1717

1818
Build your project with:
1919

20-
mvn clean package -DskipTests
21-
22-
You can then run a given `ClassName` via:
23-
24-
mvn exec:java -Dexec.mainClass=com.example.language.ClassName \
25-
-DpropertyName=propertyValue \
26-
-Dexec.args="arg1 'arg 2' arg3"
20+
```bash
21+
mvn clean compile assembly:single
22+
```
2723

2824
### Analyze a string for sentiment (using the quickstart sample)
2925

30-
mvn exec:java -Dexec.mainClass=com.example.language.QuickstartSample
26+
```
27+
java -cp target/language-google-cloud-samples-1.0.0-jar-with-dependencies.jar \
28+
com.example.language.QuickstartSample
29+
```

language/cloud-client/pom.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,22 @@
5454
<scope>test</scope>
5555
</dependency>
5656
</dependencies>
57+
58+
<build>
59+
<plugins>
60+
<plugin>
61+
<artifactId>maven-assembly-plugin</artifactId>
62+
<configuration>
63+
<archive>
64+
<manifest>
65+
<mainClass>com.example.language.QuickstartSample</mainClass>
66+
</manifest>
67+
</archive>
68+
<descriptorRefs>
69+
<descriptorRef>jar-with-dependencies</descriptorRef>
70+
</descriptorRefs>
71+
</configuration>
72+
</plugin>
73+
</plugins>
74+
</build>
5775
</project>

0 commit comments

Comments
 (0)
0