10 #ifndef GUARD_hfst_xerox_rules_h
11 #define GUARD_hfst_xerox_rules_h
26 enum ReplaceType {REPL_UP, REPL_DOWN, REPL_RIGHT, REPL_LEFT};
30 enum ReplaceArrow { E_REPLACE_RIGHT,
31 E_OPTIONAL_REPLACE_RIGHT,
33 E_OPTIONAL_REPLACE_LEFT,
34 E_REPLACE_RIGHT_MARKUP,
63 ReplaceType get_replType()
const;
67 friend std::ostream& operator<<(std::ostream &out,
const Rule &r);
96 float zero_weight(
float f);
117 ReplaceType replType,
231 HfstTransducer replace(
const std::vector<Rule> &ruleVector,
bool optional);
235 HfstTransducer replace_left(
const std::vector<Rule> &ruleVector,
bool optional);
239 HfstTransducer replace_leftmost_longest_match(
const std::vector<Rule> &ruleVector );
244 HfstTransducer replace_rightmost_longest_match(
const std::vector<Rule> &ruleVector );
248 HfstTransducer replace_leftmost_shortest_match(
const std::vector<Rule> &ruleVector );
250 HfstTransducer replace_rightmost_shortest_match(
const std::vector<Rule> &ruleVector );
271 HfstTransducer replace_epenthesis(
const std::vector<Rule> &ruleVector,
bool optional);
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 ...
Definition: HfstXeroxRules.cc:387
HfstTransducer decodeFlagDiacritics(const HfstTransducer &tr)
In the transducer , change back all "non-special" flag diacritics to normal, functional flag diacriti...
Definition: HfstXeroxRules.cc:228
Declarations of HFST API functions and datatypes.
HfstTransducer removeMarkers(const HfstTransducer &tr)
Remove makers used in replace functions from a tr. Additionally, decode flag diacritics.
Definition: HfstXeroxRules.cc:288
HfstTransducer parallelBracketedReplace(const std::vector< Rule > &ruleVector, bool optional)
Bracketed replace for parallel rules.
Definition: HfstXeroxRules.cc:851
HfstTransducer encodeFlagDiacritics(const HfstTransducer &tr)
In the transducer , change all flag diacritics to "non-special" multichar symbols It means that @ sig...
Definition: HfstXeroxRules.cc:184
A synchronous finite-state transducer.
Definition: HfstTransducer.h:253
HfstTransducer applyBoundaryMark(const HfstTransducer &t)
It applies boundary marker from contexts (.#.) to t.
Definition: HfstXeroxRules.cc:2187
ImplementationType
The type of an HfstTransducer.
Definition: HfstDataTypes.h:41
std::vector< HfstTransducer > HfstTransducerVector
a vector of transducers for methods applying a cascade of automata
Definition: HfstDataTypes.h:33
A rule that contains mapping and context and replace type (if any). If rule is A -> B || L _ R ...
Definition: HfstXeroxRules.h:45
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 ...
Definition: HfstXeroxRules.cc:355
std::pair< HfstTransducer, HfstTransducer > HfstTransducerPair
A pair of transducers.
Definition: HfstDataTypes.h:78
std::vector< HfstTransducerPair > HfstTransducerPairVector
A vector of transducer pairs.
Definition: HfstDataTypes.h:82
HfstTransducer constraintComposition(const HfstTransducer &t, const HfstTransducer &Constraint)
Generalized Lenient Composition (by Anssi Yli-Jyr�) of a t and a Constraint. More about this composi...
Definition: HfstXeroxRules.cc:324
HfstTransducer bracketedReplace(const Rule &rule, bool optional)
Unconditional replace, in multiple contexts first: (.* T
T .*) - [( .* L1 TT R1 ...Definition: HfstXeroxRules.cc:575