-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
50,194 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rust-analyzer.linkedProjects": [ | ||
".\\Cargo.toml" | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use rustysozluk::{fetch_user, tokio}; | ||
use rustysozluk::analyzer::analyzer::top_words; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let username = "morgomir"; | ||
let entry_number = 4; | ||
let output_csv = false; | ||
let entries = fetch_user(username, entry_number).await?; | ||
top_words(entries, "files/stopwords.csv", 5,output_csv)?; // stopwords file path, top N words. False means output is not csv. | ||
Ok(()) | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//this example is more advanced than analyze.rs. | ||
// Bu örnek, analyze.rs'den daha gelişmiştir. | ||
|
||
use rustysozluk::{fetch_user, tokio}; | ||
use rustysozluk::analyzer::analyzer::{read_stopwords, word_frequencies}; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let username = "morgomir"; | ||
let entry_number = 4; | ||
let entries = fetch_user(username, entry_number).await?; | ||
|
||
let stopwords = read_stopwords("files/stopwords.csv")?; // stopwords file path | ||
|
||
// Count word frequencies in the entries // kelime frekansını çıkart | ||
let word_count: std::collections::HashMap<String, usize> = word_frequencies(entries.iter().map(|e| e.content.clone()).collect(), &stopwords); | ||
|
||
// Sort the HashMap by value (frequency) in descending order // HashMapi azalana göre sırala | ||
let mut word_vec: Vec<(&String, &usize)> = word_count.iter().collect(); | ||
word_vec.sort_by(|a, b| b.1.cmp(a.1)); | ||
|
||
// Display the top 10 most frequent words / en çok kullanılan 10 kelimeyi göster | ||
println!("Top 10 most frequent words:"); | ||
for (idx, (word, freq)) in word_vec.iter().enumerate().take(10) { | ||
println!("{}. {}: {}", idx + 1, word, freq); | ||
} | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//this example fetches the title and analyzes the sentiment of the entries in the title | ||
//bu örnek başlığı alır ve başlıktaki girdilerin duygu durumunu analiz eder | ||
use rustysozluk::tokio; | ||
use rustysozluk::fetch_title; | ||
use rustysozluk::analyzer::analyzer::analyze_sentiment; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let title = "https://eksisozluk1923.com/rust-programlama-dili--5575227"; // title URL //başlık URL'si | ||
let number_of_entries = 4; // number of entries to fetch //alınacak girdi sayısı | ||
let entries = fetch_title(title, number_of_entries).await?; | ||
analyze_sentiment(entries)?; | ||
Ok(()) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
//this example fetches the title and analyzes the sentiment of the entries in the title | ||
//bu örnek başlığı alır ve başlıktaki girdilerin duygu durumunu analiz eder | ||
use rustysozluk::{fetch_user, tokio}; | ||
use rustysozluk::analyzer::analyzer::analyze_sentiment; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let username = "morgomir"; // username //kullanıcı adı | ||
let entry_number = 4; // number of entries to fetch //alınacak girdi sayısı | ||
let entries = fetch_user(username, entry_number).await?; | ||
analyze_sentiment(entries)?; // analyze sentiment //duygu durumunu analiz et | ||
Ok(()) | ||
} |
Oops, something went wrong.