File tree 7 files changed +26
-33
lines changed
main/java/com/google/cloud/vision/samples/text
test/java/com/google/cloud/vision/samples/text
7 files changed +26
-33
lines changed Original file line number Diff line number Diff line change 1
1
# Text Detection using the Vision API
2
2
3
+ <a href =" https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=vision/text/README.md " >
4
+ <img alt =" Open in Cloud Shell " src =" http://gstatic.com/cloudssh/images/open-btn.png " ></a >
5
+
3
6
This sample requires Java 8.
4
7
5
8
## Download Maven
Original file line number Diff line number Diff line change 21
21
<groupId >com.google.cloud.vision.samples</groupId >
22
22
<artifactId >vision-text</artifactId >
23
23
24
- <!-- Parent defines shared plugins for linting and unit testing. -->
24
+ <!--
25
+ The parent pom defines common style checks and testing strategies for our samples.
26
+ Removing or replacing it should not affect the execution of the samples in anyway.
27
+ -->
25
28
<parent >
26
- <groupId >com.google.cloud</groupId >
27
- <artifactId >doc-samples</artifactId >
28
- <version >1.0.0</version >
29
- <relativePath >../..</relativePath >
29
+ <groupId >com.google.cloud.samples</groupId >
30
+ <artifactId >shared-configuration</artifactId >
31
+ <version >1.0.8</version >
30
32
</parent >
31
33
32
34
<properties >
Original file line number Diff line number Diff line change 18
18
19
19
import com .google .api .services .vision .v1 .model .EntityAnnotation ;
20
20
import com .google .api .services .vision .v1 .model .Status ;
21
-
22
21
import java .nio .file .Path ;
23
22
import java .util .List ;
24
-
25
23
import javax .annotation .Nullable ;
26
24
27
25
/**
Original file line number Diff line number Diff line change 17
17
package com .google .cloud .vision .samples .text ;
18
18
19
19
import com .google .common .collect .ImmutableSet ;
20
-
21
- import opennlp .tools .stemmer .Stemmer ;
22
- import opennlp .tools .tokenize .Tokenizer ;
23
- import opennlp .tools .tokenize .TokenizerModel ;
24
-
25
- import redis .clients .jedis .Jedis ;
26
- import redis .clients .jedis .JedisPool ;
27
- import redis .clients .jedis .JedisPoolConfig ;
28
-
29
20
import java .io .FileInputStream ;
30
21
import java .io .IOException ;
31
22
import java .io .InputStream ;
32
23
import java .nio .file .Path ;
33
24
import java .util .HashSet ;
34
25
import java .util .stream .Stream ;
26
+ import opennlp .tools .stemmer .Stemmer ;
27
+ import opennlp .tools .tokenize .Tokenizer ;
28
+ import opennlp .tools .tokenize .TokenizerModel ;
29
+ import redis .clients .jedis .Jedis ;
30
+ import redis .clients .jedis .JedisPool ;
31
+ import redis .clients .jedis .JedisPoolConfig ;
35
32
36
33
/**
37
34
* An inverted index using Redis.
Original file line number Diff line number Diff line change 34
34
import com .google .common .base .Splitter ;
35
35
import com .google .common .collect .ImmutableList ;
36
36
import com .google .common .collect .Lists ;
37
-
38
- import opennlp .tools .stemmer .snowball .SnowballStemmer ;
39
- import opennlp .tools .tokenize .TokenizerME ;
40
-
41
- import redis .clients .jedis .JedisPool ;
42
-
43
37
import java .io .Console ;
44
38
import java .io .IOException ;
45
39
import java .nio .file .Files ;
48
42
import java .security .GeneralSecurityException ;
49
43
import java .util .List ;
50
44
import java .util .stream .Collectors ;
45
+ import opennlp .tools .stemmer .snowball .SnowballStemmer ;
46
+ import opennlp .tools .tokenize .TokenizerME ;
47
+ import redis .clients .jedis .JedisPool ;
51
48
52
49
53
50
/**
Original file line number Diff line number Diff line change 19
19
import static com .google .common .truth .Truth .assertThat ;
20
20
21
21
import com .google .common .collect .ImmutableList ;
22
-
22
+ import java .nio .file .Path ;
23
+ import java .nio .file .Paths ;
24
+ import java .util .List ;
23
25
import org .junit .Before ;
24
26
import org .junit .Test ;
25
27
import org .junit .runner .RunWith ;
26
28
import org .junit .runners .JUnit4 ;
27
29
28
- import java .nio .file .Path ;
29
- import java .nio .file .Paths ;
30
- import java .util .List ;
31
-
32
30
/**
33
31
* Integration (system) tests for {@link TextApp}.
34
32
**/
Original file line number Diff line number Diff line change 29
29
import com .google .api .client .testing .http .MockLowLevelHttpResponse ;
30
30
import com .google .api .services .vision .v1 .Vision ;
31
31
import com .google .common .collect .ImmutableList ;
32
-
33
- import org .junit .Before ;
34
- import org .junit .Test ;
35
- import org .junit .runner .RunWith ;
36
- import org .junit .runners .JUnit4 ;
37
-
38
32
import java .io .IOException ;
39
33
import java .nio .file .Path ;
40
34
import java .nio .file .Paths ;
41
35
import java .util .List ;
36
+ import org .junit .Before ;
37
+ import org .junit .Test ;
38
+ import org .junit .runner .RunWith ;
39
+ import org .junit .runners .JUnit4 ;
42
40
43
41
/**
44
42
* Unit tests for {@link TextApp}.
You can’t perform that action at this time.
0 commit comments