Skip to content

Commit b19f1f2

Browse files
update samples, switch syntax for indian passport
1 parent 868eb2b commit b19f1f2

File tree

8 files changed

+141
-46
lines changed

8 files changed

+141
-46
lines changed

docs/business_card_v1.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ parentDoc: 631a062c3718850f3519b793
66
---
77
The Java OCR SDK supports the [Business Card API](https://platform.mindee.com/mindee/business_card).
88

9-
The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/business_card/default_sample.jpg) can be used for testing purposes.
9+
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/business_card/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
1010
![Business Card sample](https://github.com/mindee/client-lib-test-data/blob/main/products/business_card/default_sample.jpg?raw=true)
1111

1212
# Quick-Start
@@ -54,6 +54,36 @@ public class SimpleMindeeClient {
5454
}
5555

5656
```
57+
58+
**Output (RST):**
59+
```rst
60+
########
61+
Document
62+
########
63+
:Mindee ID: 6f9a261f-7609-4687-9af0-46a45156566e
64+
:Filename: default_sample.jpg
65+
66+
Inference
67+
#########
68+
:Product: mindee/business_card v1.0
69+
:Rotation applied: Yes
70+
71+
Prediction
72+
==========
73+
:Firstname: Andrew
74+
:Lastname: Morin
75+
:Job Title: Founder & CEO
76+
:Company: RemoteGlobal
77+
:Email: amorin@remoteglobalconsulting.com
78+
:Phone Number: +14015555555
79+
:Mobile Number: +13015555555
80+
:Fax Number: +14015555556
81+
:Address: 178 Main Avenue, Providence, RI 02111
82+
:Website: www.remoteglobalconsulting.com
83+
:Social Media: https://www.linkedin.com/in/johndoe
84+
https://twitter.com/johndoe
85+
```
86+
5787
# Field Types
5888
## Standard Fields
5989
These fields are generic and used in several products.

docs/code_samples/ind_passport_v1_async.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import com.mindee.MindeeClient;
22
import com.mindee.input.LocalInputSource;
33
import com.mindee.parsing.common.AsyncPredictResponse;
4-
import com.mindee.product.ind.passport.PassportV1;
4+
import com.mindee.product.ind.indianpassport.IndianPassportV1;
55
import java.io.File;
66
import java.io.IOException;
77

@@ -18,8 +18,8 @@ public class SimpleMindeeClient {
1818
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
1919

2020
// Parse the file asynchronously
21-
AsyncPredictResponse<PassportV1> response = mindeeClient.enqueueAndParse(
22-
PassportV1.class,
21+
AsyncPredictResponse<IndianPassportV1> response = mindeeClient.enqueueAndParse(
22+
IndianPassportV1.class,
2323
inputSource
2424
);
2525

docs/delivery_notes_v1.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ parentDoc: 631a062c3718850f3519b793
66
---
77
The Java OCR SDK supports the [Delivery note API](https://platform.mindee.com/mindee/delivery_notes).
88

9-
The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/delivery_notes/default_sample.jpg) can be used for testing purposes.
9+
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/delivery_notes/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
1010
![Delivery note sample](https://github.com/mindee/client-lib-test-data/blob/main/products/delivery_notes/default_sample.jpg?raw=true)
1111

1212
# Quick-Start
@@ -54,6 +54,31 @@ public class SimpleMindeeClient {
5454
}
5555

5656
```
57+
58+
**Output (RST):**
59+
```rst
60+
########
61+
Document
62+
########
63+
:Mindee ID: d5ead821-edec-4d31-a69a-cf3998d9a506
64+
:Filename: default_sample.jpg
65+
66+
Inference
67+
#########
68+
:Product: mindee/delivery_notes v1.0
69+
:Rotation applied: Yes
70+
71+
Prediction
72+
==========
73+
:Delivery Date: 2019-10-02
74+
:Delivery Number: INT-001
75+
:Supplier Name: John Smith
76+
:Supplier Address: 4490 Oak Drive, Albany, NY 12210
77+
:Customer Name: Jessie M Horne
78+
:Customer Address: 4312 Wood Road, New York, NY 10031
79+
:Total Amount: 204.75
80+
```
81+
5782
# Field Types
5883
## Standard Fields
5984
These fields are generic and used in several products.

docs/ind_passport_v1.md

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
title: IND Passport OCR Java
2+
title: IND Indian Passport OCR Java
33
category: 622b805aaec68102ea7fcbc2
4-
slug: java-ind-passport-ocr
4+
slug: java-ind-indian-passport-ocr
55
parentDoc: 631a062c3718850f3519b793
66
---
7-
The Java OCR SDK supports the [Passport API](https://platform.mindee.com/mindee/ind_passport).
7+
The Java OCR SDK supports the [Indian Passport API](https://platform.mindee.com/mindee/ind_passport).
88

9-
The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/ind_passport/default_sample.jpg) can be used for testing purposes.
10-
![Passport sample](https://github.com/mindee/client-lib-test-data/blob/main/products/ind_passport/default_sample.jpg?raw=true)
9+
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/ind_passport/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
10+
![Indian Passport sample](https://github.com/mindee/client-lib-test-data/blob/main/products/ind_passport/default_sample.jpg?raw=true)
1111

1212
# Quick-Start
1313
```java
1414
import com.mindee.MindeeClient;
1515
import com.mindee.input.LocalInputSource;
1616
import com.mindee.parsing.common.AsyncPredictResponse;
17-
import com.mindee.product.ind.passport.PassportV1;
17+
import com.mindee.product.ind.indianpassport.IndianPassportV1;
1818
import java.io.File;
1919
import java.io.IOException;
2020

@@ -31,8 +31,8 @@ public class SimpleMindeeClient {
3131
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
3232

3333
// Parse the file asynchronously
34-
AsyncPredictResponse<PassportV1> response = mindeeClient.enqueueAndParse(
35-
PassportV1.class,
34+
AsyncPredictResponse<IndianPassportV1> response = mindeeClient.enqueueAndParse(
35+
IndianPassportV1.class,
3636
inputSource
3737
);
3838

@@ -54,6 +54,47 @@ public class SimpleMindeeClient {
5454
}
5555

5656
```
57+
58+
**Output (RST):**
59+
```rst
60+
########
61+
Document
62+
########
63+
:Mindee ID: cf88fd43-eaa1-497a-ba29-a9569a4edaa7
64+
:Filename: default_sample.jpg
65+
66+
Inference
67+
#########
68+
:Product: mindee/ind_passport v1.0
69+
:Rotation applied: Yes
70+
71+
Prediction
72+
==========
73+
:Page Number: 1
74+
:Country: IND
75+
:ID Number: J8369854
76+
:Given Names: JOCELYN MICHELLE
77+
:Surname: DOE
78+
:Birth Date: 1959-09-23
79+
:Birth Place: GUNDUGOLANU
80+
:Issuance Place: HYDERABAD
81+
:Gender: F
82+
:Issuance Date: 2011-10-11
83+
:Expiry Date: 2021-10-10
84+
:MRZ Line 1: P<DOE<<JOCELYNMICHELLE<<<<<<<<<<<<<<<<<<<<<
85+
:MRZ Line 2: J8369854<4IND5909234F2110101<<<<<<<<<<<<<<<8
86+
:Legal Guardian:
87+
:Name of Spouse:
88+
:Name of Mother:
89+
:Old Passport Date of Issue:
90+
:Old Passport Number:
91+
:Address Line 1:
92+
:Address Line 2:
93+
:Address Line 3:
94+
:Old Passport Place of Issue:
95+
:File Number:
96+
```
97+
5798
# Field Types
5899
## Standard Fields
59100
These fields are generic and used in several products.
@@ -91,7 +132,7 @@ The date field `DateField` extends `BaseField`, but also implements:
91132
* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`.
92133

93134
# Attributes
94-
The following fields are extracted for Passport V1:
135+
The following fields are extracted for Indian Passport V1:
95136

96137
## Address Line 1
97138
**address1**: The first line of the address of the passport holder.

docs/resume_v1.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ public class SimpleMindeeClient {
6060
########
6161
Document
6262
########
63-
:Mindee ID: bc80bae0-af75-4464-95a9-2419403c75bf
63+
:Mindee ID: 9daa3085-152c-454e-9245-636f13fc9dc3
6464
:Filename: default_sample.jpg
6565
6666
Inference
6767
#########
68-
:Product: mindee/resume v1.0
69-
:Rotation applied: No
68+
:Product: mindee/resume v1.1
69+
:Rotation applied: Yes
7070
7171
Prediction
7272
==========
@@ -76,8 +76,8 @@ Prediction
7676
:Surnames: Morgan
7777
:Nationality:
7878
:Email Address: christoper.m@gmail.com
79-
:Phone Number: +44 (0) 20 7666 8555
80-
:Address: 177 Great Portland Street, London W5W 6PQ
79+
:Phone Number: +44 (0)20 7666 8555
80+
:Address: 177 Great Portland Street, London, W5W 6PQ
8181
:Social Networks:
8282
+----------------------+----------------------------------------------------+
8383
| Name | URL |
@@ -94,38 +94,37 @@ Prediction
9494
+----------+----------------------+
9595
| ZHO | Beginner |
9696
+----------+----------------------+
97-
| DEU | Intermediate |
97+
| DEU | Beginner |
9898
+----------+----------------------+
9999
:Hard Skills: HTML5
100100
PHP OOP
101101
JavaScript
102102
CSS
103103
MySQL
104+
SQL
104105
:Soft Skills: Project management
106+
Creative design
105107
Strong decision maker
106108
Innovative
107109
Complex problem solver
108-
Creative design
109110
Service-focused
110111
:Education:
111112
+-----------------+---------------------------+-----------+----------+---------------------------+-------------+------------+
112113
| Domain | Degree | End Month | End Year | School | Start Month | Start Year |
113114
+=================+===========================+===========+==========+===========================+=============+============+
114-
| Computer Inf... | Bachelor | | | Columbia University, NY | | 2014 |
115+
| Computer Inf... | Bachelor | | 2014 | Columbia University, NY | | |
115116
+-----------------+---------------------------+-----------+----------+---------------------------+-------------+------------+
116117
:Professional Experiences:
117-
+-----------------+------------+---------------------------+-----------+----------+----------------------+-------------+------------+
118-
| Contract Type | Department | Employer | End Month | End Year | Role | Start Month | Start Year |
119-
+=================+============+===========================+===========+==========+======================+=============+============+
120-
| Full-Time | | Luna Web Design, New York | 05 | 2019 | Web Developer | 09 | 2015 |
121-
+-----------------+------------+---------------------------+-----------+----------+----------------------+-------------+------------+
118+
+-----------------+------------+--------------------------------------+---------------------------+-----------+----------+----------------------+-------------+------------+
119+
| Contract Type | Department | Description | Employer | End Month | End Year | Role | Start Month | Start Year |
120+
+=================+============+======================================+===========================+===========+==========+======================+=============+============+
121+
| | | Cooperate with designers to creat... | Luna Web Design, New York | 05 | 2019 | Web Developer | 09 | 2015 |
122+
+-----------------+------------+--------------------------------------+---------------------------+-----------+----------+----------------------+-------------+------------+
122123
:Certificates:
123124
+------------+--------------------------------+---------------------------+------+
124125
| Grade | Name | Provider | Year |
125126
+============+================================+===========================+======+
126-
| | PHP Framework (certificate)... | | 2014 |
127-
+------------+--------------------------------+---------------------------+------+
128-
| | Programming Languages: Java... | | |
127+
| | PHP Framework (certificate)... | | |
129128
+------------+--------------------------------+---------------------------+------+
130129
```
131130

src/main/java/com/mindee/product/ind/passport/PassportV1.java renamed to src/main/java/com/mindee/product/ind/indianpassport/IndianPassportV1.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
package com.mindee.product.ind.passport;
1+
package com.mindee.product.ind.indianpassport;
22

33
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
44
import com.mindee.http.EndpointInfo;
55
import com.mindee.parsing.common.Inference;
66
import lombok.Getter;
77

88
/**
9-
* Passport API version 1 inference prediction.
9+
* Indian Passport API version 1 inference prediction.
1010
*/
1111
@Getter
1212
@JsonIgnoreProperties(ignoreUnknown = true)
1313
@EndpointInfo(endpointName = "ind_passport", version = "1")
14-
public class PassportV1
15-
extends Inference<PassportV1Document, PassportV1Document> {
14+
public class IndianPassportV1
15+
extends Inference<IndianPassportV1Document, IndianPassportV1Document> {
1616
}

src/main/java/com/mindee/product/ind/passport/PassportV1Document.java renamed to src/main/java/com/mindee/product/ind/indianpassport/IndianPassportV1Document.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.mindee.product.ind.passport;
1+
package com.mindee.product.ind.indianpassport;
22

33
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
44
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -11,12 +11,12 @@
1111
import lombok.Getter;
1212

1313
/**
14-
* Passport API version 1.0 document data.
14+
* Indian Passport API version 1.0 document data.
1515
*/
1616
@Getter
1717
@EqualsAndHashCode(callSuper = false)
1818
@JsonIgnoreProperties(ignoreUnknown = true)
19-
public class PassportV1Document extends Prediction {
19+
public class IndianPassportV1Document extends Prediction {
2020

2121
/**
2222
* The first line of the address of the passport holder.

src/test/java/com/mindee/product/ind/passport/PassportV1Test.java renamed to src/test/java/com/mindee/product/ind/indianpassport/IndianPassportV1Test.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.mindee.product.ind.passport;
1+
package com.mindee.product.ind.indianpassport;
22

33
import com.fasterxml.jackson.databind.JavaType;
44
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -12,17 +12,17 @@
1212
import java.io.IOException;
1313

1414
/**
15-
* Unit tests for PassportV1.
15+
* Unit tests for IndianPassportV1.
1616
*/
17-
public class PassportV1Test {
17+
public class IndianPassportV1Test {
1818

19-
protected PredictResponse<PassportV1> getPrediction(String name) throws IOException {
19+
protected PredictResponse<IndianPassportV1> getPrediction(String name) throws IOException {
2020
ObjectMapper objectMapper = new ObjectMapper();
2121
objectMapper.findAndRegisterModules();
2222

2323
JavaType type = objectMapper.getTypeFactory().constructParametricType(
2424
PredictResponse.class,
25-
PassportV1.class
25+
IndianPassportV1.class
2626
);
2727
return objectMapper.readValue(
2828
new File("src/test/resources/products/ind_passport/response_v1/" + name + ".json"),
@@ -32,8 +32,8 @@ protected PredictResponse<PassportV1> getPrediction(String name) throws IOExcept
3232

3333
@Test
3434
void whenEmptyDeserialized_mustHaveValidProperties() throws IOException {
35-
PredictResponse<PassportV1> response = getPrediction("empty");
36-
PassportV1Document docPrediction = response.getDocument().getInference().getPrediction();
35+
PredictResponse<IndianPassportV1> response = getPrediction("empty");
36+
IndianPassportV1Document docPrediction = response.getDocument().getInference().getPrediction();
3737
Assertions.assertInstanceOf(ClassificationField.class, docPrediction.getPageNumber());
3838
Assertions.assertNull(docPrediction.getCountry().getValue());
3939
Assertions.assertNull(docPrediction.getIdNumber().getValue());
@@ -61,8 +61,8 @@ void whenEmptyDeserialized_mustHaveValidProperties() throws IOException {
6161

6262
@Test
6363
void whenCompleteDeserialized_mustHaveValidDocumentSummary() throws IOException {
64-
PredictResponse<PassportV1> response = getPrediction("complete");
65-
Document<PassportV1> doc = response.getDocument();
64+
PredictResponse<IndianPassportV1> response = getPrediction("complete");
65+
Document<IndianPassportV1> doc = response.getDocument();
6666
ProductTestHelper.assertStringEqualsFile(
6767
doc.toString(),
6868
"src/test/resources/products/ind_passport/response_v1/summary_full.rst"

0 commit comments

Comments
 (0)