From 39044fe763899af1da0fabb65bf447daec83ad70 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Sun, 23 Oct 2022 15:15:29 +0200 Subject: Release --- srchr/Cargo.lock | 2 +- srchr/Cargo.toml | 2 +- srchr/src/config.rs | 16 ++++++++++++++++ srchr/src/corpus.rs | 16 ++++++++++++++++ srchr/src/evaluation.rs | 16 ++++++++++++++++ srchr/src/layout.rs | 24 +++++++++++++++++++++++- srchr/src/main.rs | 16 ++++++++++++++++ srchr/src/output.rs | 16 ++++++++++++++++ 8 files changed, 105 insertions(+), 3 deletions(-) (limited to 'srchr') 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 . + // ----------------------------------------------------------------------------- // 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 . + 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 . + 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 . + 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 . + 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 . + use crate::config::*; // This is a silly amount of work to genericise the below... -- cgit v1.3.1