Skip to content

Commit c3053db

Browse files
committed
Merge branch 'develop'
2 parents 7a3f8b5 + 3ce3a6e commit c3053db

File tree

11 files changed

+230
-63
lines changed

11 files changed

+230
-63
lines changed

CI.Jenkinsfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
def versions = [3.7, 3.8, 3.9, 3.10, 3.11]
3+
def versions = [3.8, 3.9, 3.10, 3.11, 3.12]
44

55
def runSonnarForPythonVersion(sourceDir, ver){
66
mySonarOpts="-Dsonar.sources=/source -Dsonar.host.url=${env.SONAR_HOST_URL} -Dsonar.login=${env.SONAR_AUTH_TOKEN}"
@@ -14,12 +14,13 @@ def runSonnarForPythonVersion(sourceDir, ver){
1414
}
1515

1616
// Only run Sonar once.
17-
if(ver == 3.11) {
17+
// Check for new versions at https://binaries.sonarsource.com/?prefix=Distribution/sonar-scanner-cli/
18+
if(ver == 3.12) {
1819
sonarExec="cd /root/ && \
19-
wget -q https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856-linux.zip && \
20-
unzip -q sonar-scanner-cli-4.8.0.2856-linux.zip && \
20+
wget -q https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.1.3023-linux.zip && \
21+
unzip -q sonar-scanner-cli-4.8.1.3023-linux.zip && \
2122
cd /source && \
22-
/root/sonar-scanner-4.8.0.2856-linux/bin/sonar-scanner ${mySonarOpts}"
23+
/root/sonar-scanner-4.8.1.3023-linux/bin/sonar-scanner ${mySonarOpts}"
2324
} else {
2425
sonarExec="echo Skipping Sonar for this version."
2526
}
@@ -57,4 +58,4 @@ node ("docker-light") {
5758
currentBuild.result = "FAILED"
5859
throw e
5960
}
60-
}
61+
}

Jenkinsfile.examples

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@ node {
2121
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source ${TEST_CONTAINER}"
2222
}
2323
}
24-
slack(true)
24+
postToTeams(true)
2525
} catch (e) {
2626
currentBuild.result = "FAILED"
27-
slack(false)
27+
postToTeams(false)
2828
throw e
2929
}
3030
}
3131

32-
def slack(boolean success) {
32+
def postToTeams(boolean success) {
33+
def webhookUrl = "${env.TEAMS_PNC_JENKINS_WEBHOOK_URL}"
3334
def color = success ? "#00FF00" : "#FF0000"
3435
def status = success ? "SUCCESSFUL" : "FAILED"
35-
def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
36-
slackSend(color: color, channel: "#rapid", message: message)
37-
}
36+
def message = "*" + status + ":* '${env.JOB_NAME}' - [${env.BUILD_NUMBER}] - ${env.BUILD_URL}"
37+
office365ConnectorSend(webhookUrl: webhookUrl, color: color, message: message, status: status)
38+
}

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a href="https://www.rosette.com"><img src="https://s3.amazonaws.com/styleguide.basistech.com/logos/rosette-logo.png" width="181" height="47" /></a>
1+
<a href="https://www.babelstreet.com/rosette"><img src="https://s3.amazonaws.com/styleguide.basistech.com/logos/rosette-logo.png" width="181" height="47" /></a>
22

33
---
44

@@ -13,7 +13,6 @@ comparing the similarity of names, categorizing and adding linguistic tags to te
1313

1414
## Rosette API Access
1515
- Rosette Cloud [Sign Up](https://developer.rosette.com/signup)
16-
- Rosette Enterprise [Evaluation](https://www.rosette.com/product-eval/)
1716

1817
## Quick Start
1918

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
# built documents.
5656
#
5757
# The short X.Y version.
58-
version = '1.25.1'
58+
version = '1.28.0'
5959
# The full version, including alpha/beta/rc tags.
60-
release = '1.25.1'
60+
release = '1.28.0'
6161

6262
# The language for content autogenerated by Sphinx. Refer to documentation
6363
# for a list of supported languages.

examples/categories.py

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

1515
def run(key, alt_url='https://api.rosette.com/rest/v1/'):
1616
""" Run the example """
17-
categories_url_data = "https://rosette.com/about"
18-
url = categories_url_data
17+
categories_text_data = "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."
1918
# Create an API instance
2019
api = API(user_key=key, service_url=alt_url)
2120

@@ -29,8 +28,7 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
2928

3029
params = DocumentParameters()
3130

32-
# Use a URL to input data instead of a string
33-
params["contentUri"] = url
31+
params["content"] = categories_text_data
3432
try:
3533
return api.categories(params)
3634
except RosetteException as exception:

examples/events.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Example code to call Rosette API to get entities from a piece of text.
4+
"""
5+
6+
import argparse
7+
import json
8+
import os
9+
10+
from rosette.api import API, DocumentParameters, RosetteException
11+
12+
13+
def run(key, alt_url='https://api.rosette.com/rest/v1/'):
14+
""" Run the example """
15+
# Create an API instance
16+
api = API(user_key=key, service_url=alt_url)
17+
18+
events_text_data = "I am looking for flights to Super Bowl 2022 in Inglewood, LA."
19+
params = DocumentParameters()
20+
params["content"] = events_text_data
21+
22+
try:
23+
return api.events(params)
24+
except RosetteException as exception:
25+
print(exception)
26+
27+
PARSER = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
28+
description='Calls the ' +
29+
os.path.splitext(os.path.basename(__file__))[0] + ' endpoint')
30+
PARSER.add_argument('-k', '--key', help='Rosette API Key', required=True)
31+
PARSER.add_argument('-u', '--url', help="Alternative API URL",
32+
default='https://api.rosette.com/rest/v1/')
33+
34+
if __name__ == '__main__':
35+
ARGS = PARSER.parse_args()
36+
RESULT = run(ARGS.key, ARGS.url)
37+
print(RESULT)

examples/events_negation.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Example code to call Rosette API to get events, based on a set negation option, from a piece of text.
4+
"""
5+
6+
import argparse
7+
import json
8+
import os
9+
10+
from rosette.api import API, DocumentParameters, RosetteException
11+
12+
13+
def run(key, alt_url='https://api.rosette.com/rest/v1/'):
14+
""" Run the example """
15+
# Create an API instance
16+
api = API(user_key=key, service_url=alt_url)
17+
18+
# Double negative, meaning that the event should be skipped with "IGNORE" or "ONLY_NEGATIVE"
19+
# and recognized under "BOTH" or "ONLY_POSITIVE"
20+
events_text_data = "Sam didn't not take a flight to Boston."
21+
params = DocumentParameters()
22+
params["content"] = events_text_data
23+
api.set_option('negation', 'ONLY_POSITIVE')
24+
25+
26+
try:
27+
return api.events(params)
28+
except RosetteException as exception:
29+
print(exception)
30+
31+
PARSER = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
32+
description='Calls the ' +
33+
os.path.splitext(os.path.basename(__file__))[0] + ' endpoint')
34+
PARSER.add_argument('-k', '--key', help='Rosette API Key', required=True)
35+
PARSER.add_argument('-u', '--url', help="Alternative API URL",
36+
default='https://api.rosette.com/rest/v1/')
37+
38+
if __name__ == '__main__':
39+
ARGS = PARSER.parse_args()
40+
RESULT = run(ARGS.key, ARGS.url)
41+
print(RESULT)

rosette/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
limitations under the License.
1313
"""
1414

15-
__version__ = '1.25.1'
15+
__version__ = '1.28.0'

0 commit comments

Comments
 (0)