Skip to content

Commit 7d60f94

Browse files
committed
chore: Merge in master to resolve merge conflicts
2 parents 0399ee5 + 9c839e3 commit 7d60f94

File tree

3 files changed

+149
-4
lines changed

3 files changed

+149
-4
lines changed

IBM.Watson.sln

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,24 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.Watson.NaturalLanguageU
9595
EndProject
9696
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.Watson.ToneAnalyzer.v3.UnitTests", "test\ToneAnalyzer.v3.UnitTests\IBM.Watson.ToneAnalyzer.v3.UnitTests.csproj", "{28F5A68C-CF5B-4691-A5E5-9135C99470A0}"
9797
EndProject
98-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.Watson.Assistant.v2.Examples", "examples\IBM.Watson.Assistant.v2.Examples\IBM.Watson.Assistant.v2.Examples.csproj", "{4CFF70FE-F96E-46EE-B7FC-E06AEE4EE2AC}"
98+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBM.Watson.Assistant.v2.Examples", "examples\IBM.Watson.Assistant.v2.Examples\IBM.Watson.Assistant.v2.Examples.csproj", "{4CFF70FE-F96E-46EE-B7FC-E06AEE4EE2AC}"
9999
EndProject
100100
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.Watson.Assistant.v1.Examples", "examples\IBM.Watson.Assistant.v1.Examples\IBM.Watson.Assistant.v1.Examples.csproj", "{AE7F758A-A6FA-49E7-AD3C-52B784BEBA3F}"
101101
EndProject
102-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.Watson.CompareComply.v1.Examples", "examples\IBM.Watson.CompareComply.v1.Examples\IBM.Watson.CompareComply.v1.Examples.csproj", "{58A819F6-2F99-4A79-95ED-2DED2F9D5DB4}"
102+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBM.Watson.CompareComply.v1.Examples", "examples\IBM.Watson.CompareComply.v1.Examples\IBM.Watson.CompareComply.v1.Examples.csproj", "{58A819F6-2F99-4A79-95ED-2DED2F9D5DB4}"
103103
EndProject
104-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.Watson.Discovery.v1.Examples", "examples\IBM.Watson.Discovery.v1.Examples\IBM.Watson.Discovery.v1.Examples.csproj", "{D3FBC964-AF1B-4416-9FE8-8F0A511908D5}"
104+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBM.Watson.Discovery.v1.Examples", "examples\IBM.Watson.Discovery.v1.Examples\IBM.Watson.Discovery.v1.Examples.csproj", "{D3FBC964-AF1B-4416-9FE8-8F0A511908D5}"
105105
EndProject
106-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.Watson.LanguageTranslator.v3.Examples", "examples\IBM.Watson.LanguageTranslator.v3.Examples\IBM.Watson.LanguageTranslator.v3.Examples.csproj", "{03B2FA0D-14C8-485C-8EE8-16715871E813}"
106+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBM.Watson.LanguageTranslator.v3.Examples", "examples\IBM.Watson.LanguageTranslator.v3.Examples\IBM.Watson.LanguageTranslator.v3.Examples.csproj", "{03B2FA0D-14C8-485C-8EE8-16715871E813}"
107107
EndProject
108108
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.Watson.NaturalLangaugeClassifier.v1.Examples", "examples\IBM.Watson.NaturalLangaugeClassifier.v1.Examples\IBM.Watson.NaturalLangaugeClassifier.v1.Examples.csproj", "{B74E72B5-E2C9-43EE-88D2-34315AF3AD33}"
109109
EndProject
110110
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBM.Watson.SpeechToText.v1.Examples", "examples\IBM.Watson.SpeechToText.v1.Examples\IBM.Watson.SpeechToText.v1.Examples.csproj", "{7D175FD3-128F-48EE-9DBC-9B0D28109CB3}"
111111
EndProject
112112
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBM.Watson.NaturalLanguageUnderstanding.v1.Examples", "examples\IBM.Watson.NaturalLanguageUnderstanding.v1.Examples\IBM.Watson.NaturalLanguageUnderstanding.v1.Examples.csproj", "{0D0A16C3-CCBD-4072-BA81-40E015F0A062}"
113113
EndProject
114+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBM.Watson.PersonalityInsights.v3.Examples", "examples\IBM.Watson.PersonalityInsights.v3.Examples\IBM.Watson.PersonalityInsights.v3.Examples.csproj", "{E28E9097-E145-4E36-A762-A55E25686945}"
115+
EndProject
114116
Global
115117
GlobalSection(SolutionConfigurationPlatforms) = preSolution
116118
Debug|Any CPU = Debug|Any CPU
@@ -277,6 +279,10 @@ Global
277279
{0D0A16C3-CCBD-4072-BA81-40E015F0A062}.Debug|Any CPU.Build.0 = Debug|Any CPU
278280
{0D0A16C3-CCBD-4072-BA81-40E015F0A062}.Release|Any CPU.ActiveCfg = Release|Any CPU
279281
{0D0A16C3-CCBD-4072-BA81-40E015F0A062}.Release|Any CPU.Build.0 = Release|Any CPU
282+
{E28E9097-E145-4E36-A762-A55E25686945}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
283+
{E28E9097-E145-4E36-A762-A55E25686945}.Debug|Any CPU.Build.0 = Debug|Any CPU
284+
{E28E9097-E145-4E36-A762-A55E25686945}.Release|Any CPU.ActiveCfg = Release|Any CPU
285+
{E28E9097-E145-4E36-A762-A55E25686945}.Release|Any CPU.Build.0 = Release|Any CPU
280286
{7D175FD3-128F-48EE-9DBC-9B0D28109CB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
281287
{7D175FD3-128F-48EE-9DBC-9B0D28109CB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
282288
{7D175FD3-128F-48EE-9DBC-9B0D28109CB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -325,6 +331,7 @@ Global
325331
{03B2FA0D-14C8-485C-8EE8-16715871E813} = {65D78D49-E54F-4952-A1D4-7C8D0EDAA1B3}
326332
{B74E72B5-E2C9-43EE-88D2-34315AF3AD33} = {5917402E-D9A2-4308-8A1A-9C0692939420}
327333
{0D0A16C3-CCBD-4072-BA81-40E015F0A062} = {89D715BF-7464-45FB-8DA0-9D7B46AB8C7F}
334+
{E28E9097-E145-4E36-A762-A55E25686945} = {D65AC99F-4E63-4362-8765-EB6F15838CA0}
328335
{7D175FD3-128F-48EE-9DBC-9B0D28109CB3} = {254924C9-64CD-4902-97C4-5F9E48DCDF7F}
329336
EndGlobalSection
330337
GlobalSection(ExtensibilityGlobals) = postSolution
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp2.1</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="IBM.Cloud.SDK.Core" Version="0.7.1" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<ProjectReference Include="..\..\src\IBM.Watson.PersonalityInsights.v3\IBM.Watson.PersonalityInsights.v3.csproj" />
14+
</ItemGroup>
15+
16+
</Project>
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/**
2+
* Copyright 2019 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
using IBM.Cloud.SDK.Core.Util;
19+
using IBM.Watson.PersonalityInsights.v3.Model;
20+
using System;
21+
using System.Collections.Generic;
22+
using System.IO;
23+
24+
namespace IBM.Watson.PersonalityInsights.v3.Examples
25+
{
26+
public class ServiceExample
27+
{
28+
string apikey = "{apikey}";
29+
string url = "{url}";
30+
string versionDate = "{versionDate}";
31+
32+
string contentToProfile = "The IBM Watson™ Personality Insights service provides a Representational State Transfer (REST) Application Programming Interface (API) that enables applications to derive insights from social media, enterprise data, or other digital communications. The service uses linguistic analytics to infer individuals' intrinsic personality characteristics, including Big Five, Needs, and Values, from digital communications such as email, text messages, tweets, and forum posts. The service can automatically infer, from potentially noisy social media, portraits of individuals that reflect their personality characteristics. The service can report consumption preferences based on the results of its analysis, and for JSON content that is timestamped, it can report temporal behavior.";
33+
34+
static void Main(string[] args)
35+
{
36+
ServiceExample example = new ServiceExample();
37+
38+
example.Profile();
39+
example.ProfileAsCsv();
40+
41+
Console.WriteLine("Examples complete. Press any key to close the application.");
42+
Console.ReadKey();
43+
}
44+
45+
#region Profile
46+
public void Profile()
47+
{
48+
TokenOptions tokenOptions = new TokenOptions()
49+
{
50+
IamApiKey = apikey,
51+
ServiceUrl = url
52+
};
53+
54+
PersonalityInsightsService service = new PersonalityInsightsService(tokenOptions, versionDate);
55+
56+
Content content = new Content()
57+
{
58+
ContentItems = new List<ContentItem>()
59+
{
60+
new ContentItem()
61+
{
62+
Contenttype = ContentItem.ContenttypeEnumValue.TEXT_PLAIN,
63+
Language = ContentItem.LanguageEnumValue.EN,
64+
Content = contentToProfile
65+
}
66+
}
67+
};
68+
69+
var result = service.Profile(
70+
content: content,
71+
contentType: "text/plain",
72+
contentLanguage: "en",
73+
acceptLanguage: "en",
74+
rawScores: true,
75+
consumptionPreferences: true,
76+
csvHeaders: true
77+
);
78+
79+
Console.WriteLine(result.Response);
80+
}
81+
82+
public void ProfileAsCsv()
83+
{
84+
TokenOptions tokenOptions = new TokenOptions()
85+
{
86+
IamApiKey = apikey,
87+
ServiceUrl = url
88+
};
89+
90+
PersonalityInsightsService service = new PersonalityInsightsService(tokenOptions, versionDate);
91+
92+
Content content = new Content()
93+
{
94+
ContentItems = new List<ContentItem>()
95+
{
96+
new ContentItem()
97+
{
98+
Contenttype = ContentItem.ContenttypeEnumValue.TEXT_PLAIN,
99+
Language = ContentItem.LanguageEnumValue.EN,
100+
Content = contentToProfile
101+
}
102+
}
103+
};
104+
105+
var result = service.ProfileAsCsv(
106+
content: content,
107+
contentLanguage: "en",
108+
acceptLanguage: "en",
109+
rawScores: true,
110+
csvHeaders: true,
111+
consumptionPreferences: true,
112+
contentType: "text/plain"
113+
);
114+
115+
StreamReader reader = new StreamReader(result.Result);
116+
var text = reader.ReadToEnd();
117+
118+
Console.WriteLine(text);
119+
}
120+
#endregion
121+
}
122+
}

0 commit comments

Comments
 (0)