Home | Trees | Indices | Help |
---|
|
Constructors of syntagma derivators for trapnakron.
Trapnakron -- transcriptions and translation of names and acronyms --
is a collection of syntagma derivator definitions residing in
pology/lang/sr/trapnakron/
. Its purpose is to support
translation efforts in Serbian language, where proper nouns and acronyms
are frequently transcribed, and sometimes translated. For translators, it
can be a manual reference, or even directly sourced in translated
material (see below). For readers, it is a way to obtain original forms
of transcribed and translated phrases.
Trapnakron web pages are built based on trapnakron source in Pology.
This makes links between original and localized forms readily available
through internet search engines. Adding trapnakron
or
трапнакрон
keyword to the search phrase causes the relevant
trapnakron page to appear within top few hits, and the desired other form
will be shown already in the excerpt of the hit, such that is not even
necessary to follow it. This frees translators from the burden of
providing original forms in parenthesis to the first mentioning (or some
similar method), and frees the text of the clutter caused by this.
While trapnakron definitions may be manually collected and imported
into a basic Synder object, this module provides wrappers which free
the user of this manual work, as well as appropriate transformation
functions (*tf
parameters to Synder
constructor) to produce various special behaviors on lookups. Trapnakron
constructors are defined by type of textual material, e.g. for plain text
or Docbook documentation. Documentation of each constructor states what
special lookup behaviors will be available through Synder
objects created by it.
For a short demonstration, consider this derivation of a person's name:
钱学森, Qián Xuésēn, Tsien Hsue-shen: Ћен| Сјуесен|
Suppose that a translator wants to source it directly in the text, rather than to manually copy the transcription (e.g. to avoid having to update the text should the transcription be modified in the future). The translator therefore writes, using XML entity syntax:
...пројектовању ракета &qianxuesen-g; привукле су идеје...
where -g
denotes genitive case. This text can be easily
processed into the final form (before going out to readers), using a
script based on these few lines:
>>> from pology.lang.sr.trapnakron import trapnakron_plain >>> from pology.resolve import resolve_entities_simple as resents >>> tp = trapnakron_plain() >>> >>> s = u"...пројектовању ракета &qianxuesen-g; привукле су идеје..." >>> print resents(s, tp) ...пројектовању ракета Ћена Сјуесена привукле су идеје... >>>
Author: Chusslove Illich (Часлав Илић) <caslav.ilic@gmx.net>
License: GPLv3
Functions | |||
Synder |
|
||
string |
|
||
|
|||
|
|||
|
|||
as input |
|
||
string |
|
Variables | |
__package__ =
|
Function Details |
Main trapnakron constructor, covering all options. The trapnakron constructor sets, either by default or optionally, various transformations to enhance queries to the resulting derivator. Default BehaviorProperty values are returned as alternatives/hybridized compositions
of Ekavian Cyrillic, Ekavian Latin, Ijekavian Cyrillic, and Ijekavian
Latin forms, as applicable. Any of these forms can be excluded from
derivation by setting its Derivation and property key separator in compound keys is the ASCII
hyphen ( Derivation keys are derived from syntagmas by applying the identify() function. In derivations where this will result in strange keys, additional keys should be defined through hidden syntagmas. Property keys are transliterated into stripped-ASCII. Conflict resolution for derivation keys is not strict (see derivator constructor). Optional behaviorInstead of plain text, properties may be reported with some markup.
The markup type is given by Derivation keys can have several suffixes which effect how the properties are reported:
Ordinary hyphens may be converted into non-breaking hyphens by
setting the A property key normally cannot be empty, but Some property values may have been manually decorated with
disambiguation markers ( Some derivations are defined only for purposes of obtaining their
properties in scripted translations at runtime. They are by default not
included, but can be by setting the
|
Get root directory to trapnakron derivation files.
|
Constructs trapnakron suitable for application to plain text. Calls trapnakron with the following setup:
|
Constructs trapnakron suitable for application to UI texts. Like trapnakron_plain, except that disambiguation markers are not removed but substituted with an invisible character, and runtime-only derivations are included too. Retaining disambiguation markers is useful when a normalized form (typically nominative) is used at runtime as key to fetch other properties of the derivation, and the normalization is such that it would fold two different derivations to same keys if the originating forms were left undecorated. |
Constructs trapnakron suitable for application to Docbook 4 texts. Calls trapnakron with the following setup:
|
Normalize internal property keys in trapnakron.
|
Normalize text into runtime key for translation scripting.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Jul 24 21:00:27 2014 | http://epydoc.sourceforge.net |