ph_search: Search phones

View source: R/search.R

ph_searchR Documentation

Description

Given a vector of phonetised strings, find phones.

Usage

ph_search(phlist, phonex)

Arguments

phlist

The output of phonetise().

phonex

A phonetic expression. Supported shorthands are C for consonant, V for vowel, and ⁠#⁠ for word boundary.

Value

A list.

Examples

ipa <- c("p\u02B0a\u0303k\u02B0", "t\u02B0um\u0325", "\u025Bk\u02B0\u026F", "pun")
ph <- c("p\u02B0", "t\u02B0", "k\u02B0", "a\u0303", "m\u0325")
ipa_ph <- phonetise(ipa, multi = ph)
ph_search(ipa_ph, "#CV")

# partial matches are also returned
ph_search(ipa_ph, "p")

# use regular expressions
ph_search(ipa_ph, "p\u02B0?V")

phonetisr documentation built on April 3, 2025, 10:49 p.m.