Skip to content

Commit

Permalink
Merge pull request #73 from snipsco/release/0.58.2
Browse files Browse the repository at this point in the history
Release 0.58.2
  • Loading branch information
adrienball authored Aug 21, 2018
2 parents 7cf77e0 + 48e019a commit 7ded572
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ matrix:
- rust: nightly
include:
- os: osx
osx_image: xcode9.3
language: generic
env:
- TOXENV=py27
- PYTHON_TESTS=true
- os: osx
osx_image: xcode9.3
language: generic
env:
- TOXENV=py36
Expand Down
3 changes: 2 additions & 1 deletion .travis/before_install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -ev

# Install Rust
if [ -z ${TRAVIS_RUST_VERSION+w} ]; then
Expand Down Expand Up @@ -29,7 +30,7 @@ if [ $TRAVIS_OS_NAME == "osx" ]; then
python --version
fi

if [ $IOS_SWIFT_TESTS == true ]; then
if [ "${IOS_SWIFT_TESTS}" == "true" ]; then
PATH="$HOME/.cargo/bin:$PATH"
rustup target install x86_64-apple-ios
fi
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

## [0.58.2] - 2018-08-21
### Changed
- Bump `snips-nlu-ontology` to `0.57.3`

## [0.58.1] - 2018-07-24
### Fixed
- Error when loading a `SnipsNluEngine` from zip data
Expand Down Expand Up @@ -83,6 +87,7 @@ being statically hardcoded, reducing the binary size by 31Mb.
- Rename python package to `snips_nlu_rust`


[0.58.2]: https://github.com/snipsco/snips-nlu-rs/compare/0.58.1...0.58.2
[0.58.1]: https://github.com/snipsco/snips-nlu-rs/compare/0.58.0...0.58.1
[0.58.0]: https://github.com/snipsco/snips-nlu-rs/compare/0.57.2...0.58.0
[0.57.2]: https://github.com/snipsco/snips-nlu-rs/compare/0.57.1...0.57.2
Expand Down
6 changes: 3 additions & 3 deletions snips-nlu-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "snips-nlu-cli"
version = "0.58.1"
version = "0.58.2"
authors = ["Adrien Ball <adrien.ball@snips.ai>"]

[dependencies]
snips-nlu-lib = { path = "../snips-nlu-lib" }
clap = "2.32.0"
serde_json = "1.0.22"
clap = "2.32"
serde_json = "1.0"
4 changes: 2 additions & 2 deletions snips-nlu-ffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "snips-nlu-ffi"
version = "0.58.1"
version = "0.58.2"
authors = [
"Kevin Lefevre <kevin.lefevre@snips.ai>",
"Thibaut Lorrain <thibaut.lorrain@snips.ai>"
Expand All @@ -9,7 +9,7 @@ authors = [
[dependencies]
ffi-utils = { git = "https://github.com/snipsco/snips-utils-rs", rev = "b1f4af3" }
snips-nlu-lib = { path = "../snips-nlu-lib" }
snips-nlu-ontology-ffi-macros = { git = "https://github.com/snipsco/snips-nlu-ontology", tag = "0.57.1" }
snips-nlu-ontology-ffi-macros = { git = "https://github.com/snipsco/snips-nlu-ontology", tag = "0.57.3" }
failure = "0.1"
lazy_static = "1.0"
libc = "0.2"
Expand Down
2 changes: 1 addition & 1 deletion snips-nlu-ffi/kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {

apply plugin: 'kotlin'

version = "0.58.1"
version = "0.58.2"
group = "ai.snips"

repositories {
Expand Down
4 changes: 2 additions & 2 deletions snips-nlu-ffi/python/snips-nlu-python-ffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "snips-nlu-python-ffi"
version = "0.58.1"
version = "0.58.2"
authors = ["Adrien Ball <adrien.ball@snips.ai>"]

[lib]
Expand All @@ -10,4 +10,4 @@ crate-type = ["cdylib"]
[dependencies]
libc = "0.2"
ffi-utils = { git = "https://github.com/snipsco/snips-utils-rs", rev = "b1f4af3" }
snips-nlu-ffi = { git = "https://github.com/snipsco/snips-nlu-rs", tag = "0.58.1" }
snips-nlu-ffi = { git = "https://github.com/snipsco/snips-nlu-rs", tag = "0.58.2" }
2 changes: 1 addition & 1 deletion snips-nlu-ffi/python/snips_nlu_rust/__version__
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.58.1
0.58.2
2 changes: 1 addition & 1 deletion snips-nlu-ffi/swift/SnipsNlu/Dependencies/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

set -e

VERSION="0.58.1"
VERSION="0.58.2"
SYSTEM=$(echo $1 | tr '[:upper:]' '[:lower:]')
LIBRARY_NAME=libsnips_nlu_ffi
LIBRARY_NAME_A=${LIBRARY_NAME}.a
Expand Down
10 changes: 5 additions & 5 deletions snips-nlu-lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "snips-nlu-lib"
version = "0.58.1"
version = "0.58.2"
authors = [
"Thibaut Lorrain <thibaut.lorrain@snips.ai>",
"Kevin Lefevre <kevin.lefevre@snips.ai>"
Expand All @@ -10,15 +10,14 @@ description = "Rust implementation of Snips NLU"

[dependencies]
crfsuite = { git = "https://github.com/snipsco/crfsuite-rs", rev = "30b2ea6" }
snips-nlu-ontology = { git = "https://github.com/snipsco/snips-nlu-ontology", tag = "0.57.1" }
snips-nlu-ontology-parsers = { git = "https://github.com/snipsco/snips-nlu-ontology", tag = "0.57.1" }
snips-nlu-ontology = { git = "https://github.com/snipsco/snips-nlu-ontology", tag = "0.57.3" }
snips-nlu-ontology-parsers = { git = "https://github.com/snipsco/snips-nlu-ontology", tag = "0.57.3" }
snips-nlu-utils = { git = "https://github.com/snipsco/snips-nlu-utils", tag = "0.6.1" }
dinghy-test = "0.3"
failure = "0.1"
base64 = "0.9"
itertools = { version = "0.7", default-features = false }
lazy_static = "1.0"
lru-cache = "0.1.1"
lru-cache = "0.1"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
Expand All @@ -30,6 +29,7 @@ zip = { version = "0.3", features=["deflate"] }

[dev-dependencies]
bencher = { git = "https://github.com/snipsco/bencher", rev = "63910ace" }
dinghy-test = "0.3"
maplit = "1.0"

[[bench]]
Expand Down
7 changes: 7 additions & 0 deletions snips-nlu-lib/benches/nlu_engine.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#[macro_use]
extern crate bencher;
extern crate snips_nlu_lib;
extern crate dinghy_test;

use std::env;

Expand All @@ -10,6 +11,12 @@ use snips_nlu_lib::*;
const ENGINE_DIR_ENV: &str = "SNIPS_NLU_BENCH_ENGINE_DIR";
const SENTENCE_ENV: &str = "SNIPS_NLU_BENCH_SENTENCE";

fn file_path(filename: &str) -> ::std::path::PathBuf {
dinghy_test::try_test_file_path("data")
.unwrap_or_else(|| "../data".into())
.join(filename)
}

fn load_nlu_engine() -> SnipsNluEngine {
let engine_path = if let Ok(engine_directory) = env::var(ENGINE_DIR_ENV) {
file_path(&engine_directory)
Expand Down
3 changes: 2 additions & 1 deletion snips-nlu-lib/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
extern crate base64;
extern crate crfsuite;
extern crate csv;
#[cfg(test)]
extern crate dinghy_test;
#[macro_use]
extern crate failure;
Expand Down Expand Up @@ -50,4 +51,4 @@ pub use nlu_engine::SnipsNluEngine;
pub use resources::loading::clear_resources; // This is used by benches
pub use slot_filler::{CRFSlotFiller, SlotFiller};
pub use nlu_utils::token::{compute_all_ngrams, tokenize_light};
pub use utils::file_path; // This is used by benches

4 changes: 3 additions & 1 deletion snips-nlu-lib/src/resources/stemmer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ impl HashMapStemmer {
let mut values = HashMap::<String, String>::new();
let mut csv_reader = csv::ReaderBuilder::new()
.delimiter(b',')
.quoting(false)
.flexible(true)
.has_headers(false)
.from_reader(reader);
Expand Down Expand Up @@ -93,7 +94,7 @@ mod tests {
fn hashmap_stemmer_works() {
// Given
let stems: &[u8] = r#"
investigate,investigated,investigation
investigate,investigated,investigation,"investigate
do,done,don't,doing,did,does"#.as_ref();

// When
Expand All @@ -104,6 +105,7 @@ do,done,don't,doing,did,does"#.as_ref();
let stemmer = stemmer.unwrap();
assert_eq!(stemmer.stem("don't"), "do".to_string());
assert_eq!(stemmer.stem("does"), "do".to_string());
assert_eq!(stemmer.stem("\"investigate"), "investigate".to_string());
assert_eq!(stemmer.stem("unknown"), "unknown".to_string());
}
}
6 changes: 5 additions & 1 deletion snips-nlu-lib/src/resources/word_clusterer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ impl HashMapWordClusterer {
fn from_reader<R: Read>(reader: R) -> Result<Self> {
let mut csv_reader = csv::ReaderBuilder::new()
.delimiter(b'\t')
.quoting(false)
.has_headers(false)
.from_reader(reader);
let mut values = HashMap::<String, String>::new();
Expand Down Expand Up @@ -103,7 +104,9 @@ mod tests {
// Given
let clusters: &[u8] = r#"
hello 1111111111111
world 1111110111111"#.as_ref();
world 1111110111111
"yolo 1111100111111
"#.as_ref();

// When
let clusterer = HashMapWordClusterer::from_reader(clusters);
Expand All @@ -113,6 +116,7 @@ world 1111110111111"#.as_ref();
let clusterer = clusterer.unwrap();
assert_eq!(clusterer.get_cluster("hello"), Some("1111111111111".to_string()));
assert_eq!(clusterer.get_cluster("world"), Some("1111110111111".to_string()));
assert_eq!(clusterer.get_cluster("\"yolo"), Some("1111100111111".to_string()));
assert_eq!(clusterer.get_cluster("unknown"), None);
}
}
1 change: 1 addition & 0 deletions snips-nlu-lib/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub trait FromPath {
fn from_path<P: AsRef<Path>>(path: P) -> Result<Self> where Self: Sized;
}

#[cfg(test)]
pub fn file_path(filename: &str) -> ::std::path::PathBuf {
::dinghy_test::try_test_file_path("data")
.unwrap_or_else(|| "../data".into())
Expand Down

0 comments on commit 7ded572

Please sign in to comment.