Skip to content

Commit

Permalink
Merge pull request #65 from snipsco/release/0.58.1
Browse files Browse the repository at this point in the history
Release 0.58.1
  • Loading branch information
adrienball authored Jul 24, 2018
2 parents 4728835 + 7079489 commit 7cf77e0
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 18 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.

## [0.58.0] - 2018-07-17`
## [0.58.1] - 2018-07-24
### Fixed
- Error when loading a `SnipsNluEngine` from zip data

## [0.58.0] - 2018-07-17
### Added
- Interactive parsing CLI

Expand Down Expand Up @@ -79,6 +83,7 @@ being statically hardcoded, reducing the binary size by 31Mb.
- Rename python package to `snips_nlu_rust`


[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
[0.57.1]: https://github.com/snipsco/snips-nlu-rs/compare/0.57.0...0.57.1
Expand Down
2 changes: 1 addition & 1 deletion snips-nlu-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "snips-nlu-cli"
version = "0.58.0"
version = "0.58.1"
authors = ["Adrien Ball <[email protected]>"]

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion 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.0"
version = "0.58.1"
authors = [
"Kevin Lefevre <[email protected]>",
"Thibaut Lorrain <[email protected]>"
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.0"
version = "0.58.1"
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.0"
version = "0.58.1"
authors = ["Adrien Ball <[email protected]>"]

[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.0" }
snips-nlu-ffi = { git = "https://github.com/snipsco/snips-nlu-rs", tag = "0.58.1" }
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.0
0.58.1
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.0"
VERSION="0.58.1"
SYSTEM=$(echo $1 | tr '[:upper:]' '[:lower:]')
LIBRARY_NAME=libsnips_nlu_ffi
LIBRARY_NAME_A=${LIBRARY_NAME}.a
Expand Down
2 changes: 1 addition & 1 deletion 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.0"
version = "0.58.1"
authors = [
"Thibaut Lorrain <[email protected]>",
"Kevin Lefevre <[email protected]>"
Expand Down
24 changes: 15 additions & 9 deletions snips-nlu-lib/src/nlu_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::collections::{HashMap, HashSet};
use std::fs;
use std::io;
use std::iter::FromIterator;
use std::path::Path;
use std::path::{Component, Path};
use std::str::FromStr;
use std::sync::Arc;

Expand Down Expand Up @@ -95,14 +95,6 @@ impl SnipsNluEngine {
.tempdir()?;
let temp_dir_path = temp_dir.path();

let engine_dir_path = archive
.by_index(0)?
.sanitized_name();

let engine_dir_name = engine_dir_path
.to_str()
.ok_or_else(|| format_err!("Engine directory name is empty"))?;

for file_index in 0..archive.len() {
let mut file = archive.by_index(file_index)?;
let outpath = temp_dir_path.join(file.sanitized_name());
Expand All @@ -120,6 +112,20 @@ impl SnipsNluEngine {
}
}

let first_archive_file = archive
.by_index(0)?
.sanitized_name();

let engine_dir_path = first_archive_file
.components()
.find(|component| if let Component::Normal(_) = component { true } else { false })
.ok_or_else(|| format_err!("Trained engine archive is incorrect"))?
.as_os_str();

let engine_dir_name = engine_dir_path
.to_str()
.ok_or_else(|| format_err!("Engine directory name is empty"))?;

Ok(SnipsNluEngine::from_path(temp_dir_path.join(engine_dir_name))?)
}
}
Expand Down

0 comments on commit 7cf77e0

Please sign in to comment.