HFST - Helsinki Finite-State Transducer Technology - C++ API
version 3.9.1
|
A namespace for HFST xeroxRules functions and data types. More...
Classes | |
class | Rule |
A rule that contains mapping and context and replace type (if any). If rule is A -> B || L _ R , than mapping is cross product of transducers A and B, context is pair of transducers L and R, and replType is enum REPL_UP. More... | |
Functions | |
HfstTransducer | applyBoundaryMark (const HfstTransducer &t) |
It applies boundary marker from contexts (.#.) to t. More... | |
HfstTransducer | bracketedReplace (const Rule &rule, bool optional) |
Unconditional replace, in multiple contexts first: (.* T<a:b>T .*) - [( .* L1 T<a:b>T R1 .*) u (.* L2 T<a:b>T R2 .*)...], where .* = [I:I (+ {tmpMarker (T), <,>} in alphabet) | <a:b>]* then: remove tmpMarker from transducer and alphabet, and do negation: .* - result from upper operations. More... | |
HfstTransducer | constraintComposition (const HfstTransducer &t, const HfstTransducer &Constraint) |
Generalized Lenient Composition (by Anssi Yli-Jyr�) of a t and a Constraint. More about this composition can be found in: http://www.ling.helsinki.fi/users/aylijyra/all/YliJyra-2008b:trafropar:inp.pdf. More... | |
HfstTransducer | decodeFlagDiacritics (const HfstTransducer &tr) |
In the transducer , change back all "non-special" flag diacritics to normal, functional flag diacritics It means that $ sign will be changed to @ sign ie. $P.FOO.BAR$ will be changed into .FOO.BAR More... | |
HfstTransducer | encodeFlagDiacritics (const HfstTransducer &tr) |
In the transducer , change all flag diacritics to "non-special" multichar symbols It means that @ sign will be changed to $ sign ie. .FOO.BAR@ will be changed into $P.FOO.BAR$. More... | |
HfstTransducer | expandContextsWithMapping (const HfstTransducerPairVector &ContextVector, const HfstTransducer &mappingWithBracketsAndTmpBoundary, const HfstTransducer &identityExpanded, ReplaceType replType, bool optional) |
It is used in bracketedReplace, when the replace expression has context. Cr' = (Rc .*) << Markers (<,>,|) .o. [I:I | <a:b>]* Cr = Cr | Cr' (same for left context, (.* Cl)) More... | |
void | insertFreelyAllTheBrackets (HfstTransducer &t, bool optional) |
If optional is false, the function freely inserts in t @ and If it is true, it also inserts @ and More... | |
HfstTransducer | parallelBracketedReplace (const std::vector< Rule > &ruleVector, bool optional) |
Bracketed replace for parallel rules. More... | |
HfstTransducer | removeMarkers (const HfstTransducer &tr) |
Remove makers used in replace functions from a tr. Additionally, decode flag diacritics. More... | |
A namespace for HFST xeroxRules functions and data types.
HfstTransducer applyBoundaryMark | ( | const HfstTransducer & | t | ) |
It applies boundary marker from contexts (.#.) to t.
[0:.#. | ? - .#.]* .o. tr., ie. a -> b || .#. _ ; .o. .#. (? - .#.)* .#. .o. [.#.:0 | ? - .#.]*
HfstTransducer bracketedReplace | ( | const Rule & | rule, |
bool | optional | ||
) |
Unconditional replace, in multiple contexts first: (.* T<a:b>T .*) - [( .* L1 T<a:b>T R1 .*) u (.* L2 T<a:b>T R2 .*)...], where .* = [I:I (+ {tmpMarker (T), <,>} in alphabet) | <a:b>]* then: remove tmpMarker from transducer and alphabet, and do negation: .* - result from upper operations.
Also note that context is expanded in this way: Cr' = (Rc .*) << Markers (<,>,|) .o. [I:I | <a:b>]* Cr = Cr | Cr' (same for left context, (.* Cl))
HfstTransducer constraintComposition | ( | const HfstTransducer & | t, |
const HfstTransducer & | Constraint | ||
) |
Generalized Lenient Composition (by Anssi Yli-Jyr�) of a t and a Constraint. More about this composition can be found in: http://www.ling.helsinki.fi/users/aylijyra/all/YliJyra-2008b:trafropar:inp.pdf.
HfstTransducer decodeFlagDiacritics | ( | const HfstTransducer & | tr | ) |
In the transducer , change back all "non-special" flag diacritics to normal, functional flag diacritics It means that $ sign will be changed to @ sign ie. $P.FOO.BAR$ will be changed into .FOO.BAR
HfstTransducer encodeFlagDiacritics | ( | const HfstTransducer & | tr | ) |
In the transducer , change all flag diacritics to "non-special" multichar symbols It means that @ sign will be changed to $ sign ie. .FOO.BAR@ will be changed into $P.FOO.BAR$.
HfstTransducer expandContextsWithMapping | ( | const HfstTransducerPairVector & | ContextVector, |
const HfstTransducer & | mappingWithBracketsAndTmpBoundary, | ||
const HfstTransducer & | identityExpanded, | ||
ReplaceType | replType, | ||
bool | optional | ||
) |
It is used in bracketedReplace, when the replace expression has context. Cr' = (Rc .*) << Markers (<,>,|) .o. [I:I | <a:b>]* Cr = Cr | Cr' (same for left context, (.* Cl))
void insertFreelyAllTheBrackets | ( | HfstTransducer & | t, |
bool | optional | ||
) |
If optional is false, the function freely inserts in t @ and If it is true, it also inserts @ and
HfstTransducer parallelBracketedReplace | ( | const std::vector< Rule > & | ruleVector, |
bool | optional | ||
) |
Bracketed replace for parallel rules.
HfstTransducer removeMarkers | ( | const HfstTransducer & | tr | ) |
Remove makers used in replace functions from a tr. Additionally, decode flag diacritics.