Skip to content

Commit 54e5ca6

Browse files
author
JW Wesson
committed
change 'Sovren'
1 parent 213440c commit 54e5ca6

File tree

283 files changed

+436
-470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

283 files changed

+436
-470
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![Maven Central](https://img.shields.io/maven-central/v/com.textkernel/tx-java?color=0575aa)
44
[![build](https://github.com/textkernel/tx-java/actions/workflows/build.yml/badge.svg)](https://github.com/textkernel/tx-java/actions/workflows/build.yml)
55

6-
The official Java SDK for the Sovren v10 API for resume/CV and job parsing, searching, and matching. Supports Java 1.8+.
6+
The official Java SDK for the Textkernel Tx v10 API for resume/CV and job parsing, searching, and matching. Supports Java 1.8+.
77

88
## Installation
99

@@ -43,39 +43,39 @@ For full code examples, see [here][examples].
4343

4444
## Usage
4545

46-
### Creating a `SovrenClient`
47-
This is the object that you will use to perform API calls. You create it with your account credentials and the `SovrenClient` makes the raw API calls for you. These credentials can be found in the [Sovren Portal][portal]. Be sure to select the correct `DataCenter` for your account.
46+
### Creating a `TxClient`
47+
This is the object that you will use to perform API calls. You create it with your account credentials and the `TxClient` makes the raw API calls for you. These credentials can be found in the [Textkernel Portal][portal]. Be sure to select the correct `DataCenter` for your account.
4848
```java
49-
SovrenClient client = new SovrenClient("12345678", "abcdefghijklmnopqrstuvwxyz", DataCenter.US);
49+
TxClient client = new TxClient("12345678", "abcdefghijklmnopqrstuvwxyz", DataCenter.US);
5050
```
5151

5252
For self-hosted customers, you can create a `DataCenter` object with your custom URL using the constructor provided on that class.
5353

54-
### Handling errors and the `SovrenException`
55-
Every call to any of the methods in the `SovrenClient` should be wrapped in a `try/catch` block. Any 4xx/5xx level errors will cause a `SovrenException` to be thrown. Sometimes these are a normal and expected part of the Sovren API. For example, if you have a website where users upload resumes, sometimes a user will upload a scanned image as their resume. Sovren does not process these, and will return a `422 Unprocessable Entity` response which will throw a `SovrenException`. You should handle any `SovrenException` in a way that makes sense in your application.
54+
### Handling errors and the `TxException`
55+
Every call to any of the methods in the `TxClient` should be wrapped in a `try/catch` block. Any 4xx/5xx level errors will cause a `TxException` to be thrown. Sometimes these are a normal and expected part of the Tx API. For example, if you have a website where users upload resumes, sometimes a user will upload a scanned image as their resume. Textkernel does not process these, and will return a `422 Unprocessable Entity` response which will throw a `TxException`. You should handle any `TxException` in a way that makes sense in your application.
5656

57-
Additionally, there are `SovrenUsableResumeException` and `SovrenUsableJobException` which are thrown when some error/issue occurs in the API, but the response still contains a usable resume/job. For example, if you are geocoding while parsing and there is a geocoding error (which happens after parsing is done), the `ParsedResume` might still be usable in your application.
57+
Additionally, there are `TxUsableResumeException` and `TxUsableJobException` which are thrown when some error/issue occurs in the API, but the response still contains a usable resume/job. For example, if you are geocoding while parsing and there is a geocoding error (which happens after parsing is done), the `ParsedResume` might still be usable in your application.
5858

5959
### How to create a Matching UI session
6060
You may be wondering, "where are the Matching UI endpoints/methods?". We have made the difference between a normal API call (such as `Search`) and its equivalent Matching UI call extremely trivial. See the following example:
6161

6262
```java
63-
SovrenClient client = new SovrenClient("12345678", "abcdefghijklmnopqrstuvwxyz", DataCenter.US);
63+
TxClient client = new TxClient("12345678", "abcdefghijklmnopqrstuvwxyz", DataCenter.US);
6464
List<String> indexesToSearch = ...;
6565
FilterCriteria searchQuery = ...;
6666

6767
SearchResponse searchResponse = client.search(indexesToSearch, searchQuery, null, null);
6868
```
69-
To generate a Matching UI session with the above Search query, you simply need to call the `ui(...)` method on the `SovrenClient` object, pass in any UI settings, and then make the same call as above:
69+
To generate a Matching UI session with the above Search query, you simply need to call the `ui(...)` method on the `TxClient` object, pass in any UI settings, and then make the same call as above:
7070
```java
7171
MatchUISettings uiSettings = ...;
7272
GenerateUIResponse uiResponse = client.ui(uiSettings).search(indexesToSearch, searchQuery, null, null);
7373
```
74-
For every relevant method in the `SovrenClient`, you can create a Matching UI session for that query by doing the same as above.
74+
For every relevant method in the `TxClient`, you can create a Matching UI session for that query by doing the same as above.
7575

76-
[javadoc_url]: https://sovren.github.io/sovren-java/
76+
[javadoc_url]: https://textkernel.github.io/tx-java/
7777
[gson_url]: https://github.com/google/gson
7878
[okhttp_url]: https://github.com/square/okhttp
79-
[examples]: https://github.com/sovren/sovren-java/tree/master/examples
79+
[examples]: https://github.com/textkernel/tx-java/tree/master/examples
8080
[portal]: https://portal.sovren.com
8181
[api-docs]: https://developer.textkernel.com/Sovren/v10/overview/

examples/indexing/Create an Index and Add Documents.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
```java
44
import com.textkernel.tx.*;
5-
import com.textkernel.tx.exceptions.SovrenException;
5+
import com.textkernel.tx.exceptions.TxException;
66
import com.textkernel.tx.models.matching.IndexType;
77
import com.textkernel.tx.models.resume.ParsedResume;
88

99
public class ParsingExample {
1010
public static void main(String[] args) {
11-
SovrenClient client = new SovrenClient("12345678", "abcdefghijklmnopqrstuvwxyz", DataCenter.US);
11+
TxClient client = new TxClient("12345678", "abcdefghijklmnopqrstuvwxyz", DataCenter.US);
1212

13-
ParsedResume parsedResume1 = ...;//output from Sovren Resume Parser
14-
ParsedResume parsedResume2 = ...;//output from Sovren Resume Parser
13+
ParsedResume parsedResume1 = ...;//output from Resume Parser
14+
ParsedResume parsedResume2 = ...;//output from Resume Parser
1515

1616
String indexId = "myResumes";
1717

@@ -23,9 +23,9 @@ public class ParsingExample {
2323
//if we get here, it was 200-OK and all operations succeeded
2424
System.out.println("Success!");
2525
}
26-
catch (SovrenException e) {
27-
//this was an outright failure, always try/catch for SovrenExceptions when using SovrenClient
28-
System.out.println("Error: " + e.SovrenErrorCode + ", Message: " + e.getMessage());
26+
catch (TxException e) {
27+
//this was an outright failure, always try/catch for TxExceptions when using TxClient
28+
System.out.println("Error: " + e.TxErrorCode + ", Message: " + e.getMessage());
2929
}
3030
}
3131
}

examples/parsing/Basic Parsing.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
```java
44
import com.textkernel.tx.*;
5-
import com.textkernel.tx.exceptions.SovrenException;
5+
import com.textkernel.tx.exceptions.TxException;
66
import com.textkernel.tx.models.Document;
7-
import com.textkernel.tx.models.SovrenDate;
7+
import com.textkernel.tx.models.TxDate;
88
import com.textkernel.tx.models.api.parsing.ParseOptions;
99
import com.textkernel.tx.models.api.parsing.ParseRequest;
1010
import com.textkernel.tx.models.api.parsing.ParseResumeResponse;
@@ -21,7 +21,7 @@ import java.time.format.DateTimeFormatter;
2121

2222
public class ParsingExample {
2323
public static void main(String[] args) throws IOException {
24-
SovrenClient client = new SovrenClient("12345678", "abcdefghijklmnopqrstuvwxyz", DataCenter.US);
24+
TxClient client = new TxClient("12345678", "abcdefghijklmnopqrstuvwxyz", DataCenter.US);
2525

2626
//A Document is an unparsed File (PDF, Word Doc, etc)
2727
Document doc = new Document("resume.docx");
@@ -34,12 +34,12 @@ public class ParsingExample {
3434
ParseResumeResponse response = client.parseResume(request);
3535
//if we get here, it was 200-OK and all operations succeeded
3636

37-
//now we can use the response from Sovren to output some of the data from the resume
37+
//now we can use the response to output some of the data from the resume
3838
printBasicResumeInfo(response);
3939
}
40-
catch (SovrenException e) {
41-
//the document could not be parsed, always try/catch for SovrenExceptions when using SovrenClient
42-
System.out.println("Code: " + e.HttpStatusCode + ", Error: " + e.SovrenErrorCode + ", Message: " + e.getMessage());
40+
catch (TxException e) {
41+
//the document could not be parsed, always try/catch for TxExceptions when using TxClient
42+
System.out.println("Code: " + e.HttpStatusCode + ", Error: " + e.TxErrorCode + ", Message: " + e.getMessage());
4343
}
4444
}
4545

@@ -90,7 +90,7 @@ public class ParsingExample {
9090
printHeader("PERSONAL INFORMATION");
9191

9292
if (personalInfo.DateOfBirth != null)
93-
System.out.println("Date of Birth: " + getSovrenDateAsString(personalInfo.DateOfBirth));
93+
System.out.println("Date of Birth: " + getTxDateAsString(personalInfo.DateOfBirth));
9494
if (personalInfo.DrivingLicense != null)
9595
System.out.println("Driving License: " + personalInfo.DrivingLicense);
9696
if (personalInfo.Nationality != null)
@@ -117,7 +117,7 @@ public class ParsingExample {
117117
System.out.println("Employer: " + position.Employer.Name.Normalized);
118118
if (position.JobTitle != null)
119119
System.out.println("Title: " + position.JobTitle.Normalized);
120-
System.out.println("Date Range: " + getSovrenDateAsString(position.StartDate) + " - " + getSovrenDateAsString(position.EndDate));
120+
System.out.println("Date Range: " + getTxDateAsString(position.StartDate) + " - " + getTxDateAsString(position.EndDate));
121121
}
122122
}
123123
}
@@ -142,13 +142,13 @@ public class ParsingExample {
142142
if (edu.GPA != null)
143143
System.out.println("GPA: " + edu.GPA.NormalizedScore + "/1.0 (" + edu.GPA.Score + "/" + edu.GPA.MaxScore + ")");
144144
String endDateRepresents = edu.Graduated != null && edu.Graduated.Value ? "Graduated" : "Last Attended";
145-
System.out.println(endDateRepresents + ": " + getSovrenDateAsString(edu.EndDate));
145+
System.out.println(endDateRepresents + ": " + getTxDateAsString(edu.EndDate));
146146
}
147147
}
148148
}
149149

150-
static String getSovrenDateAsString(SovrenDate date) {
151-
//a SovrenDate represents a date found on a resume, so it can either be
150+
static String getTxDateAsString(TxDate date) {
151+
//a TxDate represents a date found on a resume, so it can either be
152152
//'current', as in "July 2018 - current"
153153
//a year, as in "2018 - 2020"
154154
//a year and month, as in "2018/06 - 2020/07"

examples/parsing/Parsing With Geocoding and Indexing.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
```java
44
import com.textkernel.tx.*;
5-
import com.textkernel.tx.exceptions.SovrenException;
6-
import com.textkernel.tx.exceptions.SovrenUsableResumeException;
5+
import com.textkernel.tx.exceptions.TxException;
6+
import com.textkernel.tx.exceptions.TxUsableResumeException;
77
import com.textkernel.tx.models.Document;
88
import com.textkernel.tx.models.api.geocoding.GeocodeOptions;
99
import com.textkernel.tx.models.api.geocoding.GeocodeProvider;
@@ -15,7 +15,7 @@ import java.io.IOException;
1515

1616
public class ParsingExample {
1717
public static void main(String[] args) throws IOException {
18-
SovrenClient client = new SovrenClient("12345678", "abcdefghijklmnopqrstuvwxyz", DataCenter.US);
18+
TxClient client = new TxClient("12345678", "abcdefghijklmnopqrstuvwxyz", DataCenter.US);
1919

2020
//A Document is an unparsed File (PDF, Word Doc, etc)
2121
Document doc = new Document("resume.docx");
@@ -37,15 +37,15 @@ public class ParsingExample {
3737

3838
System.out.println("Success!");
3939
}
40-
catch (SovrenUsableResumeException e) {
40+
catch (TxUsableResumeException e) {
4141
//this indicates an error occurred when geocoding or indexing, but the
4242
//parsed resume may still be usable
4343

4444
//do something with e.Response.Value.ResumeData if it has good data
4545
}
46-
catch (SovrenException e) {
47-
//this was an outright failure, always try/catch for SovrenExceptions when using SovrenClient
48-
System.out.println("Error: " + e.SovrenErrorCode + ", Message: " + e.getMessage());
46+
catch (TxException e) {
47+
//this was an outright failure, always try/catch for TxExceptions when using TxClient
48+
System.out.println("Error: " + e.TxErrorCode + ", Message: " + e.getMessage());
4949
}
5050
}
5151
}

src/main/java/com/textkernel/tx/ApiEndpoints.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright © 2023 Textkernel BV. All rights reserved.
22
// This file is provided for use by, or on behalf of, Textkernel licensees
3-
// within the terms of their license of Sovren products or Textkernel customers
3+
// within the terms of their license of Textkernel products or Textkernel customers
44
// within the Terms of Service pertaining to the Textkernel SaaS products.
55

66
package com.textkernel.tx;
@@ -21,7 +21,7 @@ private String prefix() {
2121
}
2222

2323
private String prefix(boolean isMatchUI) {
24-
if (isMatchUI && !_dataCenter.IsSovrenSaaS) {
24+
if (isMatchUI && !_dataCenter.IsSaaS) {
2525
//throw new IllegalAccessException("Cannot call Matching UI on a self-hosted installation.");
2626
//do not throw this for now, it will just be a 404
2727
}

src/main/java/com/textkernel/tx/DataCenter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
// Copyright © 2023 Textkernel BV. All rights reserved.
22
// This file is provided for use by, or on behalf of, Textkernel licensees
3-
// within the terms of their license of Sovren products or Textkernel customers
3+
// within the terms of their license of Textkernel products or Textkernel customers
44
// within the Terms of Service pertaining to the Textkernel SaaS products.
55

66
package com.textkernel.tx;
77

88
/** Use either {@link DataCenter#US} or {@link DataCenter#EU}*/
99
public class DataCenter {
1010

11-
/** Represents the Sovren US datacenter. You can find out which datacenter your account is in at https://portal.sovren.com*/
11+
/** Represents the US datacenter. You can find out which datacenter your account is in at https://portal.sovren.com*/
1212
public static DataCenter US = new DataCenter("https://rest.resumeparsing.com", "v10", true);
1313

14-
/** Represents the Sovren EU datacenter. You can find out which datacenter your account is in at https://portal.sovren.com*/
14+
/** Represents the EU datacenter. You can find out which datacenter your account is in at https://portal.sovren.com*/
1515
public static DataCenter EU = new DataCenter("https://eu-rest.resumeparsing.com", "v10", true);
1616

17-
/** Represents the Sovren AU datacenter. You can find out which datacenter your account is in at https://portal.sovren.com*/
17+
/** Represents the AU datacenter. You can find out which datacenter your account is in at https://portal.sovren.com*/
1818
public static DataCenter AU = new DataCenter("https://au-rest.resumeparsing.com", "v10", true);
1919

2020
String Root;
2121
String Version;
22-
boolean IsSovrenSaaS;
22+
boolean IsSaaS;
2323

2424
protected DataCenter(String root, String version, boolean isSaaS) {
2525
Root = root;
2626
Version = version;
27-
IsSovrenSaaS = isSaaS;
27+
IsSaaS = isSaaS;
2828
}
2929

3030
/**

0 commit comments

Comments
 (0)