public class WideStringAlgebra extends StringAlgebra
StringAlgebra
in most ways. However, instead of a single binary concatenation
operation "*", the WideStringAlgebra defines a whole collection
of concatenation operations conc1, conc2, conc3, ... with arity
1, 2, 3, ...
The most direct way of writing a context-free grammar as an
IRTG is by using a WideStringAlgebra. For instance, the context-free rule
A -> B C D corresponds to an RTG rule A -> r(B,C,D)
with h(r) = conc3(?1, ?2, ?3). However, parsing with a WideStringAlgebra
takes time O(n^(r+1)), where r is the maximum arity of a concatenation
operation. It is therefore a good idea to binarize
the IRTG into an IRTG over a StringAlgebra (using a
StringAlgebraSeed) for O(n^3) parsing.
StringAlgebra.SpanCONCAT, SPECIAL_STAR| Constructor and Description |
|---|
WideStringAlgebra()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
TreeAutomaton |
decompose(List<String> value)
Computes a decomposition automaton for the given value.
|
String |
getBinaryConcatenation()
Returns the concatenation symbol for this algebra.
|
evaluate, getClassOfValues, getMaxChartSize, getSentenceLength, parseString, representAsStringgetAllAlgebraClasses, getSignature, hasOptions, readOptions, setOptions, visualize, writeOptionspublic WideStringAlgebra()
public TreeAutomaton decompose(List<String> value)
Algebradecompose in class StringAlgebrapublic String getBinaryConcatenation()
StringAlgebragetBinaryConcatenation in class StringAlgebraCopyright © 2017. All rights reserved.