Skip to main content

resources/segments/finder/memories/search

Returns the translation finder details for a scope. The scope defines which resources are accessible and can be searched.

URL

(POST) /resources/segments/finder/memories/search

PARAMETERS

The message body contains a JSON object:

scope

The scope object. It delimits the total range of segments and related resources that can be operated on.

Mandatory

object

txt

The text to search.

Mandatory

string

sid

Optional segment for which we search. If set then the system excludes the segment itself from the search results. Recommended.

Optional

int

src

The source language code.

Mandatory

string

trg

The target language code.

Mandatory

string

hprev

Optional. The hash code of the previous segment if available (can be null). If specified then the finder is capable of telling if a hit is an in-context match (110% hit).

Note: Only use the hash codes if the resource is a "Document". With memories or termbases, the segments have no logical order.

Optional

int?

hnext

Optional. The hash code of the next segment if available (can be null). If specified then the finder is capable of telling if a hit is an in-context match (110% hit).

Optional

int?

ctx

Optional context of the segment.

In combination with tmhits.ctxboost, setting the context permits to promote hits that match the context of the searched segment.

Optional

string?

sim

Optional. Similarity threshold between 40 and 110. If not specified, the threshold is set to 80.

Optional

int?

tbOnly

Optional, default is false.

  • false (default): API searches all attached memories and term bases.

  • true: Searches term bases only. This method thus returns term hits only.

Use if you are interested in terminology database results only.

Optional, bool?

tmhits

Optional. Specifies how top hits are selected and further permits to apply filters on various properties such as status, bookmarks, context, change date and so on.

CODE
"tmhits": {
	"filter": [
   		{ "field": "st", "values": [ 1 ] },
   		{ "field": "bk", "values": [ 1, 2 ] }
	],
	"ctxboost": null
}

Read details here:

TM Filters and Sort (Object)

Optional,

object?

extensive

Optional, defauls is false. If true, the API will expand the search to less similar hits (mostly concordance hits).

Optional, bool?

token

The finder token. The first time you call a finder method you do not yet have a token. It is included with each call and you can then reuse it for subsequent calls. Doing so substantially optimizes performance of all finder methods.

Optional,

string

RESULTS

The properties are:

results

An array with the found hits. See below.

object[]

Each hit in results has these properties:

scr

An internal score for the hit. This score takes into account the similarity of the text and, if enabled, the similarity of the segment context/key.

For internal use.

decimal

sim

The text similarity of the hit in percent. A value either 0 (not a context match) or 100 (is a context match)

int

simctx

The context/key similarity. A percentage between 0 or 100

int

hty

The type of hit:

  • 1: Phrase hit

  • 2: Term hit. The hit is a part of the text searched (e.g. a term)

  • 3: Concordance hit

int

isr

The reliability of the hit's translation:

  • 0: Unknown

  • 1: Yes, reliable. Translation is human edited or green status.

  • 2: Potentially reliable but may require check by a human. For example, a fuzzy pre-translation or machine translation.

  • 3: No: Translation has red status.

int

pen

Any penalties applied to the similarity (sim). Value of 5 means we deduced 5% points from original similarity.

Penalties are configured in a resource's Search Settings page.

int

dbl

Number of doubles. If the exact same hit was found multiple times it is returned only once. This number indicates the total amount of doubles.

int

nol

Non overlapping term hit (hty = 2). For a given segment the system may find a large number of terms.

The system then identifies those terms that do not overlap, for example if the hits's words are colored in the original text.

bool

mks

Array of regions in the original text that differ from the hit's source text. Used to color highlight text differences. Optional array:

  • p: Character start position

  • l: Length in characters

  • mt: Type of difference. 1 = important difference, 2 = medium difference, 3 = minor difference (spaces, separator characters)

  • rep: Suggested replacement value, if any.

object[]

regp

regl

The character start position and length in the original text that entirely spans the hit source text.

Only populated with term hits.

int?

int?

seg

An object with hit segment level properties:

  • sid: Segment id. This uniquely identifies the hit.

  • did: Document id

  • dsid: Resource id

  • bsid: Sequential segment id (within the document). Only used with hits from project memories.

  • bssid: Sequential sub segment number. Used if a segment was split into sub segments.

  • tags: Encoded markup information

  • ctx: The segment context/key

  • lbls: Segment level labels, if any

object

src

An object with the hit's source text details:

  • val: The text

  • loc: The language

  • st: The status of the source text. 0 = none, 1 = green, 2 = red

  • hn: The hash code of the subsequent segment, if any. Null if no information available.

  • hp: The hash code of the preceding segment, if any. Null if no information available.

  • cmc: Null or the total number of comments attached to the text.

  • lbls: Text level labels, if any

  • mks: Regions in the text that differ from the searched source text. Used to color highlight text differences. An array:

    • p: Character start position

    • l: Length in characters

    • mt: Type of difference. 1 = important difference, 2 = medium difference, 3 = minor difference (spaces, separator characters)

    • rep: Suggested replacement value, if any.

  • vs: Total alternative texts available in this language. Useful with terminology databases only where a term can contain source text alternatives (synonyms for example)

  • tid: A globally unique ID of this source text. Only included with terminology hits, otherwise null.

object

trg

An object with the hit's translation details:

  • val: The text

  • loc: The language

  • st: The status of the translation. 0 = none, 1 = green, 2 = red

  • bk: The bookmark of the translation. 0 = none, 1 = blue, 2 = red

  • edSpecifies who last changed the text. See Last Editor (Enumeration)

  • mtidIf a machine translation then this (may) contain the MT profile ID used.

  • cmc: Null or the total number of comments attached to the text.

  • lbls: Text level labels, if any

  • reps: Regions in the text that differ from the searched source text. Used to color highlight text differences.

    • p: Character start position

    • l: Length in characters

    • rep: Suggested replacement value, if any. Used for example to suggest a change of a date or placeholder.

  • vs: Total alternative translations available in this language. Useful with terminology databases only where a term entry can contain translation alternatives.

  • tid: A globally unique ID of this source text. Only included with term hits, otherwise null.

object


EXAMPLES

N/A


 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.