diff options
| author | tslil clingman <tslil@posteo.de> | 2022-10-23 15:15:29 +0200 |
|---|---|---|
| committer | tslil clingman <tslil@posteo.de> | 2022-10-23 15:53:19 +0200 |
| commit | 39044fe763899af1da0fabb65bf447daec83ad70 (patch) | |
| tree | 9b0532f3b3321f4da34d0e27d65e25eebad29b1d /srchr | |
| parent | 13e282705df90829ac39b75efde47e84e35cc1b1 (diff) | |
Release
Diffstat (limited to 'srchr')
| -rw-r--r-- | srchr/Cargo.lock | 2 | ||||
| -rw-r--r-- | srchr/Cargo.toml | 2 | ||||
| -rw-r--r-- | srchr/src/config.rs | 16 | ||||
| -rw-r--r-- | srchr/src/corpus.rs | 16 | ||||
| -rw-r--r-- | srchr/src/evaluation.rs | 16 | ||||
| -rw-r--r-- | srchr/src/layout.rs | 24 | ||||
| -rw-r--r-- | srchr/src/main.rs | 16 | ||||
| -rw-r--r-- | srchr/src/output.rs | 16 |
8 files changed, 105 insertions, 3 deletions
diff --git a/srchr/Cargo.lock b/srchr/Cargo.lock index 0aa5e01..5c46d31 100644 --- a/srchr/Cargo.lock +++ b/srchr/Cargo.lock @@ -199,7 +199,7 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "srchr" -version = "0.1.0" +version = "1.0.0" dependencies = [ "json", "rand", diff --git a/srchr/Cargo.toml b/srchr/Cargo.toml index 509b6bc..f577fed 100644 --- a/srchr/Cargo.toml +++ b/srchr/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "srchr" -version = "0.1.0" +version = "1.0.0" edition = "2021" # [profile.release] diff --git a/srchr/src/config.rs b/srchr/src/config.rs index 8a7faae..c499f8c 100644 --- a/srchr/src/config.rs +++ b/srchr/src/config.rs @@ -1,3 +1,19 @@ +// Copyright (C) 2022 tslil clingman +// +// This file is part of srchr. +// +// srchr is free software: you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// srchr is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +// A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with +// srchr. If not, see <https://www.gnu.org/licenses/>. + // ----------------------------------------------------------------------------- // Tweak // ----------------------------------------------------------------------------- diff --git a/srchr/src/corpus.rs b/srchr/src/corpus.rs index bc6813e..4ba1148 100644 --- a/srchr/src/corpus.rs +++ b/srchr/src/corpus.rs @@ -1,3 +1,19 @@ +// Copyright (C) 2022 tslil clingman +// +// This file is part of srchr. +// +// srchr is free software: you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// srchr is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +// A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with +// srchr. If not, see <https://www.gnu.org/licenses/>. + use std::fs; use crate::config::*; diff --git a/srchr/src/evaluation.rs b/srchr/src/evaluation.rs index 6621700..26d44a2 100644 --- a/srchr/src/evaluation.rs +++ b/srchr/src/evaluation.rs @@ -1,3 +1,19 @@ +// Copyright (C) 2022 tslil clingman +// +// This file is part of srchr. +// +// srchr is free software: you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// srchr is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +// A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with +// srchr. If not, see <https://www.gnu.org/licenses/>. + use crate::config::*; use crate::corpus::*; use crate::layout::*; diff --git a/srchr/src/layout.rs b/srchr/src/layout.rs index cc963c7..3a70dc1 100644 --- a/srchr/src/layout.rs +++ b/srchr/src/layout.rs @@ -1,3 +1,19 @@ +// Copyright (C) 2022 tslil clingman +// +// This file is part of srchr. +// +// srchr is free software: you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// srchr is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +// A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with +// srchr. If not, see <https://www.gnu.org/licenses/>. + use crate::config::*; use crate::corpus::*; use crate::output::*; @@ -41,12 +57,15 @@ impl Prelayout { saved = standard_columns[target_col][target_idx]; } - let source_col: usize; + let mut source_col: usize; let source_idx: usize; if source_index { source_col = rng.gen_range(0..2); source_idx = rng.gen_range(0..6); if target_index { + while source_col != target_col { + source_col = rng.gen_range(0..2) + } index_columns[target_col][target_idx] = index_columns[source_col][source_idx]; } else { standard_columns[target_col][target_idx] = @@ -60,6 +79,9 @@ impl Prelayout { index_columns[target_col][target_idx] = standard_columns[source_col][source_idx]; } else { + while source_col != target_col { + source_col = rng.gen_range(0..6); + } standard_columns[target_col][target_idx] = standard_columns[source_col][source_idx]; } diff --git a/srchr/src/main.rs b/srchr/src/main.rs index af1d0d2..db8a103 100644 --- a/srchr/src/main.rs +++ b/srchr/src/main.rs @@ -1,3 +1,19 @@ +// Copyright (C) 2022 tslil clingman +// +// This file is part of srchr. +// +// srchr is free software: you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// srchr is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +// A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with +// srchr. If not, see <https://www.gnu.org/licenses/>. + mod config; mod corpus; mod evaluation; diff --git a/srchr/src/output.rs b/srchr/src/output.rs index dec079d..7eec147 100644 --- a/srchr/src/output.rs +++ b/srchr/src/output.rs @@ -1,3 +1,19 @@ +// Copyright (C) 2022 tslil clingman +// +// This file is part of srchr. +// +// srchr is free software: you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// srchr is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +// A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with +// srchr. If not, see <https://www.gnu.org/licenses/>. + use crate::config::*; // This is a silly amount of work to genericise the below... |
