syn

syn - the thesaurus

https://github.com/njtierney/syn

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 3 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.0%) to scientific vocabulary

Keywords

antonyms ozunconf18 r r-package rstats synonyms text-processing thesaurus unconf
Last synced: 6 months ago · JSON representation

Repository

syn - the thesaurus

Basic Info
Statistics
  • Stars: 52
  • Watchers: 5
  • Forks: 4
  • Open Issues: 10
  • Releases: 2
Topics
antonyms ozunconf18 r r-package rstats synonyms text-processing thesaurus unconf
Created almost 8 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog Code of conduct

README.Rmd

---
output: github_document
---



```{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)
```

# syn 


[![R-CMD-check](https://github.com/njtierney/syn/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/njtierney/syn/actions/workflows/R-CMD-check.yaml)
[![Coverage status](https://codecov.io/gh/ropenscilabs/syn/branch/master/graph/badge.svg)](https://app.codecov.io/github/ropenscilabs/syn?branch=master)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/syn)](https://cran.r-project.org/package=syn)
[![CRAN Logs](http://cranlogs.r-pkg.org/badges/syn)](https://CRAN.R-project.org/package=syn)




`syn` is a **zero dependency** R package that lists synonyms and antonyms.

There are two main functions:

- `syn("great")` Returns synonyms of "great"
- `ant("great")` Returns antonyms of "great".

`syn` and `ant` take one word as input. To return synonyms for many words, use the plural form: `syn`**s**, and `ant`**s** 

- `syns(c("great", "excellent")` Returns named list of synonyms of "great", and "excellent"
- `ants(c("great", "excellent")` Returns named list of antonyms of "great", and "excellent"

## Example: Synonyms for "cool"

The `syn` function returns all synonyms for a given word:

Let's look at synonyms for "cool":

```{r example, message = FALSE, warnings = FALSE}
library(syn)

syn_cool <- syn("cool")

head(syn_cool)
tail(syn_cool)
```

Wow, there are a lot! How many are there?

```{r length-syn-cool}
length(syn_cool)
```

Wow! There are `r length(syn_cool)` synonyms for cool. That's...`r syn("cool", 1)`, I guess.

You can also provide it a number of words to return with the `n_words` argument, which will randomly select the number of words given

```{r syn-awesome-one}
syn("awesome", 1)
syn("awesome", 2)
syn("awesome", 5)
```


## Example: Creating a sentence

OK cool, let's use these in a sentence, using the `glue` package. Which of these better?

```{r example-syn-glue}

glue::glue("This is really cool!")
glue::glue("This is really {syn('cool', 1)}!")
glue::glue("This is really {syn('cool', 10)}!")
```

## Using multiple words with `syns`

You can generate synonyms for multiple words with the `syns` function. This takes a vector of words, returning a named list

```{r example-syns}
syns_good_evil <- syns(c("good", "evil"))
str(syns_good_evil)
```

You can also provide `n_words` for `syns`, and it will return a random selection of the words of that number.

```{r syns-n-words}
syns(c("good", "evil"),
     n_words =  10)
```

## Example: Antonyms (under development)

To create antonyms, use `ant` and `ants`, which have the same inputs as `syn`. However, at this stage, the number of antonyms available for use by `ant` is small.

```{r ant-n-words}
ant("good")
ant("good",1)

ant("strong")
```

```{r ants-n-words}
ants(c("good", "evil"))

ants(c("good", "evil"), n_words = 5)

ants(c("strong", "weak"))
```

## Example: Filtering by the number of words in a synonym

Let's say that you want to filter something down to those synonyms that only contain one word. You can use the `n_words` argument, which calculates the number of words for each 

```{r one-word-only}
syn_end <- syn("end")

n_words(syn_end)
syn_end_l1 <- syn_end[n_words(syn_end) <= 1]
syn_end_l1
```



## Code of Conduct

Please note that the syn project is released with a [Contributor Code of Conduct](http://syn.njtierney.com/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.

Owner

  • Name: Nicholas Tierney
  • Login: njtierney
  • Kind: user
  • Location: lutruwita (Tasmania)
  • Company: Freelancer

|| Freelance Statistician and Research Software Engineer | PhD Statistics | Hiker | Runner | Coffee Geek ||

GitHub Events

Total
  • Issues event: 3
  • Watch event: 1
  • Delete event: 1
  • Issue comment event: 1
  • Push event: 1
Last Year
  • Issues event: 3
  • Watch event: 1
  • Delete event: 1
  • Issue comment event: 1
  • Push event: 1

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 75
  • Total Committers: 3
  • Avg Commits per committer: 25.0
  • Development Distribution Score (DDS): 0.28
Past Year
  • Commits: 7
  • Committers: 1
  • Avg Commits per committer: 7.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Nicholas Tierney n****y@g****m 54
mike m****c@c****m 15
Amy Stringer a****r@c****u 6
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 47
  • Total pull requests: 12
  • Average time to close issues: 28 days
  • Average time to close pull requests: about 11 hours
  • Total issue authors: 5
  • Total pull request authors: 2
  • Average comments per issue: 1.38
  • Average comments per pull request: 1.17
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 0
  • Average time to close issues: less than a minute
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.5
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • njtierney (22)
  • sdhutchins (1)
  • maelle (1)
  • qomhmd (1)
  • coolbutuseless (1)
Pull Request Authors
  • coolbutuseless (3)
  • njtierney (3)
Top Labels
Issue Labels
resources (1)
Pull Request Labels

Dependencies

DESCRIPTION cran
  • R >= 3.4.0 depends
  • covr * suggests
  • glue * suggests
  • spelling * suggests
  • testthat >= 2.1.0 suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/pr-fetch v1 composite
  • r-lib/actions/pr-push v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/test-coverage.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v1 composite