align_phones: Align two sequences of phonemes using global alignment

View source: R/align-phones.R

align_phonesR Documentation

Align two sequences of phonemes using global alignment

Description

The algorithm used here is based on the Needleman-Wunsch algorithm.

Usage

align_phones(
  a,
  b,
  fun_match = phone_match_exact,
  indel_create = -2,
  indel_extend = -1
)

Arguments

a, b

two sequences of phonemes to align

fun_match

function to compute the similarity scores for each phoneme

indel_create

penalty for creating a gap

indel_extend

penalty for extending a gap by one step

Value

a list with the class phone_alignment with information about the matching

Examples

# Kiss the sky and kiss this guy
a <- c("k", "I", "s", "dh", "4", "s", "k", "@I") |> wiscbet_to_ipa()
b <- c("k", "I", "s", "dh", "I", "s", "g", "@I") |> wiscbet_to_ipa()
align_phones(a, b)

tjmahr/alignphone documentation built on June 11, 2025, 2:17 p.m.