Skip to content

Commit 9895ab5

Browse files
authored
Merge pull request #194 from snipsco/fix/chrono
Fix chrono issue and move to edition 2018
2 parents 40d070e + b83e911 commit 9895ab5

32 files changed

+4613
-3061
lines changed

Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ name = "rustling-ontology"
33
version = "0.19.1"
44
authors = ["hdlj <[email protected]>"]
55
build = "build.rs"
6+
edition = "2018"
67

78
[workspace]
89
members=["values", "cli", "cli-debug", "moment", "json-utils",
910
"grammar", "grammar/de", "grammar/en", "grammar/es", "grammar/pt", "grammar/fr", "grammar/ko", "grammar/zh", "grammar/ja", "grammar/it"]
1011

1112
[dependencies]
12-
rmp-serde = "0.13"
13-
serde = "1.0"
14-
serde_derive = "1.0"
13+
rmp-serde = "0.14"
14+
serde = { version = "1.0", features = ["derive"] }
1515
rustling = { git="https://github.com/snipsco/rustling", tag="0.9.0" }
1616
rustling-ontology-moment = { path="moment"}
1717
rustling-ontology-values = { path="values"}
@@ -24,9 +24,8 @@ serde_json = "1.0"
2424

2525

2626
[build-dependencies]
27-
rmp-serde = "0.13"
28-
serde = "1.0"
29-
serde_derive = "1.0"
27+
rmp-serde = "0.14"
28+
serde = { version = "1.0", features = ["derive"] }
3029
rustling = { git="https://github.com/snipsco/rustling", tag="0.9.0" }
3130
rustling-ontology-values = { path="values"}
3231
rustling-ontology-moment = { path="moment"}

build.rs

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,54 @@ extern crate rustling;
33
extern crate rustling_ontology_grammar as grammar;
44
extern crate rustling_ontology_values;
55
extern crate serde;
6-
#[macro_use]
7-
extern crate serde_derive;
86

9-
#[path="src/parser.rs"]
7+
#[path = "src/parser.rs"]
108
mod parser;
119

12-
use std::thread::{self, JoinHandle};
13-
use std::{path, env, fs};
1410
use grammar::Lang;
11+
use std::thread::{self, JoinHandle};
12+
use std::{env, fs, path};
1513

1614
pub fn train_async(lang: Lang) -> JoinHandle<()> {
17-
println!("cargo:rerun-if-changed=grammar/{}/src/", lang.to_string().to_lowercase());
15+
println!(
16+
"cargo:rerun-if-changed=grammar/{}/src/",
17+
lang.to_string().to_lowercase()
18+
);
1819
thread::spawn(move || {
1920
let out_dir = path::PathBuf::from(env::var("OUT_DIR").unwrap());
20-
let mut file = fs::File::create(out_dir.join(format!("{}{}", lang.to_string().to_lowercase(), ".rmp"))).unwrap();
21+
let mut file = fs::File::create(out_dir.join(format!(
22+
"{}{}",
23+
lang.to_string().to_lowercase(),
24+
".rmp"
25+
)))
26+
.unwrap();
2127
let rules = grammar::rules(lang).unwrap();
22-
let examples = grammar::examples(lang);
23-
let model = ::rustling::train::train(&rules, examples, ::parser::FeatureExtractor()).unwrap();
24-
::rmp_serde::encode::write(&mut file, &model).unwrap();
28+
let examples = grammar::examples(lang);
29+
let model = rustling::train::train(&rules, examples, parser::FeatureExtractor()).unwrap();
30+
rmp_serde::encode::write(&mut file, &model).unwrap();
2531
})
2632
}
2733

2834
pub fn train_sync(lang: Lang) {
29-
println!("cargo:rerun-if-changed=grammar/{}/src/", lang.to_string().to_lowercase());
35+
println!(
36+
"cargo:rerun-if-changed=grammar/{}/src/",
37+
lang.to_string().to_lowercase()
38+
);
3039
let out_dir = path::PathBuf::from(env::var("OUT_DIR").unwrap());
31-
let mut file = fs::File::create(out_dir.join(format!("{}{}", lang.to_string().to_lowercase(), ".rmp"))).unwrap();
40+
let mut file =
41+
fs::File::create(out_dir.join(format!("{}{}", lang.to_string().to_lowercase(), ".rmp")))
42+
.unwrap();
3243
let rules = grammar::rules(lang).unwrap();
33-
let examples = grammar::examples(lang);
34-
let model = ::rustling::train::train(&rules, examples, ::parser::FeatureExtractor()).unwrap();
35-
::rmp_serde::encode::write(&mut file, &model).unwrap();
44+
let examples = grammar::examples(lang);
45+
let model = rustling::train::train(&rules, examples, parser::FeatureExtractor()).unwrap();
46+
rmp_serde::encode::write(&mut file, &model).unwrap();
3647
}
3748

3849
pub fn train_all_async() {
39-
let join_handlers: Vec<_> = Lang::all().into_iter().map(|lang| {
40-
train_async(lang)
41-
}).collect();
50+
let join_handlers: Vec<_> = Lang::all()
51+
.into_iter()
52+
.map(|lang| train_async(lang))
53+
.collect();
4254

4355
for join in join_handlers {
4456
join.join().unwrap();

cli-debug/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "rustling-cli-debug"
33
version = "0.19.1"
44
authors = ["hdlj <[email protected]>", "Mathieu Poumeyrol <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
rustling = { git="https://github.com/snipsco/rustling", tag="0.9.0" }

cli/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
name = "rustling-cli"
33
version = "0.19.1"
44
authors = ["hdlj <[email protected]>", "Mathieu Poumeyrol <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
clap = "2"
89
prettytable-rs = "0.6"
910
rustling-ontology = { path = ".."}
1011
rustling-ontology-json-utils = { path="../json-utils" }
1112
rustling-ontology-moment = { path = "../moment"}
12-
serde_json = "1.0"
13+
serde_json = "1.0"

grammar/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "rustling-ontology-grammar"
33
version = "0.19.1"
44
authors = ["hdlj <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
rustling = { git="https://github.com/snipsco/rustling", tag="0.9.0" }

grammar/de/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "rustling-ontology-de"
33
version = "0.19.1"
44
authors = ["hdlj <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
rustling = { git="https://github.com/snipsco/rustling", tag="0.9.0" }

grammar/en/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
name = "rustling-ontology-en"
33
version = "0.19.1"
44
authors = ["hdlj <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
rustling = { git="https://github.com/snipsco/rustling", tag="0.9.0" }
89
rustling-ontology-moment = { path="../../moment"}
9-
rustling-ontology-values = { path="../../values"}
10+
rustling-ontology-values = { path="../../values"}

grammar/es/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
name = "rustling-ontology-es"
33
version = "0.19.1"
44
authors = ["hdlj <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
rustling = { git="https://github.com/snipsco/rustling", tag="0.9.0" }
89
rustling-ontology-moment = { path="../../moment"}
9-
rustling-ontology-values = { path="../../values"}
10+
rustling-ontology-values = { path="../../values"}

grammar/fr/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "rustling-ontology-fr"
33
version = "0.19.1"
44
authors = ["hdlj <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
rustling = { git="https://github.com/snipsco/rustling", tag="0.9.0" }

grammar/it/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
name = "rustling-ontology-it"
33
version = "0.19.1"
44
authors = ["hdlj <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
rustling = { git="https://github.com/snipsco/rustling", tag="0.9.0" }
89
rustling-ontology-moment = { path="../../moment"}
9-
rustling-ontology-values = { path="../../values"}
10+
rustling-ontology-values = { path="../../values"}

0 commit comments

Comments
 (0)