Skip to content

Commit d2bbebb

Browse files
author
Adam Soos
committed
WS-3314: removing rosette from example variables
1 parent cd71a4d commit d2bbebb

30 files changed

+65
-65
lines changed

examples/src/main/java/com/basistech/rosette/examples/AddressSimilarityExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private void run() throws IOException {
5757
UnfieldedAddress address2 = UnfieldedAddress.builder()
5858
.address(addressSimilarityAddress2)
5959
.build();
60-
HttpRosetteAPI rosetteApi = new HttpRosetteAPI.Builder()
60+
HttpRosetteAPI api = new HttpRosetteAPI.Builder()
6161
.key(getApiKeyFromSystemProperty())
6262
.url(getAltUrlFromSystemProperty())
6363
.build();
@@ -67,7 +67,7 @@ private void run() throws IOException {
6767
.address1(address1)
6868
.address2(address2)
6969
.build();
70-
AddressSimilarityResponse response = rosetteApi
70+
AddressSimilarityResponse response = api
7171
.perform(ADDRESS_SIMILARITY_SERVICE_PATH, request, AddressSimilarityResponse.class);
7272

7373
System.out.println(responseToJson(response));

examples/src/main/java/com/basistech/rosette/examples/CategoriesExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static void main(String[] args) {
4343

4444
private void run() throws IOException {
4545
String categoriesTextData = "If you are a fan of the British television series Downton Abbey and you are planning to be in New York anytime before April 2nd, there is a perfect stop for you while in town.";
46-
HttpRosetteAPI rosetteApi = new HttpRosetteAPI.Builder()
46+
HttpRosetteAPI api = new HttpRosetteAPI.Builder()
4747
.key(getApiKeyFromSystemProperty())
4848
.url(getAltUrlFromSystemProperty())
4949
.build();
@@ -52,7 +52,7 @@ private void run() throws IOException {
5252
DocumentRequest<CategoriesOptions> request = DocumentRequest.<CategoriesOptions>builder()
5353
.content(categoriesTextData)
5454
.build();
55-
CategoriesResponse response = rosetteApi.perform(CATEGORIES_SERVICE_PATH, request, CategoriesResponse.class);
55+
CategoriesResponse response = api.perform(CATEGORIES_SERVICE_PATH, request, CategoriesResponse.class);
5656
System.out.println(responseToJson(response));
5757
}
5858
}

examples/src/main/java/com/basistech/rosette/examples/ConcurrencyExample.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static void main(String[] args) {
6464
private void run() throws IOException, ExecutionException, InterruptedException {
6565
//Setting up the Api
6666
int maximumConcurrency = 3;
67-
HttpRosetteAPI rosetteApi = new HttpRosetteAPI.Builder()
67+
HttpRosetteAPI api = new HttpRosetteAPI.Builder()
6868
.key(getApiKeyFromSystemProperty())
6969
.url(getAltUrlFromSystemProperty())
7070
.connectionConcurrency(maximumConcurrency)
@@ -80,21 +80,21 @@ private void run() throws IOException, ExecutionException, InterruptedException
8080
+ "In that role, they were jointly responsible for supervising the trial unit at the agency’s Washington D.C. headquarters "
8181
+ "as well as coordinating with litigators in the SEC’s 11 regional offices around the country.";
8282
requests.add(
83-
rosetteApi.createRosetteRequest(ENTITIES_SERVICE_PATH,
83+
api.createRosetteRequest(ENTITIES_SERVICE_PATH,
8484
DocumentRequest.<EntitiesOptions>builder().content(entitiesTextData).build(),
8585
EntitiesResponse.class)
8686
);
8787
// Setting up language request
8888
String languageData = "Por favor Señorita, says the man.";
8989
requests.add(
90-
rosetteApi.createRosetteRequest(LANGUAGE_SERVICE_PATH,
90+
api.createRosetteRequest(LANGUAGE_SERVICE_PATH,
9191
DocumentRequest.<LanguageOptions>builder().content(languageData).build(),
9292
LanguageResponse.class)
9393
);
9494
// Setting up morphology request
9595
// No content is given to this request and it will return an error response
9696
requests.add(
97-
rosetteApi.createRosetteRequest(MORPHOLOGY_SERVICE_PATH + "/" + MorphologicalFeature.COMPLETE,
97+
api.createRosetteRequest(MORPHOLOGY_SERVICE_PATH + "/" + MorphologicalFeature.COMPLETE,
9898
DocumentRequest.<MorphologyOptions>builder().build(),
9999
MorphologyResponse.class)
100100
);
@@ -108,21 +108,21 @@ private void run() throws IOException, ExecutionException, InterruptedException
108108
}
109109
double threshold = 0.75;
110110
requests.add(
111-
rosetteApi.createRosetteRequest(NAME_DEDUPLICATION_SERVICE_PATH,
111+
api.createRosetteRequest(NAME_DEDUPLICATION_SERVICE_PATH,
112112
NameDeduplicationRequest.builder().names(names).threshold(threshold).build(),
113113
NameDeduplicationResponse.class)
114114
);
115115
//Setting up the tokens request
116116
String tokensData = "北京大学生物系主任办公室内部会议";
117117
requests.add(
118-
rosetteApi.createRosetteRequest(TOKENS_SERVICE_PATH,
118+
api.createRosetteRequest(TOKENS_SERVICE_PATH,
119119
DocumentRequest.builder().content(tokensData).build(),
120120
TokensResponse.class)
121121
);
122122
//Setting up the transliteration request
123123
String transliterationData = "ana r2ye7 el gam3a el sa3a 3 el 3asr";
124124
requests.add(
125-
rosetteApi.createRosetteRequest(TRANSLITERATION_SERVICE_PATH,
125+
api.createRosetteRequest(TRANSLITERATION_SERVICE_PATH,
126126
DocumentRequest.builder().content(transliterationData).build(),
127127
TransliterationResponse.class)
128128
);

examples/src/main/java/com/basistech/rosette/examples/EntitiesExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ public static void main(String[] args) {
3939

4040
private void run() throws IOException {
4141
String entitiesTextData = "The Securities and Exchange Commission today announced the leadership of the agency’s trial unit. Bridget Fitzpatrick has been named Chief Litigation Counsel of the SEC and David Gottesman will continue to serve as the agency’s Deputy Chief Litigation Counsel. Since December 2016, Ms. Fitzpatrick and Mr. Gottesman have served as Co-Acting Chief Litigation Counsel. In that role, they were jointly responsible for supervising the trial unit at the agency’s Washington D.C. headquarters as well as coordinating with litigators in the SEC’s 11 regional offices around the country.";
42-
HttpRosetteAPI rosetteApi = new HttpRosetteAPI.Builder()
42+
HttpRosetteAPI api = new HttpRosetteAPI.Builder()
4343
.key(getApiKeyFromSystemProperty())
4444
.url(getAltUrlFromSystemProperty())
4545
.build();
4646
DocumentRequest<EntitiesOptions> request = DocumentRequest.<EntitiesOptions>builder()
4747
.content(entitiesTextData)
4848
.build();
49-
EntitiesResponse response = rosetteApi.perform(ENTITIES_SERVICE_PATH, request, EntitiesResponse.class);
49+
EntitiesResponse response = api.perform(ENTITIES_SERVICE_PATH, request, EntitiesResponse.class);
5050
System.out.println(responseToJson(response));
5151
}
5252
}

examples/src/main/java/com/basistech/rosette/examples/EventsExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ public static void main(String[] args) {
3838

3939
private void run() throws Exception {
4040
String topicsData = "I am looking for flights to Super Bowl 2022 in Inglewood, LA.";
41-
HttpRosetteAPI rosetteApi = new HttpRosetteAPI.Builder()
41+
HttpRosetteAPI api = new HttpRosetteAPI.Builder()
4242
.key(getApiKeyFromSystemProperty())
4343
.url(getAltUrlFromSystemProperty())
4444
.build();
4545
DocumentRequest<EventsOptions> request = DocumentRequest.<EventsOptions>builder()
4646
.language(LanguageCode.ENGLISH)
4747
.content(topicsData)
4848
.build();
49-
EventsResponse resp = rosetteApi.perform(EVENTS_SERVICE_PATH, request, EventsResponse.class);
49+
EventsResponse resp = api.perform(EVENTS_SERVICE_PATH, request, EventsResponse.class);
5050
System.out.println(responseToJson(resp));
5151
}
5252
}

examples/src/main/java/com/basistech/rosette/examples/ExampleBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected static void showUsage(Class<? extends ExampleBase> commandClass) {
6666
/**
6767
* Converts a response to JSON string
6868
*
69-
* @param response {@link com.basistech.rosette.apimodel.Response Response} from RosetteAPI
69+
* @param response {@link com.basistech.rosette.apimodel.Response Response} from Analytics API
7070
* @return the json string.
7171
* @throws JsonProcessingException if the Jackson library throws an error serializing.
7272
*/

examples/src/main/java/com/basistech/rosette/examples/InfoExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ public static void main(String[] args) {
3535
}
3636

3737
private void run() throws IOException {
38-
HttpRosetteAPI rosetteApi = new HttpRosetteAPI.Builder()
38+
HttpRosetteAPI api = new HttpRosetteAPI.Builder()
3939
.key(getApiKeyFromSystemProperty())
4040
.url(getAltUrlFromSystemProperty())
4141
.build();
4242
//The api object creates an http client, but to provide your own:
4343
//api.httpClient(CloseableHttpClient)
44-
InfoResponse response = rosetteApi.info();
44+
InfoResponse response = api.info();
4545
System.out.println(responseToJson(response));
4646
}
4747
}

examples/src/main/java/com/basistech/rosette/examples/LanguageExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static void main(String[] args) {
4141
private void run() throws IOException {
4242
String languageData = "Por favor Señorita, says the man.";
4343

44-
HttpRosetteAPI rosetteApi = new HttpRosetteAPI.Builder()
44+
HttpRosetteAPI api = new HttpRosetteAPI.Builder()
4545
.key(getApiKeyFromSystemProperty())
4646
.url(getAltUrlFromSystemProperty())
4747
.build();
@@ -50,7 +50,7 @@ private void run() throws IOException {
5050
DocumentRequest<LanguageOptions> request = DocumentRequest.<LanguageOptions>builder()
5151
.content(languageData)
5252
.build();
53-
LanguageResponse response = rosetteApi.perform(LANGUAGE_SERVICE_PATH, request, LanguageResponse.class);
53+
LanguageResponse response = api.perform(LANGUAGE_SERVICE_PATH, request, LanguageResponse.class);
5454
System.out.println(responseToJson(response));
5555
}
5656
}

examples/src/main/java/com/basistech/rosette/examples/LanguageMultilingualExample.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@ public static void main(String[] args) {
4141
private void run() throws IOException {
4242
String languageMultilingualData = "On Thursday, as protesters gathered in Washington D.C., the United States Federal Communications Commission under Chairman Ajit Pai voted 3-2 to overturn a 2015 decision, commonly called Net Neutrality, that forbade Internet service providers (ISPs) such as Verizon, Comcast, and AT&T from blocking individual websites or charging websites or customers more for faster load times. Quatre femmes ont été nommées au Conseil de rédaction de la loi du Qatar. Jeudi, le décret royal du Qatar a annoncé que 28 nouveaux membres ont été nommés pour le Conseil de la Choura du pays. ذكرت مصادر أمنية يونانية، أن 9 موقوفين من منظمة \"د هـ ك ب ج\" الذين كانت قد أوقفتهم الشرطة اليونانية في وقت سابق كانوا يخططون لاغتيال الرئيس التركي رجب طيب أردوغان.";
4343

44-
HttpRosetteAPI rosetteApi = new HttpRosetteAPI.Builder()
44+
HttpRosetteAPI api = new HttpRosetteAPI.Builder()
4545
.key(getApiKeyFromSystemProperty())
4646
.url(getAltUrlFromSystemProperty())
4747
.build();
4848
//The api object creates an http client, but to provide your own:
49-
//rosetteApi.httpClient(CloseableHttpClient)
49+
//api.httpClient(CloseableHttpClient)
5050

5151
LanguageOptions options = LanguageOptions.builder().multilingual(true).build();
5252

5353
DocumentRequest<LanguageOptions> request = DocumentRequest.<LanguageOptions>builder()
5454
.content(languageMultilingualData)
5555
.options(options)
5656
.build();
57-
LanguageResponse response = rosetteApi.perform(LANGUAGE_SERVICE_PATH, request, LanguageResponse.class);
57+
LanguageResponse response = api.perform(LANGUAGE_SERVICE_PATH, request, LanguageResponse.class);
5858
System.out.println(responseToJson(response));
5959
}
6060
}

examples/src/main/java/com/basistech/rosette/examples/MorphologyCompleteExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ public static void main(String[] args) {
4242
private void run() throws IOException {
4343
String morphologyCompleteData = "The quick brown fox jumped over the lazy dog. 👍🏾 Yes he did. B)";
4444

45-
HttpRosetteAPI rosetteApi = new HttpRosetteAPI.Builder()
45+
HttpRosetteAPI api = new HttpRosetteAPI.Builder()
4646
.key(getApiKeyFromSystemProperty())
4747
.url(getAltUrlFromSystemProperty())
4848
.build();
4949
DocumentRequest<MorphologyOptions> request = DocumentRequest.<MorphologyOptions>builder().content(morphologyCompleteData).build();
5050
//The api object creates an http client, but to provide your own:
5151
//api.httpClient(CloseableHttpClient)
52-
MorphologyResponse response = rosetteApi.perform(MORPHOLOGY_SERVICE_PATH + "/" + MorphologicalFeature.COMPLETE, request, MorphologyResponse.class);
52+
MorphologyResponse response = api.perform(MORPHOLOGY_SERVICE_PATH + "/" + MorphologicalFeature.COMPLETE, request, MorphologyResponse.class);
5353
System.out.println(responseToJson(response));
5454
}
5555
}

0 commit comments

Comments
 (0)