Package translate :: Package storage :: Module wordfast
[hide private]
[frames] | no frames]

Module wordfast

source code

Manage the Wordfast Translation Memory format

Classes [hide private]
  WordfastDialect
Describe the properties of a Wordfast generated TAB-delimited file.
  WordfastTime
Manages time stamps in the Wordfast format of YYYYMMDD~hhmmss
  WordfastHeader
A wordfast translation memory header
  WordfastUnit
A Wordfast translation memory unit
  WordfastTMFile
A Wordfast translation memory file
Functions [hide private]
 
_char_to_wf(string)
Char -> Wordfast &'XX; escapes
source code
 
_wf_to_char(string)
Wordfast &'XX; escapes -> Char
source code
Variables [hide private]
  WF_TIMEFORMAT = '%Y%m%d~%H%M%S'
Time format used by Wordfast
  WF_FIELDNAMES_HEADER = ['date', 'userlist', 'tucount', 'src-la...
Field names for the Wordfast header
  WF_FIELDNAMES = ['date', 'user', 'reuse', 'src-lang', 'source'...
Field names for a Wordfast TU
  WF_FIELDNAMES_HEADER_DEFAULTS = {'attr1list': '', 'attr2list':...
Default or minimum header entries for a Wordfast file
  WF_ESCAPE_MAP = (('&\'26;', u'&'), ('&\'82;', u''), ('&\'85;'...
Mapping of Wordfast &'XX; escapes to correct Unicode characters
  TAB_UTF16 = '\x00\t'
Function Details [hide private]

_char_to_wf(string)

source code 
Char -> Wordfast &'XX; escapes
   
   @note: Full roundtripping is not possible because of the escaping of 
and    


Variables Details [hide private]

WF_FIELDNAMES_HEADER

Field names for the Wordfast header

Value:
['date',
 'userlist',
 'tucount',
 'src-lang',
 'version',
 'target-lang',
 'license',
 'attr1list',
...

WF_FIELDNAMES

Field names for a Wordfast TU

Value:
['date',
 'user',
 'reuse',
 'src-lang',
 'source',
 'target-lang',
 'target',
 'attr1',
...

WF_FIELDNAMES_HEADER_DEFAULTS

Default or minimum header entries for a Wordfast file

Value:
{'attr1list': '',
 'attr2list': '',
 'attr3list': '',
 'attr4list': '',
 'date': '%19000101~121212',
 'license': '%---00000001',
 'src-lang': '%EN-US',
 'target-lang': '',
...

WF_ESCAPE_MAP

Mapping of Wordfast &'XX; escapes to correct Unicode characters

Value:
(('&\'26;', u'&'),
 ('&\'82;', u''),
 ('&\'85;', u''),
 ('&\'91;', u''),
 ('&\'92;', u''),
 ('&\'93;', u''),
 ('&\'94;', u''),
 ('&\'96;', u''),
...