Skip to content

Commit 7cf77e0

Browse files
authored
Merge pull request #65 from snipsco/release/0.58.1
Release 0.58.1
2 parents 4728835 + 7079489 commit 7cf77e0

File tree

9 files changed

+29
-18
lines changed

9 files changed

+29
-18
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4-
## [0.58.0] - 2018-07-17`
4+
## [0.58.1] - 2018-07-24
5+
### Fixed
6+
- Error when loading a `SnipsNluEngine` from zip data
7+
8+
## [0.58.0] - 2018-07-17
59
### Added
610
- Interactive parsing CLI
711

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

8185

86+
[0.58.1]: https://github.com/snipsco/snips-nlu-rs/compare/0.58.0...0.58.1
8287
[0.58.0]: https://github.com/snipsco/snips-nlu-rs/compare/0.57.2...0.58.0
8388
[0.57.2]: https://github.com/snipsco/snips-nlu-rs/compare/0.57.1...0.57.2
8489
[0.57.1]: https://github.com/snipsco/snips-nlu-rs/compare/0.57.0...0.57.1

snips-nlu-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "snips-nlu-cli"
3-
version = "0.58.0"
3+
version = "0.58.1"
44
authors = ["Adrien Ball <[email protected]>"]
55

66
[dependencies]

snips-nlu-ffi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "snips-nlu-ffi"
3-
version = "0.58.0"
3+
version = "0.58.1"
44
authors = [
55
"Kevin Lefevre <[email protected]>",
66
"Thibaut Lorrain <[email protected]>"

snips-nlu-ffi/kotlin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ buildscript {
1111

1212
apply plugin: 'kotlin'
1313

14-
version = "0.58.0"
14+
version = "0.58.1"
1515
group = "ai.snips"
1616

1717
repositories {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "snips-nlu-python-ffi"
3-
version = "0.58.0"
3+
version = "0.58.1"
44
authors = ["Adrien Ball <[email protected]>"]
55

66
[lib]
@@ -10,4 +10,4 @@ crate-type = ["cdylib"]
1010
[dependencies]
1111
libc = "0.2"
1212
ffi-utils = { git = "https://github.com/snipsco/snips-utils-rs", rev = "b1f4af3" }
13-
snips-nlu-ffi = { git = "https://github.com/snipsco/snips-nlu-rs", tag = "0.58.0" }
13+
snips-nlu-ffi = { git = "https://github.com/snipsco/snips-nlu-rs", tag = "0.58.1" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.58.0
1+
0.58.1

snips-nlu-ffi/swift/SnipsNlu/Dependencies/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
set -e
66

7-
VERSION="0.58.0"
7+
VERSION="0.58.1"
88
SYSTEM=$(echo $1 | tr '[:upper:]' '[:lower:]')
99
LIBRARY_NAME=libsnips_nlu_ffi
1010
LIBRARY_NAME_A=${LIBRARY_NAME}.a

snips-nlu-lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "snips-nlu-lib"
3-
version = "0.58.0"
3+
version = "0.58.1"
44
authors = [
55
"Thibaut Lorrain <[email protected]>",
66
"Kevin Lefevre <[email protected]>"

snips-nlu-lib/src/nlu_engine.rs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::collections::{HashMap, HashSet};
22
use std::fs;
33
use std::io;
44
use std::iter::FromIterator;
5-
use std::path::Path;
5+
use std::path::{Component, Path};
66
use std::str::FromStr;
77
use std::sync::Arc;
88

@@ -95,14 +95,6 @@ impl SnipsNluEngine {
9595
.tempdir()?;
9696
let temp_dir_path = temp_dir.path();
9797

98-
let engine_dir_path = archive
99-
.by_index(0)?
100-
.sanitized_name();
101-
102-
let engine_dir_name = engine_dir_path
103-
.to_str()
104-
.ok_or_else(|| format_err!("Engine directory name is empty"))?;
105-
10698
for file_index in 0..archive.len() {
10799
let mut file = archive.by_index(file_index)?;
108100
let outpath = temp_dir_path.join(file.sanitized_name());
@@ -120,6 +112,20 @@ impl SnipsNluEngine {
120112
}
121113
}
122114

115+
let first_archive_file = archive
116+
.by_index(0)?
117+
.sanitized_name();
118+
119+
let engine_dir_path = first_archive_file
120+
.components()
121+
.find(|component| if let Component::Normal(_) = component { true } else { false })
122+
.ok_or_else(|| format_err!("Trained engine archive is incorrect"))?
123+
.as_os_str();
124+
125+
let engine_dir_name = engine_dir_path
126+
.to_str()
127+
.ok_or_else(|| format_err!("Engine directory name is empty"))?;
128+
123129
Ok(SnipsNluEngine::from_path(temp_dir_path.join(engine_dir_name))?)
124130
}
125131
}

0 commit comments

Comments
 (0)