Skip to content

Commit 9d7b6a8

Browse files
committed
fix white spaces
1 parent 877939b commit 9d7b6a8

File tree

1 file changed

+45
-45
lines changed
  • articles/cognitive-services/text-analytics/includes/quickstarts

1 file changed

+45
-45
lines changed

articles/cognitive-services/text-analytics/includes/quickstarts/java-sdk.md

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ Create a method to instantiate the `TextAnalyticsClient` object with the key and
9696

9797
```java
9898
static TextAnalyticsClient authenticateClient(String key, String endpoint) {
99-
return new TextAnalyticsClientBuilder()
100-
.credential(new AzureKeyCredential(key))
101-
.endpoint(endpoint)
102-
.buildClient();
99+
return new TextAnalyticsClientBuilder()
100+
.credential(new AzureKeyCredential(key))
101+
.endpoint(endpoint)
102+
.buildClient();
103103
}
104104
```
105105

@@ -130,8 +130,8 @@ static void sentimentAnalysisExample(TextAnalyticsClient client)
130130
sentenceSentiment.getConfidenceScores().getPositive(),
131131
sentenceSentiment.getConfidenceScores().getNeutral(),
132132
sentenceSentiment.getConfidenceScores().getNegative());
133+
}
133134
}
134-
}
135135
```
136136

137137
### Output
@@ -152,14 +152,14 @@ Create a new function called `detectLanguageExample()` that takes the client tha
152152
```java
153153
static void detectLanguageExample(TextAnalyticsClient client)
154154
{
155-
// The text that need be analyzed.
156-
String text = "Ce document est rédigé en Français.";
157-
158-
DetectedLanguage detectedLanguage = client.detectLanguage(text);
159-
System.out.printf("Detected primary language: %s, ISO 6391 name: %s, score: %.2f.%n",
160-
detectedLanguage.getName(),
161-
detectedLanguage.getIso6391Name(),
162-
detectedLanguage.getConfidenceScore());
155+
// The text that need be analyzed.
156+
String text = "Ce document est rédigé en Français.";
157+
158+
DetectedLanguage detectedLanguage = client.detectLanguage(text);
159+
System.out.printf("Detected primary language: %s, ISO 6391 name: %s, score: %.2f.%n",
160+
detectedLanguage.getName(),
161+
detectedLanguage.getIso6391Name(),
162+
detectedLanguage.getConfidenceScore());
163163
}
164164
```
165165

@@ -180,17 +180,17 @@ Create a new function called `recognizeEntitiesExample()` that takes the client
180180
```java
181181
static void recognizeEntitiesExample(TextAnalyticsClient client)
182182
{
183-
// The text that need be analyzed.
184-
String text = "I had a wonderful trip to Seattle last week.";
185-
186-
for (CategorizedEntity entity : client.recognizeEntities(text)) {
187-
System.out.printf(
188-
"Recognized entity: %s, entity category: %s, entity sub-category: %s, score: %s.%n",
189-
entity.getText(),
190-
entity.getCategory(),
191-
entity.getSubcategory(),
192-
entity.getConfidenceScore());
193-
}
183+
// The text that need be analyzed.
184+
String text = "I had a wonderful trip to Seattle last week.";
185+
186+
for (CategorizedEntity entity : client.recognizeEntities(text)) {
187+
System.out.printf(
188+
"Recognized entity: %s, entity category: %s, entity sub-category: %s, score: %s.%n",
189+
entity.getText(),
190+
entity.getCategory(),
191+
entity.getSubcategory(),
192+
entity.getConfidenceScore());
193+
}
194194
}
195195
```
196196

@@ -209,27 +209,27 @@ Create a new function called `recognizeLinkedEntitiesExample()` that takes the c
209209
```java
210210
static void recognizeLinkedEntitiesExample(TextAnalyticsClient client)
211211
{
212-
// The text that need be analyzed.
213-
String text = "Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975, " +
214-
"to develop and sell BASIC interpreters for the Altair 8800. " +
215-
"During his career at Microsoft, Gates held the positions of chairman, " +
216-
"chief executive officer, president and chief software architect, " +
217-
"while also being the largest individual shareholder until May 2014.";
218-
219-
System.out.printf("Linked Entities:%n");
220-
for (LinkedEntity linkedEntity : client.recognizeLinkedEntities(text)) {
221-
System.out.printf("Name: %s, ID: %s, URL: %s, Data Source: %s.%n",
222-
linkedEntity.getName(),
223-
linkedEntity.getDataSourceEntityId(),
224-
linkedEntity.getUrl(),
225-
linkedEntity.getDataSource());
226-
System.out.printf("Matches:%n");
227-
for (LinkedEntityMatch linkedEntityMatch : linkedEntity.getMatches()) {
228-
System.out.printf("Text: %s, Score: %.2f%n",
229-
linkedEntityMatch.getText(),
230-
linkedEntityMatch.getConfidenceScore());
231-
}
232-
}
212+
// The text that need be analyzed.
213+
String text = "Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975, " +
214+
"to develop and sell BASIC interpreters for the Altair 8800. " +
215+
"During his career at Microsoft, Gates held the positions of chairman, " +
216+
"chief executive officer, president and chief software architect, " +
217+
"while also being the largest individual shareholder until May 2014.";
218+
219+
System.out.printf("Linked Entities:%n");
220+
for (LinkedEntity linkedEntity : client.recognizeLinkedEntities(text)) {
221+
System.out.printf("Name: %s, ID: %s, URL: %s, Data Source: %s.%n",
222+
linkedEntity.getName(),
223+
linkedEntity.getDataSourceEntityId(),
224+
linkedEntity.getUrl(),
225+
linkedEntity.getDataSource());
226+
System.out.printf("Matches:%n");
227+
for (LinkedEntityMatch linkedEntityMatch : linkedEntity.getMatches()) {
228+
System.out.printf("Text: %s, Score: %.2f%n",
229+
linkedEntityMatch.getText(),
230+
linkedEntityMatch.getConfidenceScore());
231+
}
232+
}
233233
}
234234
```
235235

0 commit comments

Comments
 (0)