-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.qmd
75 lines (52 loc) · 1.93 KB
/
README.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
format: gfm
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r}
#| echo: false
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# syllabifyr <img src="man/figures/logo.png" align="right" />
<!-- badges: start -->
[![R-CMD-check](https://github.com/JoFrhwld/syllabifyr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/JoFrhwld/syllabifyr/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/syllabifyr)](https://CRAN.R-project.org/package=syllabifyr)
[![DOI](https://zenodo.org/badge/139162633.svg)](https://zenodo.org/badge/latestdoi/139162633)
<!-- badges: end -->
The goal of `syllabifyr` is to provide tidy syllabification of phonetic transcriptions. So far, only CMU dict transcriptions are supported.
I've largely utilized the same approach as [Kyle Gorman's python implementation](https://github.com/kylebgorman/syllabify)
## Installation
`syllabifyr` is now on Cran
```{r cran-install}
#| eval: false
install.packages("syllabifyr")
```
You can also install `syllabifyr` from github with:
```{r gh-installation}
#| eval: false
# install.packages("devtools")
devtools::install_github("JoFrhwld/syllabifyr")
```
## Example
```{r example}
library(syllabifyr)
syllabify("AO0 S T R EY1 L Y AH0")
syllabify(c("AO0", "S", "T", "R", "EY1", "L", "Y", "AH0"))
```
```{r tidy_example, message = F}
#| message: false
library(tidyverse)
syllabficiation <- tribble(~word, ~transcription,
"Alaska", "AH0 L AE1 S K AH0",
"constraint", "K AH0 N S T R EY1 N T",
"canyon", "K AE1 N Y AH0 N",
"value", "V AE1 L Y UW0")%>%
mutate(syllable_df = map(transcription, syllabify))
syllabficiation$syllable_df[[1]]
syllabficiation$syllable_df[[2]]
syllabficiation$syllable_df[[3]]
syllabficiation$syllable_df[[4]]
```