Skip to content

Commit

Permalink
update dependencies and use github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yaa110 committed Apr 7, 2024
1 parent 41802f5 commit 06e160a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 18 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test and Lint
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
23 changes: 10 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
[package]
name = "rake"
version = "0.3.3"
authors = ["Navid <yaa110@gmail.com>"]
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"]}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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) [![Test](https://github.com/yaa110/rake-rs/actions/workflows/test.yml/badge.svg)](https://github.com/yaa110/rake-rs/actions/workflows/test.yml)

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
Expand Down
7 changes: 3 additions & 4 deletions src/stopwords.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand All @@ -17,9 +16,9 @@ impl From<HashSet<String>> for StopWords {
}
}

impl Into<HashSet<String>> for StopWords {
fn into(self) -> HashSet<String> {
self.0
impl From<StopWords> for HashSet<String> {
fn from(sw: StopWords) -> Self {
sw.0
}
}

Expand Down

0 comments on commit 06e160a

Please sign in to comment.