Home | Trees | Indices | Help |
---|
|
Replace value-defining segments in text with their values.
Author: Chusslove Illich (Часлав Илић) <caslav.ilic@gmx.net>
License: GPLv3
Functions | |||
(string, [string...], [string...]) |
|
||
string |
|
||
string, int, bool |
|
||
string |
|
||
string |
|
||
|
|||
|
|||
|
|||
string |
|
||
string |
|
||
string |
|
||
(cat) -> numerr
|
|
Variables | |
DEFAULT_ALTHEAD =
|
|
__package__ =
|
Function Details |
Replace XML entities in the text with their values. Entity values are defined by the supplied dictionary of name-value
pairs. Not all entities need to be replaced, some can be explicitly
ignored. If an entity is neither defined nor ignored, a warning will be
reported to standard output if An undefined entity is by default left untouched in the resulting
text. Instead, the parameter
|
As resolve_entities, but returns only the resolved text.
See Also: resolve_entities |
Replace alternatives directives in the text with the selected alternative. Alternatives directives are of the form I see a ~@/pink/white/ elephant. where Alternative directive is resolved into one of the alternative
substrings by given index of the alternative (one-based). Before
substituting the directive, the selected alternative can be filtered
through function given by If an alternatives directive is malformed (e.g. to little alternatives), it may be reported to standard output. Unless all encountered directives were well-formed, the original text is returned instead of the partially resolved one.
|
As resolve_alternatives, but return only the resolved text.
See Also: resolve_alternatives |
Change case of the first letter in the text. Text may also have alternatives directives (see resolve_alternatives). In that case, if the first letter is found within an alternative, change cases for first letters in other alternatives of the same directive too. If lowercasing is requested, it is not done if both the first and the second letter are uppercase (e.g. acronyms, all-caps writting).
See Also: resolve_alternatives |
Uppercase the first letter in the text. A shortcut for first_to_case for uppercasing. See Also: first_to_case |
Lowercase the first letter in the text. A shortcut for first_to_case for lowercasing. See Also: first_to_case |
Expand variables in the text. Expansion directives start with a directive head ( Some examples: expand_vars("Mary had a little %mammal.", {"mammal":"lamb"}) expand_vars("Quite a %{critic}esque play.", {"critic":"burl"}) expand_vars("Lost in single ~A.", {"A":"parenthesis"}, "~") Dictionary values are filtered as
|
Remove accelerator from the text. Accelerator markers are characters which determine which letter in the
text will be used as keyboard accelerator in user interface. They are
usually a single non-alphanumeric character, and inserted before the
letter which should be the accelerator, e.g. This function will try to remove the accelerator in a smart way. E.g.
it will ignore ampersand in If
|
Remove format directives from the text. Format directives are used to substitute values in the text. An example text with directives in several formats: "%d men on a %s man's chest." # C "%(num)d men on a %(attrib)s man's chest." # Python "%1 men on a %2 man's chest." # KDE/Qt Format is specified by a string keyword. The following formats are
known at the moment:
|
Remove literal substrings from the text. Literal substrings are URLs, email addresses, web site names, command options, etc. This function will heuristically try to remove such substrings from the text. Additional literals to remove may be specified as verbatim substrings
(
|
Convert plural forms in the catalog [hook factory].
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Jul 24 21:00:27 2014 | http://epydoc.sourceforge.net |