wort | R Documentation |
Most humdrum datasets which include lyrics, include them in a **silbe
spine, representing each syllable from the lyrics on
one so they line up with notes in the music.
Syllables from multi-syllabic words are connected with -
markers at the end of the first syllable, beginning of the last syllable
and both beginning and end of medial syllables.
The wort()
command translates this syllable representation to words, simply collapsing them together.
The resulting word is aligned with the first syllable of each word in **silbe
.
If wort()
is applied to a humdrumR data class
you may use the data's fields as arguments.
If no field names are specified, the first selectedField is used as x
.
## S3 method for class 'character'
wort(
x,
...,
sep = "-",
keep.sep = TRUE,
number.syllables = FALSE,
groupby = list(),
Exclusive = NULL,
multiDispatch = FALSE
)
humData |> select(Token) |> wort()
humData |> wort(Token)
wort(
x,
...,
sep = "-",
keep.sep = TRUE,
number.syllables = FALSE,
groupby = list(),
Exclusive = NULL,
multiDispatch = FALSE
)
x |
A vector of exclusive intepretations to control dispatch. Defaults to Must be |
sep |
What separator is in input and/or output. Defaults to Must be a single, non-empty |
keep.sep |
Should syllable separators be kept in output? Defaults to Must be a singleton |
number.syllables |
Should output show words with numbered syllables? Defaults to Must be a singleton |
groupby |
Optional vectors to group words within. Defaults to Must be a |
If a non-null Exclusive
argument is provided, wort()
will only apply where Exclusive == "silbe"
.
When used in a withinHumdrum()
call, wort()
will by automally passed the Exclusive
field from the humdrum
data, as well as groupby = list(Piece, Spine, Path)
, so that words are not collapsed across pieces/spines/paths.
The output of wort()
is always the same length as the input.
Any collapsed syllables are replaced by the **silbe
melisma marker, "_"
.
If number.syllables = TRUE
, the whole word is repeated for each syllable, but with each numbered
in square brackets: e.g., c("yesterday[1], "yesterday[2]", "yesterday[3]", "yesterday[4]")
. This
format is seen a lot in computational linguistics.
By default, the syllable separators are retained in the collapsed output: this makes it possible to recreate the syllables if
necessary.
Any mid-word melismas (indicated by "_"
) are kept collapsed as well, for the same reason.
However, if keep.sep = TRUE
, seperators (and mid-word melismas) are removed, making the function non invertible (you can't easily get
back to the syllables).
wort(c('now', 'let', 'me', 'wel-', '-come', 'ev-', '-ery-', '-bo-','-dy', 'to', 'the', 'wild', 'wild', 'west'))
wort(c('now', 'let', 'me', 'wel-', '-come', 'ev-', '-ery-', '-bo-','-dy', 'to', 'the', 'wild', 'wild', 'west'),
keep.sep = FALSE)
wort(c('now', 'let', 'me', 'wel-', '-come', 'ev-', '-ery-', '-bo-','-dy', 'to', 'the', 'wild', 'wild', 'west'),
keep.sep = FALSE, number.syllables = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.