Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
language: csharp

install:
- nuget restore rosette_api.sln

script:
- xbuild /p:Configuration=Release rosette_api.sln
- mono ./packages/NUnit.Console.3.0.1/tools/nunit3-console.exe ./rosette_apiUnitTests/bin/Release/rosette_apiUnitTests.dll

notifications:
slack:
rooms:
- secure: 4FRaTAAiYyeUvgw2RhmblgbNiJO4wmd34OBgWcwURjP9oVmFfSwR9r1LNCdUGxrPOghexSY2DjXIuvIrfTfi/xYbhHb3Kw7PEAyB8IuBMlKtY4NSFou62S2VhYpxyg58T+C7P2zi0eDnDE06pwTCoGPaimxMZQY91yQ0yPYDPVXbwe5SjEgamzlwGBxlS/0A6w1iCPHg27/iO2hXtdW3oLS2I0F/Q8Q95RBkX9hpg6yqHlTV7jRbSqvQ9OFBqk/tXMHQvhoPDGgCgQDuykJuaAYx7g9d0YL0eEYYOh9B/TJ/kNOwdRFBu5kuQ2/nFS5Z0S3Y3UIhdYjUmm9gSMnwIbYnrW22EqDJLoT9Zi3Gv7Prg/8/fSkWsof7BJTMSuXUqO1AxDGKIxFv9uSF1daZoY+AC1ooU1xDu1nNvWVYPlkwEdDxxmHpFkGT3ESTZYccPovQl8Z5K0I1BBAVdJKDzm07lE6VHbxkKcvK6gG0TN3uLxnSlQtjkfJ+aVMq1kxeVsB9lEsKs9oezsKzzbftMm525aXPg+OAv+31CUFWxvT/p4ps8Q+AV6aZpoPHkpK8VryyNirUeZ/m4m4ebDHhD9vcN+JqE9gzshT+0U3g19SvLiUMQtbuZ2BUvrq2hh2LEGs03AFZaNg9AEUVA1PQRhV5NILyoS/lbiBYJPT39Sg=
# - secure: D4VxkkZlj7uaaFbqEBITkJCusVeii436N8X6GijuosUSaee9lqGYUF5ZS9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RqqQe77aDUj0dfD2R3Q61rX5OF/f++W0XtNwHQubzmj8HD/cFneShIQsbl9KgYXoR6HiXcbBiNdmmZjSrzkPYh7vlsujYrz6Cg2msKybWJ/FfOz0tS1cjlCtiCMOTExN6tEF8YCp9l+s+5RLe61pgFPy4Snr9pEjuTS5DYliTyZMY2ZZC1clBQtgE8E2qCG1QSzqnqqiGxj2K4zmLPpB4y1XpW8e3yk=

language: csharp
install:
- nuget restore rosette_api.sln
script:
- xbuild /p:Configuration=Release rosette_api.sln
- mono ./packages/NUnit.Console.3.0.1/tools/nunit3-console.exe ./rosette_apiUnitTests/bin/Release/rosette_apiUnitTests.dll
notifications:
slack:
secure: i8q0FGroh4HVOLtMHPvPSupJ9s7LQ7WDbI5VNBBH6C+wpmk3H1kmlAy7ZjlLXtc99QBKDu69gphQksZSzjvmvHUXiwt23faBsVKqOSb+QfdEajSNEEl8Ujkw38osd/tJdwPbABfM/RKKUx9E3NhK9WfsNUWZEDMnIdC4WoR9WvB8WltwKGwCpruQePp3MO8IltIfkajUTsabu5ezodjD1X6qojfD777g8ivLwJP/x9koIGIdfm2d1SKA+ywdgaZOZeAfCSe6ETLCfU6Wa4DHxe3COBwOM5fJ6C/aHPQn3tpbsfLGG5rsb+fNuyeMuhJUZi0/XOX3w4O3rQ502bvG1cSrfotbhldkeQKqIPW1vqpsF82/UFliKpGVAC0Y1h2DQ3YZWHEUqfsqPlZ3QuFrekesic3qUgO8TVTSLyzmhYbc8QHOQs8iXbbm3qoT+yTdkDvILubhXemZC8RXohsjbBPkRAMc8zcyR+gLN8mUrR6/gUzJ7JtMD9hoM+HLS7Vj0+iFJYwLNzrEFMebe54+fDcv/cKRwYQSI+UdABG2Dm31TK94NT6uCvY6rFC3PSU1at+ci23PgF41BzFLDK+9AWgsTgSspPUiyoMtI25BwBd0ryUUhqepKF9WJvX9jsJBopMd9Z60wVuIbUeRnOL4NMalNfu1FpcMH/s0K9c3+3M=
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ def slack(boolean success) {
def color = success ? "#00FF00" : "#FF0000"
def status = success ? "SUCCESSFUL" : "FAILED"
def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
slackSend(color: color, channel: "#rapid", message: message)
slackSend(color: color, channel: "#p-n-c_jenkins", message: message)
}
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
[![Build Status](https://travis-ci.org/rosette-api/csharp.svg?branch=master)](https://travis-ci.org/rosette-api/csharp) [![NuGet version](https://badge.fury.io/nu/rosette_api.svg)](https://badge.fury.io/nu/rosette_api)
<a href="https://www.rosette.com"><img src="https://s3.amazonaws.com/styleguide.basistech.com/logos/rosette-logo.png" width="181" height="47" /></a>

---

[![Build Status](https://travis-ci.org/rosette-api/csharp.svg?branch=master)](https://travis-ci.org/rosette-api/csharp)
[![NuGet version](https://badge.fury.io/nu/rosette_api.svg)](https://badge.fury.io/nu/rosette_api)

## Rosette API
The Rosette Text Analytics Platform uses natural language processing, statistical modeling, and machine learning to
Expand Down
2 changes: 1 addition & 1 deletion rosette_api/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net45" />
<package id="System.Net.Http" version="4.3.3" targetFramework="net45" />
<package id="System.Net.Http" version="4.3.4" targetFramework="net45" />
</packages>
91 changes: 68 additions & 23 deletions rosette_apiExamples/README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,80 @@
.Net(C#) Examples
=============================

## Endpoint Examples ##
## Endpoint Examples
These examples are scripts that can be run independently to demonstrate the Rosette API functionality.

Each example file demonstrates one of the capabilities of the Rosette Platform. Each example, when run, prints its output to the console.

Here are some methods for running the examples. Each example will also accept an optional `--url` parameter for
overriding the default URL.
Each example will also accept an optional, alternate url parameter for overriding the default URL.

A note on prerequisites. Rosette API only supports TLS 1.2 so ensure your toolchain also supports it.

Here are some methods for running the examples.

#### Latest Version on NuGet with Docker
- Clone the repository.
```
git clone git@github.com:rosette-api/csharp.git
cd csharp
```
- Launch a `mono` container.
```
docker run -it -v $(pwd):/csharp mono:6
```
- Install the package from NuGet
```
cd /csharp
nuget install rosette_api
```
- Copy the runtime binaries to the examples directory.
```
cp Newtonsoft.Json.10.0.2/lib/net45/Newtonsoft.Json.dll rosette_apiExamples/.
cp rosette_api.1.14.4/lib/net45/rosette_api.dll rosette_apiExamples/.
```
- Compile the example you'd like to execute. E.g. language.cs
```
cd rosette_apiExamples
csc language.cs /r:rosette_api.dll /r:System.Net.Http.dll /r:System.Web.Extensions.dll
```
- Run the compiled example against Rosette Cloud. In this example, your Cloud API key is stored in the environment variable `$API_KEY`.
```
mono language.exe $API_KEY
```

### Docker Mono image
- install Docker per your OS
- cd to the docker directory under the examples
- `[sudo] docker build -t basistech/mono:1.1 .`
- cd to the examples directory
- Run the example as `[sudo] docker run -e FILENAME=_example_.cs -e API_KEY=_your_api_key_ -v "full-path-to-examples-source:/source" basistech/mono:1.1`. This will compile and run the example using a Mono environment. If you would like to run against an alternate URL, add `-e ALT_URL=_alternate_url_` before the `-v`.
#### Latest Source with Docker
- Clone the repository.
```
git clone git@github.com:rosette-api/csharp.git
cd csharp
```
- Launch a `mono` container.
```
docker run -it -v $(pwd):/csharp mono:6
```
- Build the package from source.
```
cd /csharp
nuget restore rosette_api.sln
xbuild /p:Configuration=Release rosette_api.sln
```
- _Optional:_ Run the Unit Tests.
```
mono ./packages/NUnit.Console.3.0.1/tools/nunit3-console.exe ./rosette_apiUnitTests/bin/Release/rosette_apiUnitTests.dll
```
- Copy the runtime binaries to the examples directory.
```
cp packages/Newtonsoft.Json.10.0.3/lib/net45/Newtonsoft.Json.dll rosette_apiExamples/.
cp rosette_api/bin/Release/rosette_api.dll rosette_apiExamples/.
```
- Compile the example you'd like to execute. E.g. language.cs
```
cd rosette_apiExamples
csc language.cs /r:rosette_api.dll /r:System.Net.Http.dll /r:System.Web.Extensions.dll
```
- Run the compiled example against Rosette Cloud. In this example, your Cloud API key is stored in the environment variable `$API_KEY`.
```
mono language.exe $API_KEY
```

### Visual Studio
- If you are using Visual Studio, you can use the Nuget Package Manager. Search for rosette_api in the Online Packages and install.
- If you are using Nuget Command line: `nuget install rosette_api`
- If you are using Visual Studio, you can use the Nuget Package Manager. Search for `rosette_api` in the Online Packages and install.

You can now run your desired endpoint file to see it in action.

### Command line
- `nuget install rosette_api`
- copy the rosette_api.lib to the same directory as your examples (found in rosette_api.*/)
- Compile the file using `csc _endpoint_.cs /r:rosette_api.dll /r:System.Net.Http.dll /r:System.Web.Extensions.dll`. This will output an .exe file with the _endpoint_ name.

### Running the compiled example
- Run the file using `_endpoint_.exe your_api_key [alternate_url]`

16 changes: 0 additions & 16 deletions rosette_apiExamples/docker/Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions rosette_apiExamples/docker/README.md

This file was deleted.

118 changes: 0 additions & 118 deletions rosette_apiExamples/docker/compile-and-run.sh

This file was deleted.

2 changes: 1 addition & 1 deletion rosette_apiUnitTests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
<package id="NUnit3TestAdapter" version="3.9.0" targetFramework="net452" />
<package id="NUnitTestAdapter" version="2.1.1" targetFramework="net452" />
<package id="RichardSzalay.MockHttp" version="3.2.1" targetFramework="net452" />
<package id="System.Net.Http" version="4.3.3" targetFramework="net452" />
<package id="System.Net.Http" version="4.3.4" targetFramework="net452" />
</packages>