Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/aggregation-helper-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ order_ipa <- function(strings, keep_stars=FALSE, keep_brackets=TRUE) {
## If a diacritic comes right after a modifier letter, swap their order
while (stri_detect_fixed(typestring, "MD")) {
Comment thread
drammock marked this conversation as resolved.
Outdated
ix <- stri_locate_first_fixed(typestring, "MD")[1]
Comment thread
drammock marked this conversation as resolved.
if (string[ix] %in% clicks) break
if (ix == 1) neworder <- c(2, 1, 3:lenstr)
else if (ix == lenstr-1) neworder <- c(1:(ix-1), ix+1, ix)
else neworder <- c(1:(ix-1), ix+1, ix, (ix+2):lenstr)
Expand All @@ -312,7 +313,7 @@ order_ipa <- function(strings, keep_stars=FALSE, keep_brackets=TRUE) {
for (row in seq_len(dim(ixs)[1])) {
span <- ixs[row,1]:ixs[row,2]
mods <- string[span]
string[span] <- modifiers[modifiers %in% mods]
string[span] <- c(clicks, modifiers)[c(clicks, modifiers) %in% mods]
Comment thread
drammock marked this conversation as resolved.
} }
## Put sequences of diacritics in canonical order
if (stri_detect_fixed(typestring, "DD")) {
Expand Down
Loading