Menu

#797 Text Import function (extension of existing Text Export func

closed-duplicate
nobody
5
2013-03-15
2012-07-24
Marc Prior
No

Situation in OmegaT at present:
When enabled, the existing Text Export function automatically exports the source and target text to the plain-text files source.txt and target.txt respectively.

I propose that the existing text export function be supplemented with the logical reverse function: i.e., that besides exporting the source and target segments to source.txt and target.txt respectively, OmegaT should read content from an external file (e.g. from target.txt itself, following detection of a change) and insert this content automatically into the target field of the active segment.

This function would enable scripters not only to have the content of the source and target fields automatically manipulated, but also to have the results of manipulation pasted back automatically into the target field.

An obvious use of the function is automated substitution. For example, a script could perform automatic transformations of common or non-textual strings. (Although this is already possible with the exiting Text Export function, the result has to be inserted manually.) For example:

German telephone number formats:
T. 0123 4567890
T. 0123 / 4567890
T. 0123 4 56 78 90

English (UK) equivalent:
Tel. 0123 4567890

Other examples:

English number: 123,456.00
Continental European equivalent: 123.456,00

German price: € 12,-
English equivalent: €12.00
(note the absence of a space)

Tabs could be handled at the same time.

Other uses exist beyond that for simple string substitution. One for example would be to provide on-the-fly spelling checking for any language for which no dictionary exists in a format supported by OmegaT but for which a dictionary does exist which can be accessed by a script.

Another example would be simplified tag handling. The scripter could for example choose to have a segment like this:

<f0>Voici une </f0>phrase<f1> avec beaucoup</f1> de balises<f2>.</f2>

copied into the target field like this:

Voici une phrase avec beaucoup de balises.
<f0>
</f0>
<f1>
</f1>
<f2>
</f2>

This provides (1) the source text in de-tagged form for easier reading (this is already possible with the existing text export function and I have written such a script, but it requires the user to look at a separate window) and (2) each tag on a new line, enabling the user to fill in the gaps between them without time-consuming use of the cursor keys or the mouse and copying or error-prone retyping of the tabs, only needing to delete the superfluous line breaks and the de-tagged text afterwards.

Discussion

  • Didier Briel

    Didier Briel - 2013-03-15
    • status: open --> closed-duplicate
     
  • Didier Briel

    Didier Briel - 2013-03-15

    Duplicate of
    - Import from exported script files
    http://sourceforge.net/support/tracker.php?aid=2957819

    Didier

     

Log in to post a comment.