Learn R Programming

lingdist: Fast Linguistic Distance and Alignment Computation

lingdist is a fast generalized edit distance and string alignment computation mainly for linguistic aims. As a generalization to the classic edit distance algorithms, the package allows users to define custom cost for every symbol's insertion, deletion, and substitution. The package also allows character combinations in any length to be seen as a single symbol which is very useful for International Phonetic Alphabet (IPA) transcriptions with diacritics. In addition to edit distance result, users can get detailed alignment information such as all possible alignment scenarios between two strings which is useful for testing, illustration or any further usage. Either the distance matrix or its long table form can be obtained and tools to do such conversions are provided. All functions in the package are implemented in C++ and the distance matrix computation is parallelized leveraging the RcppThread package.

Copy Link

Version

Install

install.packages('lingdist')

Monthly Downloads

133

Version

1.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Chao Kong

Last Published

October 12th, 2023

Functions in lingdist (1.0)

lingdist-package

lingdist: Fast Linguistic Distance and Alignment Computation
edit_dist_string

Compute edit distance between two strings
edit_dist_df

Compute edit distance between all row pairs of a dataframe
long2squareform

Convert long table to square form
check_cost_defined

Check whether there's missing characters in the cost matrix.
generate_default_cost_matrix

Generate a default cost matrix