allPairs: Produce a list of all sound correspondences and all pairs in...

Description Usage Arguments Details Value See Also Examples

Description

Take all segment-to-segment correspondences in the dataset, and produce for each a section composed of a title, a contingency table of all renderings of the given segment, and subsections listing all word pairs in which the given rendering is attested, all nicely formatted.

Usage

1
allPairs(data, file, count, unit, direction, cols, formatter, ...)

Arguments

data

[character] The dataset. Only datasets with two languages are supported.

file

[character] Name of the file to write the formatted list to. If NULL, the output will be printed to the screen. Defaults to NULL.

count

[character] Report the absolute number of times or words, or relative to how many times or in how many words the given segments co-occur in L1 or L2. Accepted values are "a(bs(olute))" and "r(el(ative))". Defaults to "a".

unit

[character] Count how many times a correspondence occurs or in how many words it occurs. Accepted values are "o(cc(ur(ence(s))))" and "w(or(d(s)))". Defaults to "w".

direction

[integer] If 1, correspondences are in the order Language1 > Language2 ("x yields y"). If 2, the order is Language2 < Language1 ("y originates from x"). Defaults to 1.

cols

[character vector] Which columns of the dataset to print. Can be a vector of names, "aligned" (the two columns with segmented, aligned words), or "all" (all columns). Defaults to "aligned".

formatter

[function] The function to which to pass unformatted data. Available formatters are: formatter.none, formatter.html, and formatter.latex. Defaults to formatter.none.

...

Additional arguments passed to formatter.

Details

summary.soundcorrs can produce a table of all segment-to-segment correspondences in a dataset, and findExamples and findPairs can find all the pairs of words which realize those correspondences, but combining their outputs is a time-consuming, and unnecessary manual labour. The same, or at least a very similar result can be produced automatically by this function. Its output is divided into sections, each comprised of the appropriate slice of the contingency table, and a list of all the examples which are relevant for the given correspondence. The output can be raw, or formatted as LaTeX or HTML, and it is not too difficult to write one's own, custom formatting function.

Value

[character] A formatted list of of all segment-to-segment correspondences and all pairs in which they are attested.

See Also

findPairs, summary.soundcorrs

Examples

1
2
3
dataset <- loadSampleDataset ("data-abc")
allPairs (dataset)
allPairs (dataset, formatter=formatter.latex, cols=c("ORTHOGRAPHY.L1", "ORTHOGRAPHY.L2"))

soundcorrs documentation built on Nov. 16, 2020, 5:09 p.m.