From 46852662a0cffe8748361648ebefb39c4ac77cbc Mon Sep 17 00:00:00 2001 From: Adrien Ball Date: Thu, 22 Feb 2018 10:16:32 +0100 Subject: [PATCH 01/10] Remove virtualenv installation in travis CI --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f03477c..71c11a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,7 +47,6 @@ before_install: | ;; esac pyenv rehash - python -m pip install --user virtualenv # A manual check that the correct version of Python is running. python --version @@ -57,4 +56,4 @@ install: - ./.travis/install.sh script: - - ./.travis/test.sh \ No newline at end of file + - ./.travis/test.sh From 08037efdbc279f41eb94656874a91e79a5596c83 Mon Sep 17 00:00:00 2001 From: Adrien Ball Date: Fri, 23 Feb 2018 19:14:01 +0100 Subject: [PATCH 02/10] Add badges --- README.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.rst b/README.rst index 1b256ae..a280fcc 100644 --- a/README.rst +++ b/README.rst @@ -4,6 +4,12 @@ Snips NLU Utils .. image:: https://travis-ci.org/snipsco/snips-nlu-utils.svg?branch=master :target: https://travis-ci.org/snipsco/snips-nlu-utils +.. image:: https://img.shields.io/pypi/v/snips-nlu-utils.svg?branch=master + :target: https://pypi.python.org/pypi/snips-nlu-utils + +.. image:: https://img.shields.io/pypi/pyversions/snips-nlu-utils.svg?branch=master + :target: https://pypi.python.org/pypi/snips-nlu-utils + Rust library for NLU utils with wrappers in other languages. Python wrapper From ba55091170c68c1d27d24d9cf05b30eed71ef171 Mon Sep 17 00:00:00 2001 From: Adrien Ball Date: Fri, 23 Feb 2018 19:18:26 +0100 Subject: [PATCH 03/10] Update badges --- README.rst | 5 ----- python/README.rst | 10 ++++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index a280fcc..5bcad9d 100644 --- a/README.rst +++ b/README.rst @@ -4,11 +4,6 @@ Snips NLU Utils .. image:: https://travis-ci.org/snipsco/snips-nlu-utils.svg?branch=master :target: https://travis-ci.org/snipsco/snips-nlu-utils -.. image:: https://img.shields.io/pypi/v/snips-nlu-utils.svg?branch=master - :target: https://pypi.python.org/pypi/snips-nlu-utils - -.. image:: https://img.shields.io/pypi/pyversions/snips-nlu-utils.svg?branch=master - :target: https://pypi.python.org/pypi/snips-nlu-utils Rust library for NLU utils with wrappers in other languages. diff --git a/python/README.rst b/python/README.rst index d16ae7a..ad85b03 100644 --- a/python/README.rst +++ b/python/README.rst @@ -1,6 +1,16 @@ Snips NLU utils Python wrapper ============================== +.. image:: https://travis-ci.org/snipsco/snips-nlu-utils.svg?branch=master + :target: https://travis-ci.org/snipsco/snips-nlu-utils + +.. image:: https://img.shields.io/pypi/v/snips-nlu-utils.svg?branch=master + :target: https://pypi.python.org/pypi/snips-nlu-utils + +.. image:: https://img.shields.io/pypi/pyversions/snips-nlu-utils.svg?branch=master + :target: https://pypi.python.org/pypi/snips-nlu-utils + + This library is a wrapper of a Rust NLU utils library, which is used by Snips NLU Installation From 320e132f0eeff3fcd236f9d65fe11d14ef0519eb Mon Sep 17 00:00:00 2001 From: Adrien Ball Date: Fri, 2 Mar 2018 14:57:01 +0100 Subject: [PATCH 04/10] Remove useless brew installs --- .travis.yml | 5 ----- .travis/test.sh | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 71c11a5..36d5052 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,11 +25,6 @@ before_install: | # Install Rust curl https://sh.rustup.rs -sSf | bash -s -- -y if [ "$TRAVIS_OS_NAME" == "osx" ]; then - brew update || brew update - - brew outdated openssl || brew upgrade openssl - brew install openssl@1.1 - # install pyenv git clone --depth 1 https://github.com/pyenv/pyenv ~/.pyenv PYENV_ROOT="$HOME/.pyenv" diff --git a/.travis/test.sh b/.travis/test.sh index 383598c..f3bc123 100755 --- a/.travis/test.sh +++ b/.travis/test.sh @@ -9,4 +9,4 @@ echo "Python tests..." perl -p -i -e "s/^snips-nlu-utils = .*\$/snips-nlu-utils = { path = \"..\/..\" \}/g" */**/Cargo.toml cd python python -m pip install tox -tox || die "Python tests failed" \ No newline at end of file +tox || die "Python tests failed" From dead9629cb4e7ec787fc1d748a64a9046f9e56b6 Mon Sep 17 00:00:00 2001 From: Adrien Ball Date: Fri, 13 Apr 2018 14:51:03 +0200 Subject: [PATCH 05/10] Add get_shape function --- python/snips_nlu_utils/__init__.py | 5 +- .../snips_nlu_utils/tests/test_nlu_utils.py | 42 +++++++++++++-- python/snips_nlu_utils_py/src/lib.rs | 3 +- python/snips_nlu_utils_py/src/string.rs | 5 ++ src/string.rs | 51 +++++++++++++++++++ 5 files changed, 99 insertions(+), 7 deletions(-) diff --git a/python/snips_nlu_utils/__init__.py b/python/snips_nlu_utils/__init__.py index 3ba2cf1..93cefab 100644 --- a/python/snips_nlu_utils/__init__.py +++ b/python/snips_nlu_utils/__init__.py @@ -1,2 +1,3 @@ -from ._snips_nlu_utils_py import (tokenize, tokenize_light, compute_all_ngrams, - normalize, remove_diacritics) \ No newline at end of file +from ._snips_nlu_utils_py import ( + get_shape, tokenize, tokenize_light, compute_all_ngrams,normalize, + remove_diacritics) diff --git a/python/snips_nlu_utils/tests/test_nlu_utils.py b/python/snips_nlu_utils/tests/test_nlu_utils.py index 1589805..7841ed2 100644 --- a/python/snips_nlu_utils/tests/test_nlu_utils.py +++ b/python/snips_nlu_utils/tests/test_nlu_utils.py @@ -1,14 +1,15 @@ from __future__ import unicode_literals import unittest - from builtins import str, bytes -from snips_nlu_utils import tokenize, tokenize_light +from snips_nlu_utils import ( + compute_all_ngrams, get_shape, normalize, remove_diacritics, tokenize, + tokenize_light) class TestNLUUtils(unittest.TestCase): - def test_package_should_tokenize(self): + def test_should_tokenize(self): # Given u = "let's eat food tonight" language = "en" @@ -20,7 +21,7 @@ def test_package_should_tokenize(self): self.assertGreater(len(tokens), 0) self.assertTrue(all(isinstance(t, dict) for t in tokens)) - def test_package_should_tokenize_light(self): + def test_should_tokenize_light(self): # Given u = "let's eat food tonight" language = "en" @@ -49,3 +50,36 @@ def test_tokenize_light_should_raise_on_string(self): # When / Then with self.assertRaises(TypeError): tokenize_light(s, language) + + def test_should_remove_diacritics(self): + self.assertEqual("Hello", remove_diacritics("Hëllo")) + + def test_should_normalize(self): + self.assertEqual("hello", normalize("Hëllo")) + + def test_should_compute_all_ngrams(self): + # Given + tokens = ["hello", "beautiful", "world", "!"] + + # When + ngrams = compute_all_ngrams(tokens, 3) + + # Then + expected_ngrams = [ + {'ngram': 'hello', 'token_indexes': [0]}, + {'ngram': 'hello beautiful', 'token_indexes': [0, 1]}, + {'ngram': 'hello beautiful world', 'token_indexes': [0, 1, 2]}, + {'ngram': 'beautiful', 'token_indexes': [1]}, + {'ngram': 'beautiful world', 'token_indexes': [1, 2]}, + {'ngram': 'beautiful world !', 'token_indexes': [1, 2, 3]}, + {'ngram': 'world', 'token_indexes': [2]}, + {'ngram': 'world !', 'token_indexes': [2, 3]}, + {'ngram': '!', 'token_indexes': [3]} + ] + self.assertListEqual(expected_ngrams, ngrams) + + def test_should_get_shape(self): + self.assertEqual("xxx", get_shape("hello")) + self.assertEqual("XXX", get_shape("HELLO")) + self.assertEqual("Xxx", get_shape("Hello")) + self.assertEqual("xX", get_shape("hEllo")) diff --git a/python/snips_nlu_utils_py/src/lib.rs b/python/snips_nlu_utils_py/src/lib.rs index a7f0fea..8663e3e 100644 --- a/python/snips_nlu_utils_py/src/lib.rs +++ b/python/snips_nlu_utils_py/src/lib.rs @@ -7,7 +7,7 @@ pub mod string; mod binding_utils; use cpython::{PyList, PyUnicode}; -use string::{normalize, remove_diacritics}; +use string::{get_shape, normalize, remove_diacritics}; use token::{tokenize, tokenize_light, compute_all_ngrams}; py_module_initializer!(_snips_nlu_utils_py, init_snips_nlu_utils_py, PyInit__snips_nlu_utils_py, |py, m| { @@ -16,5 +16,6 @@ py_module_initializer!(_snips_nlu_utils_py, init_snips_nlu_utils_py, PyInit__sni m.add(py, "compute_all_ngrams", py_fn!(py, compute_all_ngrams(tokens: PyList, max_ngram_size: i32)))?; m.add(py, "normalize", py_fn!(py, normalize(string: PyUnicode)))?; m.add(py, "remove_diacritics", py_fn!(py, remove_diacritics(string: PyUnicode)))?; + m.add(py, "get_shape", py_fn!(py, get_shape(string: PyUnicode)))?; Ok(()) }); diff --git a/python/snips_nlu_utils_py/src/string.rs b/python/snips_nlu_utils_py/src/string.rs index 09b17b9..fdb51d7 100644 --- a/python/snips_nlu_utils_py/src/string.rs +++ b/python/snips_nlu_utils_py/src/string.rs @@ -12,3 +12,8 @@ pub fn remove_diacritics(py: Python, string: PyUnicode) -> PyResult { let string_without_diacritics = string_utils::remove_diacritics(string.to_string(py)?.borrow()); return Ok(PyUnicode::new(py, &string_without_diacritics.to_string())); } + +pub fn get_shape(py: Python, string: PyUnicode) -> PyResult { + let shape = string_utils::get_shape(string.to_string(py)?.borrow()); + return Ok(PyUnicode::new(py, &shape.to_string())) +} diff --git a/src/string.rs b/src/string.rs index 3e87830..25e4222 100644 --- a/src/string.rs +++ b/src/string.rs @@ -103,6 +103,48 @@ fn remove_combination_marks(character: char) -> Option { }) } + +/// Get the shape of the string in one of the following format: +/// +/// - "xxx" -> lowercase +/// - "XXX" -> uppercase +/// - "Xxx" -> title case +/// - "xX" -> mixed case +/// +/// # Examples +/// +/// ``` +/// use snips_nlu_utils::string::get_shape; +/// +/// assert_eq!("xxx", get_shape("hello")); +/// assert_eq!("Xxx", get_shape("Hello")); +/// assert_eq!("XXX", get_shape("HELLO")); +/// assert_eq!("xX", get_shape("hEllo")); +/// ``` +pub fn get_shape(string: &str) -> &'static str { + if string.chars().all(char::is_lowercase) { + "xxx" + } else if string.chars().all(char::is_uppercase) { + "XXX" + } else if is_title_case(string) { + "Xxx" + } else { + "xX" + } +} + +fn is_title_case(string: &str) -> bool { + let mut first = true; + for c in string.chars() { + match (first, c.is_uppercase()) { + (true, true) => first = false, + (false, false) => continue, + _ => return false, + } + } + !first +} + #[cfg(test)] mod tests { use super::*; @@ -161,4 +203,13 @@ mod tests { fn normalize_works() { assert_eq!("heloa".to_string(), normalize(" HelöÀ ")); } + + #[test] + fn shape_works() { + assert_eq!("xxx", get_shape("hello")); + assert_eq!("xxx", get_shape("hëllo")); + assert_eq!("Xxx", get_shape("Hello")); + assert_eq!("XXX", get_shape("HELLO")); + assert_eq!("xX", get_shape("hEllo")); + } } From 31be7714b8d2eebaab14ece137220f5afbcd2b20 Mon Sep 17 00:00:00 2001 From: Adrien Ball Date: Fri, 13 Apr 2018 15:14:01 +0200 Subject: [PATCH 06/10] Improve update_version script and set version to 0.7.0-SNAPSHOT --- Cargo.toml | 2 +- python/snips_nlu_utils/__version__ | 2 +- python/snips_nlu_utils_py/Cargo.toml | 4 ++-- update_version.sh | 13 ++++++++++--- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 468bdf0..a4c5773 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snips-nlu-utils" -version = "0.6.0" +version = "0.7.0-SNAPSHOT" authors = ["Adrien Ball "] [dependencies] diff --git a/python/snips_nlu_utils/__version__ b/python/snips_nlu_utils/__version__ index a918a2a..978ba2b 100644 --- a/python/snips_nlu_utils/__version__ +++ b/python/snips_nlu_utils/__version__ @@ -1 +1 @@ -0.6.0 +0.7.0-SNAPSHOT diff --git a/python/snips_nlu_utils_py/Cargo.toml b/python/snips_nlu_utils_py/Cargo.toml index 0da4a1d..d3a4465 100644 --- a/python/snips_nlu_utils_py/Cargo.toml +++ b/python/snips_nlu_utils_py/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snips-nlu-utils-py" -version = "0.6.0" +version = "0.7.0-SNAPSHOT" authors = ["Adrien Ball "] [lib] @@ -8,5 +8,5 @@ name = "_snips_nlu_utils_py" crate-type = ["cdylib"] [dependencies] -snips-nlu-utils = { git = "https://github.com/snipsco/snips-nlu-utils", tag = "0.6.0" } +snips-nlu-utils = { path = "../.." } cpython = { version="0.1", default-features=false } diff --git a/update_version.sh b/update_version.sh index a4b264a..7d32c11 100755 --- a/update_version.sh +++ b/update_version.sh @@ -1,8 +1,15 @@ #!/usr/bin/env bash -source ./.travis/common.sh -NEW_VERSION=$(parseRustVersion) +NEW_VERSION=${1?"usage $0 "} + echo "Updating versions to version ${NEW_VERSION}" +perl -p -i -e "s/^version = \".*\"\$/version = \"$NEW_VERSION\"/g" Cargo.toml perl -p -i -e "s/^version = \".*\"\$/version = \"$NEW_VERSION\"/g" */**/Cargo.toml -perl -p -i -e "s/https:\/\/github\.com\/snipsco\/snips-nlu-utils\", tag = \".*\"/https:\/\/github\.com\/snipsco\/snips-nlu-utils\", tag = \"$NEW_VERSION\"/g" */**/Cargo.toml echo "$NEW_VERSION" > python/snips_nlu_utils/__version__ + +if [[ "${NEW_VERSION}" == "${NEW_VERSION/-SNAPSHOT/}" ]] +then + perl -p -i -e "s/^snips-nlu-utils = .*\$/snips-nlu-utils = { git = \"https:\/\/github.com\/snipsco\/snips-nlu-utils\", tag = \"${NEW_VERSION}\" }/g" */**/Cargo.toml +else + perl -p -i -e "s/^snips-nlu-utils = .*\$/snips-nlu-utils = { path = \"..\/..\" \}/g" */**/Cargo.toml +fi From 6f44ba29c6a59a509aeafd08357498b71b216e48 Mon Sep 17 00:00:00 2001 From: Adrien Ball Date: Fri, 13 Apr 2018 15:17:11 +0200 Subject: [PATCH 07/10] Improve CI scripts --- .travis.yml | 45 +++++++++++---------------------------- .travis/before_install.sh | 29 +++++++++++++++++++++++++ .travis/common.sh | 12 ----------- .travis/install.sh | 8 ------- .travis/test.sh | 19 +++++++++++------ 5 files changed, 54 insertions(+), 59 deletions(-) create mode 100644 .travis/before_install.sh delete mode 100755 .travis/install.sh diff --git a/.travis.yml b/.travis.yml index 36d5052..d893d63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,3 @@ -language: python - matrix: include: - os: osx @@ -7,48 +5,31 @@ matrix: language: generic env: - TOXENV=py27 + - PYTHON_TESTS=true - os: osx osx_image: xcode8 language: generic env: - TOXENV=py36 + - PYTHON_TESTS=true - os: linux + language: python python: 2.7 env: - TOXENV=py27 + - PYTHON_TESTS=true - os: linux + language: python python: 3.6 env: - TOXENV=py36 + - PYTHON_TESTS=true + - os: linux + language: rust + rust: stable + env: + - RUST_TESTS=true -before_install: | - # Install Rust - curl https://sh.rustup.rs -sSf | bash -s -- -y - if [ "$TRAVIS_OS_NAME" == "osx" ]; then - # install pyenv - git clone --depth 1 https://github.com/pyenv/pyenv ~/.pyenv - PYENV_ROOT="$HOME/.pyenv" - PATH="$PYENV_ROOT/bin:$PATH" - eval "$(pyenv init -)" - - case "${TOXENV}" in - py27) - curl -O https://bootstrap.pypa.io/get-pip.py - python get-pip.py --user - ;; - py36) - pyenv install 3.6.1 - pyenv global 3.6.1 - ;; - esac - pyenv rehash - - # A manual check that the correct version of Python is running. - python --version - fi - -install: - - ./.travis/install.sh +before_install: . ./.travis/before_install.sh -script: - - ./.travis/test.sh +script: ./.travis/test.sh diff --git a/.travis/before_install.sh b/.travis/before_install.sh new file mode 100644 index 0000000..8318861 --- /dev/null +++ b/.travis/before_install.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# Install Rust +if [ -z ${TRAVIS_RUST_VERSION+w} ]; then + curl https://sh.rustup.rs -sSf | bash -s -- -y +fi + +if [ $TRAVIS_OS_NAME == "osx" ] && [ $PYTHON_TESTS == "true" ]; then + # install pyenv + git clone --depth 1 https://github.com/pyenv/pyenv ~/.pyenv + PYENV_ROOT="$HOME/.pyenv" + PATH="$PYENV_ROOT/bin:$PATH" + eval "$(pyenv init -)" + + case "${TOXENV}" in + "py27") + pyenv install 2.7.14 + pyenv global 2.7.14 + ;; + "py36") + pyenv install 3.6.1 + pyenv global 3.6.1 + ;; + esac + pyenv rehash + + # A manual check that the correct version of Python is running. + python --version +fi diff --git a/.travis/common.sh b/.travis/common.sh index 27e5f79..e9280ae 100644 --- a/.travis/common.sh +++ b/.travis/common.sh @@ -16,15 +16,3 @@ has() { local item=$1; shift echo " $@ " | grep -q " $(escape $item) " } - -parseRustVersion() { - grep -w Cargo.toml -e '^version = ".*' | sed -- 's/version = "//g' | sed -- 's/"//g' -} - -updateVersions() { - local tagVersion=$1 - echo "Updating version..." - ./update_version.sh ${tagVersion} || die "Could not upload version" -} - -TAG_VERSION=$(parseRustVersion) \ No newline at end of file diff --git a/.travis/install.sh b/.travis/install.sh deleted file mode 100755 index 6818ff4..0000000 --- a/.travis/install.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -source .travis/common.sh - -echo "Rust build" - -export PATH="/usr/local/bin:$HOME/.cargo/bin:$PATH" - -cargo build --all || die "Rust build failed" diff --git a/.travis/test.sh b/.travis/test.sh index f3bc123..eb55b70 100755 --- a/.travis/test.sh +++ b/.travis/test.sh @@ -1,12 +1,17 @@ #!/usr/bin/env bash source .travis/common.sh -echo "Rust tests..." export PATH="/usr/local/bin:$HOME/.cargo/bin:$PATH" -cargo test --all || die "Rust tests failed" -echo "Python tests..." -perl -p -i -e "s/^snips-nlu-utils = .*\$/snips-nlu-utils = { path = \"..\/..\" \}/g" */**/Cargo.toml -cd python -python -m pip install tox -tox || die "Python tests failed" +if [ "${RUST_TESTS}" == "true" ]; then + echo "Rust tests..." + cargo test --all || die "Rust tests failed" +fi + +if [ "${PYTHON_TESTS}" == "true" ]; then + echo "Python tests..." + cd python + python -m pip install tox + tox || die "Python tests failed" + cd .. +fi From 6df32601f81d1128f86c5c386e85f3261e6138a5 Mon Sep 17 00:00:00 2001 From: Adrien Ball Date: Fri, 13 Apr 2018 15:22:00 +0200 Subject: [PATCH 08/10] Fix encoding issue --- python/snips_nlu_utils/tests/test_nlu_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/snips_nlu_utils/tests/test_nlu_utils.py b/python/snips_nlu_utils/tests/test_nlu_utils.py index 7841ed2..6636717 100644 --- a/python/snips_nlu_utils/tests/test_nlu_utils.py +++ b/python/snips_nlu_utils/tests/test_nlu_utils.py @@ -1,3 +1,4 @@ +# coding=utf-8 from __future__ import unicode_literals import unittest From 6ef85de2d9fb5a1b6e53a87cf9a7922b7897fdb2 Mon Sep 17 00:00:00 2001 From: Adrien Ball Date: Fri, 13 Apr 2018 15:33:53 +0200 Subject: [PATCH 09/10] Bump version to 0.6.1 --- Cargo.toml | 2 +- python/snips_nlu_utils/__version__ | 2 +- python/snips_nlu_utils_py/Cargo.toml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a4c5773..9262a5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snips-nlu-utils" -version = "0.7.0-SNAPSHOT" +version = "0.6.1" authors = ["Adrien Ball "] [dependencies] diff --git a/python/snips_nlu_utils/__version__ b/python/snips_nlu_utils/__version__ index 978ba2b..ee6cdce 100644 --- a/python/snips_nlu_utils/__version__ +++ b/python/snips_nlu_utils/__version__ @@ -1 +1 @@ -0.7.0-SNAPSHOT +0.6.1 diff --git a/python/snips_nlu_utils_py/Cargo.toml b/python/snips_nlu_utils_py/Cargo.toml index d3a4465..807bb26 100644 --- a/python/snips_nlu_utils_py/Cargo.toml +++ b/python/snips_nlu_utils_py/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snips-nlu-utils-py" -version = "0.7.0-SNAPSHOT" +version = "0.6.1" authors = ["Adrien Ball "] [lib] @@ -8,5 +8,5 @@ name = "_snips_nlu_utils_py" crate-type = ["cdylib"] [dependencies] -snips-nlu-utils = { path = "../.." } +snips-nlu-utils = { git = "https://github.com/snipsco/snips-nlu-utils", tag = "0.6.1" } cpython = { version="0.1", default-features=false } From 12e000af12ba694430939d485ddca736cf3a7afc Mon Sep 17 00:00:00 2001 From: Adrien Ball Date: Fri, 13 Apr 2018 15:38:07 +0200 Subject: [PATCH 10/10] Add CHANGELOG and update README --- .travis/test.sh | 1 + CHANGELOG.md | 9 +++++++++ README.rst | 16 +++++++++++++--- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.travis/test.sh b/.travis/test.sh index eb55b70..9679180 100755 --- a/.travis/test.sh +++ b/.travis/test.sh @@ -2,6 +2,7 @@ source .travis/common.sh export PATH="/usr/local/bin:$HOME/.cargo/bin:$PATH" +perl -p -i -e "s/^snips-nlu-utils = .*\$/snips-nlu-utils = { path = \"..\/..\" \}/g" */**/Cargo.toml if [ "${RUST_TESTS}" == "true" ]; then echo "Rust tests..." diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c31a17a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog +All notable changes to this project will be documented in this file. + +## [0.6.1] - 2018-04-13 + +### Added +- Add `get_shape` function + +[0.6.1]: https://github.com/snipsco/snips-nlu-utils/compare/0.6.0...0.6.1 diff --git a/README.rst b/README.rst index 5bcad9d..d934126 100644 --- a/README.rst +++ b/README.rst @@ -7,9 +7,19 @@ Snips NLU Utils Rust library for NLU utils with wrappers in other languages. +Installation +------------ + +Add it to your ``Cargo.toml``: + +.. code-block:: toml + + [dependencies] + snips-nlu-utils = { git = "https://github.com/snipsco/snips-nlu-utils", branch = "master" } + +Add ``extern crate snips_nlu_utils`` to your crate root and you are good to go! + Python wrapper -------------- -See the `README`_ of the python wrapper for installation instruction. - -.. _README: https://github.com/snipsco/snips-nlu-utils/blob/master/python/README.rst \ No newline at end of file +See the `README `_ of the python wrapper for installation instruction.