Rust ![Latest Version] Docs.rs

RustySozluk

Firefly rustysozluk-rust programming, sour, crabs with green lemons 67820

Description

RustySozluk is a Rust library for fetching user entries and thread entries from eksisozluk.com and analyzing sentiment of entries. With the power of Rust and tokio library, it is possible to fetch entries in a thread in a very short time.

Features

Installation

Add rustysozluk to your Cargo.toml:

toml [dependencies] rustysozluk = "0.1.8"

Usage

```rust use rustysozluk::{fetch_user, tokio};

[tokio::main]

async fn main() -> Result<(), Box> { let username= "morgomir"; // username to fetch //alınacak kullanıcı adı let entrynumber = 4; // number of entries to fetch //alınacak girdi sayısı let entries = fetchuser(username, entry_number).await?; println!("Extracted {} entries:", entries.len()); for entry in entries.iter() { println!("Content: {}\nDate: {}\nUsername: {}", entry.content, entry.date, entry.username); } Ok(()) } ```

If you want to fetch entries in a thread, you can simple use fetch_thread function just like fetch_user function, no need to change anything.

Sentiment Analysis

rustysozluk has "analyzer" module which is used for sentiment analysis. It uses Sağlam et al., 2019 model to classify entries as positive, negative and give a "Tone" score between -1 and 1.

here is an example usage:

```rust use rustysozluk::tokio; use rustysozluk::fetchtitle; use rustysozluk::analyzer::analyzer::analyzesentiment;

[tokio::main]

async fn main() -> Result<(), Box> { let title = "https://eksisozluk1923.com/rust-programlama-dili--5575227"; let numberofentries = 4; let entries = fetchtitle(title, numberofentries).await?; analyzesentiment(entries)?; Ok(())

} ```

Important Notes 📝

To properly use the analyzer module, you'll need to have access to two CSV files that serve as lexicons for sentiment analysis. These files are:

Both files can be found in the files folder of this GitHub repository. Download it and place it in the same directory as your project.

Request Limitation and Rate Limiting ⚠️

When using the rustysozluk crate, please be mindful of the number of requests you make to eksisozluk.com. Sending an excessive number of requests in a short period of time can result in your IP address being temporarily banned from accessing the site.

Recommendations 📋

Contributing

Any kind of contribution is welcome! Feel free to open an issue 🙂