char_to_free

0th

Percentile

Convert character vectors to free objects

Convert character vectors to free objects

Usage
char_to_matrix(x)
Arguments
x

A character vector

Details

Function char_to_matrix() gives very basic conversion between character vectors and free objects. Current functionality is limited to strings like “aaabaacd”, which would give \(a^3ba^2cd\). It would be nice to take a string like “a^3b^(-3)” but this is not yet implemented.

Function char_to_free() is a vectorized version that coerces output to free.

Note

The function is not robust; for example, passing anything other than lower-case letters a-z will give possibly undesirable behaviour.

Function char_to_free() is consistent with the default print options (which are that the symbols are the lowercase letters a-z). If you change the the symbols' names, for example options(symbols=sample(letters)), then things can get confusing. The print method does not change the internal representation of a free object, which is a list of integer matrices.

See Also

print.free

Aliases
  • char_to_free
  • char_to_matrix
Examples
# NOT RUN {
char_to_matrix("aaabacdcd")

rfree(10,3) + as.free('xxxxxxxxxxxx')

as.free(letters)*7

as.free('')  # identity element



# }
Documentation reproduced from package freegroup, version 1.1-0, License: GPL-2

Community examples

Looks like there are no examples yet.