MarkovAlgorithmLibrary "MarkovAlgorithm"
Markov algorithm is a string rewriting system that uses grammar-like rules to operate on strings of
symbols. Markov algorithms have been shown to be Turing-complete, which means that they are suitable as a
general model of computation and can represent any mathematical expression from its simple notation.
~ wikipedia
.
reference:
en.wikipedia.org
rosettacode.org
parse(rules, separator)
Parameters:
rules (string)
separator (string)
Returns: - `array _rules`: List of rules.
---
Usage:
- `parse("|0 -> 0|| 1 -> 0| 0 -> ")`
apply(expression, rules)
Aplies rules to a expression.
Parameters:
expression (string) : `string`: Text expression to be formated by the rules.
rules (rule ) : `string`: Rules to apply to expression on a string format to be parsed.
Returns: - `string _result`: Formated expression.
---
Usage:
- `apply("101", parse("|0 -> 0|| 1 -> 0| 0 -> "))`
apply(expression, rules)
Parameters:
expression (string)
rules (string)
Returns: - `string _result`: Formated expression.
---
Usage:
- `apply("101", parse("|0 -> 0|| 1 -> 0| 0 -> "))`
rule
String pair that represents `pattern -> replace`, each rule may be ordinary or terminating.
Fields:
pattern (series string) : Pattern to replace.
replacement (series string) : Replacement patterns.
termination (series bool) : Termination rule.
Parser
functionStringToMatrixLibrary "functionStringToMatrix"
Provides unbound methods (no error checking) to parse a string into a float or int matrix.
to_matrix_float(str, interval_sep, start_tk, end_tk)
Parse a string into a float matrix.
Parameters:
str : , string, the formated string to parse.
interval_sep : , string, cell interval separator token.
start_tk : , string, row start token.
end_tk : , string, row end token.
Returns: matrix, parsed float matrix.
to_matrix_int(str, interval_sep, start_tk, end_tk)
Parse a string into a int matrix.
Parameters:
str : , string, the formated string to parse.
interval_sep : , string, cell interval separator token.
start_tk : , string, row start token.
end_tk : , string, row end token.
Returns: matrix, parsed int matrix.