diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f4d5ea0 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: Test +on: + push: + branches: + - "*" +jobs: + test: + name: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: install rust and run tests + run: | + rustup update stable --no-self-update + rustup default stable + cargo test -j`nproc` + lint: + name: check format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: install rust and check format + run: | + rustup update stable + rustup default stable + rustup component add rustfmt + cargo fmt -- --check diff --git a/Cargo.toml b/Cargo.toml index c00c279..5502d72 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,21 +1,18 @@ [package] -name = "rake" -version = "0.3.3" authors = ["Navid "] +categories = ["algorithms", "text-processing"] +description = "Rust implementation of Rapid Automatic Keyword Extraction (RAKE) algorithm" +documentation = "https://docs.rs/rake" +edition = "2021" +homepage = "https://github.com/yaa110/rake-rs" +keywords = ["rake", "algorithm", "keyword"] license = "MIT/Apache-2.0" +name = "rake" readme = "README.md" -keywords = ["rake", "algorithm", "keyword"] repository = "https://github.com/yaa110/rake-rs" -homepage = "https://github.com/yaa110/rake-rs" -documentation = "https://docs.rs/rake" -description = "Rust implementation of Rapid Automatic Keyword Extraction (RAKE) algorithm" -categories = ["algorithms", "text-processing"] -edition = "2018" - -[badges] -travis-ci = { repository = "yaa110/rake-rs" } +version = "0.3.4" [dependencies] -regex = "1.4" -serde = { version = "1.0", features = ["derive"] } lazy_static = "1.4" +regex = "1.10" +serde = {version = "1.0", features = ["derive"]} diff --git a/README.md b/README.md index 07ec798..db2d248 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ RAKE.rs ======= -[![crates.io](https://img.shields.io/crates/v/rake.svg)](https://crates.io/crates/rake) [![Documentation](https://img.shields.io/badge/Docs-rake-blue.svg)](https://docs.rs/rake) [![Build Status](https://travis-ci.org/yaa110/rake-rs.svg)](https://travis-ci.org/yaa110/rake-rs) ![Crates.io](https://img.shields.io/crates/l/rustc-serialize.svg) +[![crates.io](https://img.shields.io/crates/v/rake.svg)](https://crates.io/crates/rake) [![Documentation](https://img.shields.io/badge/Docs-rake-blue.svg)](https://docs.rs/rake) ![Crates.io](https://img.shields.io/crates/l/rustc-serialize.svg) The library provides a multilingual implementation of [Rapid Automatic Keyword Extraction (RAKE)](http://onlinelibrary.wiley.com/doi/10.1002/9780470689646.ch1/summary) algorithm for Rust. ## How to Use + - Append `rake` to `dependencies` of `Cargo.toml`: ```toml diff --git a/src/stopwords.rs b/src/stopwords.rs index 1707e45..cb53a08 100644 --- a/src/stopwords.rs +++ b/src/stopwords.rs @@ -1,7 +1,6 @@ use serde::{Deserialize, Serialize}; use std::collections::HashSet; use std::convert::AsRef; -use std::convert::{From, Into}; use std::fs::File; use std::io::{self, BufRead, BufReader}; use std::ops::{Deref, DerefMut}; @@ -17,9 +16,9 @@ impl From> for StopWords { } } -impl Into> for StopWords { - fn into(self) -> HashSet { - self.0 +impl From for HashSet { + fn from(sw: StopWords) -> Self { + sw.0 } }