get_neighbors: Get phonological neighbors

Description Usage Arguments Value Examples

View source: R/competitors.R

Description

Phonological neighbors are items which can be converted to the target by one add, delete and substitute operation

Usage

1
2
3
4
5
6
7
8
get_neighbors(
  target,
  lexicon,
  neighbors = "das",
  sep = " ",
  form = FALSE,
  count = FALSE
)

Arguments

target

Character string containing a target word

lexicon

Character vector containing the lexical database

neighbors

(get_neighbors only) Character vector specifying the type of neighbor to return. Return the delete, add, substitute neighbors of the target when 'd', 'a', and/or 's' is in neighbors respectively

sep

Separator in target and lexicon

form

Whether to return words in lexicon

count

Whether to return count of words

Value

the indexes of the competitors in the lexical database

Examples

1
2
3
get_neighbors("AA R K", c("AA R K", "AA R", "B AA B"), "d")
get_neighbors("AA R K", c("AA R K", "AA R", "B AA B"), "da")
get_neighbors("AA R K", c("AA R K", "AA R", "B AA B"), "das")

LexFindR documentation built on Oct. 29, 2021, 9:07 a.m.