Skip to content

Commit

Permalink
Using canonical URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
AbrJA committed Jun 29, 2023
1 parent 99ccc69 commit 4195eb3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 33 deletions.
16 changes: 7 additions & 9 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ knitr::opts_chunk$set(
# rflashtext

<!-- badges: start -->
[![R-CMD-check](https://github.com/AbrJA/rflashtext/workflows/R-CMD-check/badge.svg)](https://github.com/AbrJA/rflashtext/actions)
[![Grand-total](https://cranlogs.r-pkg.org/badges/grand-total/rflashtext)](https://cran.r-project.org/web/packages/rflashtext/index.html)
[![Per-month](https://cranlogs.r-pkg.org/badges/rflashtext)](https://cran.r-project.org/web/packages/rflashtext/index.html)
[![R-CMD-check](https://github.com/AbrJA/rflashtext/workflows/R-CMD-check/badge.svg)](https://cran.r-project.org/web/checks/check_results_rflashtext.html)
[![Grand-total](https://cranlogs.r-pkg.org/badges/grand-total/rflashtext)](https://github.com/AbrJA/rflashtext/actions)
[![Per-month](https://cranlogs.r-pkg.org/badges/rflashtext)](https://CRAN.R-project.org/package=rflashtext)
<!-- badges: end -->

_rflashtext_ **can be used to find and replace words in a given text with only one pass over the document.**
Expand All @@ -27,16 +27,16 @@ It's a R implementation of the [FlashText algorithm](https://arxiv.org/abs/1711.

## Installation

You can install the released version of rflashtext from [CRAN](https://cran.r-project.org/web/packages/rflashtext/index.html) with:
You can install the released version of rflashtext from [CRAN](https://CRAN.R-project.org/package=rflashtext) with:

``` r
install.packages("rflashtext")
```

And the development version from [GitHub](https://github.com/AbrJA/rflashtext) with:

``` r
# install.packages("devtools")
```r
install.packages("devtools")
devtools::install_github("AbrJA/rflashtext")
```
## Example
Expand All @@ -46,8 +46,6 @@ This is a basic example which shows you how to use the API:
### New processor

```{r new}
devtools::install_github("AbrJA/rflashtext@rcpp")
library(rflashtext)
processor <- KeywordProcessor$new(keys = c("NY", "LA"), words = c("New York", "Los Angeles"))
Expand Down Expand Up @@ -75,4 +73,4 @@ data.table::rbindlist(words_found)
processor$replace_keys(sentences = c("I live in LA and I like NY", "Have you been in TX?"))
```

To see more details about the performance of the algorithm, click [here](https://github.com/AbrJA/rflashtext_benchmark.git).
To see more details about the performance of the algorithm, click [here](https://github.com/AbrJA/rflashtext_benchmark).
30 changes: 6 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

<!-- badges: start -->

[![R-CMD-check](https://github.com/AbrJA/rflashtext/workflows/R-CMD-check/badge.svg)](https://github.com/AbrJA/rflashtext/actions)
[![Grand-total](https://cranlogs.r-pkg.org/badges/grand-total/rflashtext)](https://cran.r-project.org/web/packages/rflashtext/index.html)
[![Per-month](https://cranlogs.r-pkg.org/badges/rflashtext)](https://cran.r-project.org/web/packages/rflashtext/index.html)
[![R-CMD-check](https://github.com/AbrJA/rflashtext/workflows/R-CMD-check/badge.svg)](https://cran.r-project.org/web/checks/check_results_rflashtext.html)
[![Grand-total](https://cranlogs.r-pkg.org/badges/grand-total/rflashtext)](https://github.com/AbrJA/rflashtext/actions)
[![Per-month](https://cranlogs.r-pkg.org/badges/rflashtext)](https://CRAN.R-project.org/package=rflashtext)
<!-- badges: end -->

*rflashtext* **can be used to find and replace words in a given text
Expand All @@ -20,8 +20,7 @@ python library [flashtext](https://github.com/vi3k6i5/flashtext).
## Installation

You can install the released version of rflashtext from
[CRAN](https://cran.r-project.org/web/packages/rflashtext/index.html)
with:
[CRAN](https://CRAN.R-project.org/package=rflashtext) with:

``` r
install.packages("rflashtext")
Expand All @@ -31,7 +30,7 @@ And the development version from
[GitHub](https://github.com/AbrJA/rflashtext) with:

``` r
# install.packages("devtools")
install.packages("devtools")
devtools::install_github("AbrJA/rflashtext")
```

Expand All @@ -42,23 +41,6 @@ This is a basic example which shows you how to use the API:
### New processor

``` r
devtools::install_github("AbrJA/rflashtext@rcpp")
#> Using github PAT from envvar GITHUB_PAT
#> Downloading GitHub repo AbrJA/rflashtext@rcpp
#>
#> ── R CMD build ─────────────────────────────────────────────────────────────────
#> checking for file ‘/tmp/RtmpadfmoT/remotes952d7a4d20/AbrJA-rflashtext-01473d2/DESCRIPTION’ ... ✔ checking for file ‘/tmp/RtmpadfmoT/remotes952d7a4d20/AbrJA-rflashtext-01473d2/DESCRIPTION’
#> ─ preparing ‘rflashtext’:
#> checking DESCRIPTION meta-information ... ✔ checking DESCRIPTION meta-information
#> ─ cleaning src
#> ─ checking for LF line-endings in source and make files and shell scripts
#> ─ checking for empty or unneeded directories
#> ─ building ‘rflashtext_0.1.0.tar.gz’
#>
#>
#> Installing package into '/home/ajaimes/R/x86_64-pc-linux-gnu-library/4.2'
#> (as 'lib' is unspecified)

library(rflashtext)

processor <- KeywordProcessor$new(keys = c("NY", "LA"), words = c("New York", "Los Angeles"))
Expand Down Expand Up @@ -115,4 +97,4 @@ processor$replace_keys(sentences = c("I live in LA and I like NY", "Have you bee
```

To see more details about the performance of the algorithm, click
[here](https://github.com/AbrJA/rflashtext_benchmark.git).
[here](https://github.com/AbrJA/rflashtext_benchmark).

0 comments on commit 4195eb3

Please sign in to comment.