Learn R Programming

soundcorrs (version 0.1.1)

findSegments: Segments in relation to segments exhibiting a correspondence.

Description

Find pairs with a specific sound correspondence, and extract from them the segments which come before or after the segments exhibiting that correspondence.

Usage

findSegments(data, x, y, segment)

Arguments

data

[soundcorrs] The dataset in which to look. Only datasets with two languages are supported.

x

[character] The sequence to find in language1. May be a regular expression. If an empty string, anything will be considered a match.

y

[character] The sequence to find in language2. May be a regular expression. If an empty string, anything will be considered a match.

segment

[integer] Number of the segment to be returned, in relation to segments containing x and y. Defaults to 0.

Value

[list] Vectors for both languages, each of the same length as the dataset.

Examples

Run this code
# NOT RUN {
# In the examples below, non-ASCII characters had to be escaped for technical reasons.
# In actual usage, all soundcorrs functions accept characters from beyond ASCII.
dataset <- sampleSoundCorrsData.capitals
findPairs (dataset, "\u00E4", "e")  # a-diaeresis
findSegments (dataset, "\u00E4", "e")
findSegments (dataset, "\u00E4", "e", -1)
# }

Run the code above in your browser using DataLab