Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

read.hyph.pat

Reading patgen-compatible hyphenation pattern files


Description

This function reads hyphenation pattern files, to be used with hyphen.

Usage

read.hyph.pat(file, lang, fileEncoding = "UTF-8")

Arguments

file

A connection or character string with a valid path to a file with hyphenation patterns (one pattern per line).

lang

A character string, usually two letters short, naming the language the patterns are meant to be used with (e.g. "es" for Spanish).

fileEncoding

A character string defining the character encoding of the file to be read. Unless you have a really good reason to do otherwise, your pattern files should all be UTF-8 encoded.

Details

Hyphenation patterns that can be used are available from CTAN[1]. But actually any file with only the patterns themselves, one per line, should work.

The language designation is of no direct consequence here, but if the resulting pattern object is to be used by other functions in this package or koRpus, it should resamble the designation that's used for the same language there.

Value

An object of class kRp.hyph.pat.

References

See Also

Examples

## Not run: 
read.hyph.pat("~/patterns/hyph-en-us.pat.txt", lang="en_us")

## End(Not run)

sylly

Hyphenation and Syllable Counting for Text Analysis

v0.1-6
GPL (>= 3)
Authors
Meik Michalke [aut, cre]
Initial release
2020-09-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.