Learn R Programming

calACS (version 2.2.2)

Calculations for All Common Subsequences

Description

Implements several string comparison algorithms, including calACS (count all common subsequences), lenACS (calculate the lengths of all common subsequences), and lenLCS (calculate the length of the longest common subsequence). Some algorithms differentiate between the more strict definition of subsequence, where a common subsequence cannot be separated by any other items, from its looser counterpart, where a common subsequence can be interrupted by other items. This difference is shown in the suffix of the algorithm (-Strict vs -Loose). For example, q-w is a common subsequence of q-w-e-r and q-e-w-r on the looser definition, but not on the more strict definition. calACSLoose Algorithm from Wang, H. All common subsequences (2007) IJCAI International Joint Conference on Artificial Intelligence, pp. 635-640.

Copy Link

Version

Install

install.packages('calACS')

Monthly Downloads

191

Version

2.2.2

License

GPL

Maintainer

Last Published

March 31st, 2016

Functions in calACS (2.2.2)

calACSStrict

Count the total number of all common subsequences between a string and a vector/list of strings. Subsequences cannot be interrupted by any item, i.e. q-w is not considered a subsequence of q-e-w-r due to the interrupting 'e'
longestVec

The function takes in multiple vectors of any length, and returns the one with the longest length. The tieBreaker variable controls if the first or the last of the longest vectors gets returned in case there are multiple
calACSLoose

Calculate the total number of all common subsequences between a string and a vector/list of strings. Subsequences can be interrupted by items, i.e. q-w is considered a subsequence of q-e-w-r
lenLCSStrict

Calculate the length of the longest common subsequence (KCS) between a string and a vector/list of strings. Subsequences cannot be interrupted by any item, i.e. q-w is not considered a subsequence of q-e-w-r due to the interrupting 'e'
lenACSStrict

Calculate the length of each common subsequences between a string and a vector/list of strings. Subsequences cannot be interrupted by any item, i.e. q-w is not considered a subsequence of q-e-w-r due to the interrupting 'e'