aboutsummaryrefslogtreecommitdiff
path: root/srchr/src
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2022-10-23 15:15:29 +0200
committertslil clingman <tslil@posteo.de>2022-10-23 15:53:19 +0200
commit39044fe763899af1da0fabb65bf447daec83ad70 (patch)
tree9b0532f3b3321f4da34d0e27d65e25eebad29b1d /srchr/src
parent13e282705df90829ac39b75efde47e84e35cc1b1 (diff)
Release
Diffstat (limited to 'srchr/src')
-rw-r--r--srchr/src/config.rs16
-rw-r--r--srchr/src/corpus.rs16
-rw-r--r--srchr/src/evaluation.rs16
-rw-r--r--srchr/src/layout.rs24
-rw-r--r--srchr/src/main.rs16
-rw-r--r--srchr/src/output.rs16
6 files changed, 103 insertions, 1 deletions
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...