mirror of
https://github.com/bvanroll/unnamed_chatgpt_project.git
synced 2025-08-29 03:52:42 +00:00
interessant projectjen
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
# Generated by Cargo
|
# Generated by Cargo
|
||||||
# will have compiled files and executables
|
# will have compiled files and executables
|
||||||
main/target/
|
main/target/
|
||||||
|
data_prep/target/
|
||||||
|
|
||||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||||
|
5
.idea/unnamed_chatgpt_project.iml
generated
5
.idea/unnamed_chatgpt_project.iml
generated
@@ -2,7 +2,10 @@
|
|||||||
<module type="JAVA_MODULE" version="4">
|
<module type="JAVA_MODULE" version="4">
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
<exclude-output />
|
<exclude-output />
|
||||||
<content url="file://$MODULE_DIR$" />
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/data_prep/src" isTestSource="false" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/data_prep/target" />
|
||||||
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
|
@@ -7,3 +7,7 @@ edition = "2018"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
serde_json = "1.0.91"
|
||||||
|
rfd = "0.10.0"
|
||||||
|
chatgpt_rs = "0.6.0"
|
@@ -1,3 +1,37 @@
|
|||||||
fn main() {
|
use std::fs::File;
|
||||||
println!("Hello, world!");
|
use std::io::{BufReader, Read};
|
||||||
|
use serde::{Serialize, Deserialize};
|
||||||
|
|
||||||
|
#[derive(Deserialize)]
|
||||||
|
struct MiniHuman {
|
||||||
|
name: String,
|
||||||
|
gender: String,
|
||||||
}
|
}
|
||||||
|
#[derive(Serialize)]
|
||||||
|
struct Human {
|
||||||
|
firstName: String,
|
||||||
|
lastName: String,
|
||||||
|
gender: String,
|
||||||
|
age: String,
|
||||||
|
country: String,
|
||||||
|
bio: String,
|
||||||
|
job: String,
|
||||||
|
}
|
||||||
|
fn main() {
|
||||||
|
let current_path = std::env::current_dir().unwrap();
|
||||||
|
let res = rfd::FileDialog::new().set_directory(¤t_path).pick_file().unwrap();
|
||||||
|
let mut file = File::open(res.as_path()).unwrap();
|
||||||
|
let mut json_string:String = String::new();
|
||||||
|
file.read_to_string(&mut json_string).unwrap();
|
||||||
|
let MiniHumans: Vec<MiniHuman> = serde_json::from_str(&json_string).unwrap();
|
||||||
|
while MiniHumans.len() > 1 {
|
||||||
|
let firstName: String = getRngName(&MiniHumans);
|
||||||
|
let lastName: String = getRngName(&MiniHumans);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fn getRngName(miniHumans: &Vec<MiniHuman>) -> String {
|
||||||
|
return "".to_string()
|
||||||
|
}
|
Reference in New Issue
Block a user