Segment (Object)

Segment (Object)

A JSON object that represents a segment with all data requested by the layout and to which a user has access. The object further includes information on what data can be edited.

 

PROPERTIES

Segment

 

Identifiers

 

no

The sequential ID of the segment in the document. It consists of the "paragraph" number and an optional sub-segment number.

Applies to project resources/memories only. With translation memories and termbases this field has no meaning.

Examples:

For example, a document with 3 segments uses "1", "2" and "3".

If the second segment is split into 3 sub-segments, the numbers will be "1", "2", "2-2", "2-3" and "3".

Format:

"no" is constructed from the "bsid" and "bssid" fields described below and using this formula:

Note: We use the term "paragraph" to denote a segment including all its sub-segments. This may be a paragraph in a Word document that may or may not be split on sentence level into one or more sub-segments.

string

bsid

The paragraph sequential ID with the document. Starting at 1.

int

bssid

The sub-segment ID, starting at 0. 0 = first sub-segment, 1 = second sub-segment...

int

sid

The globally unique ID of the segment. Use this id and not "no" to uniquely identify a segment within your platform.

int

did

The globally unique document ID. Each segment is attached to exactly one document. If the underlying resource is a translation memory or termbase then the "document" is understood as a grouping of related segments. For example, all segments imported from a TMX are grouped together.

int

dsid

The globally unique resource ID. We sometimes refer to this as the "document set id", a term we use internally at Wordbee.

A resource has zero or more documents, which each have zero or more segments.

int

sdid

A numeric index denoting a sub-section of a document. The index starts at 0. If a document consists of sections such as slides in a Powerpoint file, then this is the index of the section or slide. When translating Word files, the sections are (among others) the "header", "body" and "footer".

int

 

 

 

 

Segment level data

 

edit

General indicator if the segment can be edited or not.

 

tags

Markup information. Contains the list of markup elements in the original text of the segment. This information is encoded.

string?

ctx

The context of the segment. It typically contains information of the paragraphs style.

Microsoft Word files: "Heading 1", "Heading 2", "Footnote"

Microsoft Excel: "Cell 2,3"

HTML: "p", "script", ...

This field can be edited by users, see below.

string

ctx_edit

Indicates if the "ctx" field can be edited.

bool

chmin

Minimum text length constraint. Null if none. Expressed in terms of characters, excluding markup.

int?

chmax

Maximum text length constraint. Null if none. Expressed in terms of characters, excluding markup.

int?

ch_edit

Indicates if the "chmin" and "chmax" fields can be edited.

bool

lbls

A list of labels assigned to the segment. Note that labels need to be configured by the administrator under "Settings" > "Labels" > "Segments".

Each array element has these properties:

  • id: The unique ID of the label (int)

  • value: The assigned label value (string)

  • sav: A boolean which is true if the label value was never explicitly assigned but the value is configured to be "sticky" (i.e. shown by default)

If there is no label, the array is empty.

object[]

lbl_edit

Indicates if labels can be edited. With the labels specifications you further obtain an information which labels exist, which options and for which labels editing rights are revoked.

If false, editing is prohibited.

bool

cfs

A list of segment level custom fields, that is custom fields not assigned to a specific language but globally to the segment.

Each array element has these properties:

  • id: The ID of the custom field (int). IDs start at 1.

  • val: The field value (string)

If there is no custom field, the array is empty.

 object[]

cf_edit

Indicates if custom fields can be edited. With the custom field specifications you further obtain an information which custom fields are configured and which are editable.

If false, editing is prohibited.

 

cols

An object containing all the column values as defined in the layout.

A column may contain the English source text, another the Spanish translation, another comments, another the status of translation, another all the revisions, etc.

See below for details.

object[]

 

Columns "cols"

Each column appears as a property named "_" + the index of the column:

"cols": { "_0": { value of column #1 }, "_1": { value of column #2 }, "_2": { value of column #3 }, ... }

 

Each object has these properties.

column

The column index starting at 0.

int

(code)

The actual data in the column. The structure depends on the column type:

  • bk - Bookmark

  • cm - Comments

  • ctx - Segment context

  • cf - Custom field

  • lbl - Label

  • ed - Last editor

  • lck - Lock status

  • hits - Memory hits

  • cmnew - New comment box

  • revs - Revision history

  • st - Status

  • txt - Text (source and translation)

  • err - Q&A error details

Example:

"cols": { "_0": { "column": 0, "bk": 1 // Bookmark is "blue" "bk_edit": true } }

 

The different column types are explained in the next chapters.

 

(code)_edit

Indicates if the column is editable.

Example:

"cols": { "_0": { "bk_edit": true ...

bool

 

Most columns refer to a specific language (source/target). Which column refers to which language is defined in the spreadsheet layout. The layout is defined by: YOU. 

 

Bookmark column

This column is specific to a language.

bk

Numeric bookmark status:

  • 0 = none

  • 1 = blue bookmark

  • 2 = red bookmark

int

 

Text status column

This column is specific to a language.

st

Numeric source or translation status:

  • 0 = none

  • 1 = green status

  • 2 = red status

int

 

 

Lock status column

This column is specific to a language.

lck

"lock" status:

  • false = properties in language not locked for editing

  • true = properties in language locked for editing

bool

 

 

Last editor column

This column is specific to a language.

ed

Numeric "last editor" status.

See Last Editor (Enumeration)

int

 

 

Error column

When you run a Q&A, errors are saved with the translation.

This column is specific to a language.

err

Last Q&A error for a text. 

string?

 

 

Context column

The context of the segment. It typically contains information of the paragraphs style.

  • Microsoft Word files: "Heading 1", "Heading 2", "Footnote"

  • Microsoft Excel: "Cell 2,3"

  • HTML: "p", "script", ...

  • ...

This field is not language specific.

ctx

Null or context. 

string?

 

 

Text column

The source text or a translation plus ancillary data.

txt

JSON object with properties, see below. 

below

Properties are:

 

loc

The language code for the text

string

val

The text (source text or a translation) 

string?

st

The translation status:

  • 0 = none

  • 1 = green status

  • 2 = red status

 int

bk

Numeric bookmark status:

  • 0 = none

  • 1 = blue bookmark

  • 2 = red bookmark

int

tsk

If the text was edited in the framework of a job, stores the type of job (the task code).

Examples:

  • TR: Translation

  • RV: Revision

Please note that task codes are customizable.

string

cmc

Total number of comments attached to this text.

int

ed

Last editor of text. See Last Editor (Enumeration)

int

usid

Null or the ID of the last changing user (if "ed" is Human). If the current user is not authorized to see user names, then the value will be null.

int?

usdt

Last change date if the change was done by a human.

datetime?

hh

True if there is a revision history.

bool

sim

If the translation was obtained from a memory pre-translation then this is the degree of similarity. For example, 110 stands for perfect pretranslation.

0 = no pre-translation.

int

err

The last Q&A error.

string?

lck

Numeric "lock" status:

  • false = properties in language not locked for editing

  • true = properties in language locked for editing

bool

lck_edit

True if the user can lock or unlock the segment.

bool

hn

Hash code of the subsequent segment text. Used internally to identify in-context (perfect) matches. Null if no context is known.

int?

hp

Hash code of the preceding segment text. Used internally to identify in-context (perfect) matches. Null if no context is known.

int?

cfs

Custom fields.

 

cfs_edit

True is user can edit custom fields.

 

usfid

Null or the ID of the last changing user (if "ed" is Human). If the current user is not authorized to see user names, then the value will be null.

 

usfdt

Last change date if the change was done by a human.

 

 

 

 

 

 

Bookmark column

bk

Numeric bookmark status:

  • 0 = none

  • 1 = blue bookmark

  • 2 = red bookmark

 

int

 

 

Bookmark column

bk

Numeric bookmark status:

  • 0 = none

  • 1 = blue bookmark

  • 2 = red bookmark

 

int

 

 

Bookmark column

bk

Numeric bookmark status:

  • 0 = none

  • 1 = blue bookmark

  • 2 = red bookmark

 

int

 

 

Bookmark column

bk

Numeric bookmark status:

  • 0 = none

  • 1 = blue bookmark

  • 2 = red bookmark

 

int

 

 

Bookmark column

bk

Numeric bookmark status:

  • 0 = none

  • 1 = blue bookmark

  • 2 = red bookmark

 

int

 

 

Bookmark column

bk

Numeric bookmark status:

  • 0 = none

  • 1 = blue bookmark

  • 2 = red bookmark

Copyright Wordbee - Buzzin' Outside the Box since 2008