• Not Answered

How to get information about context matches from GroupShare API

I'm struggling to figure out if a TM/TU match is a context match, and the documentation isn't helping.

The request object posted to the GroupShare API does not offer any option to tell GroupShare something about the current
context. However, the response from that same call can deliver several different attributes that contain the word 'context', but at the moment I can't see how to make use of these to identify whether our current match is a context match.

The pertinent information we would guess is this:

"results": [
        {
            "memoryTranslationUnit": { ... }
            "translationProposal": { ... }
            "cascadeEntryIndex": -1,
            "contextData": {
                "leftSource": 2440472997293638732,
                "leftTarget": 3798523
            },
        ...

In the 'leftSource' and 'leftTarget' attributes there are hash values that we would guess are calculated hashes of the preceding segments. If this is true then we could simply calculate the hash of the preceding segment ourselves, compare it with the hash value and than we would know if it is a context match. Which raises the questions:

  • Is this assumption correct?
    • If no: how can we determine if a match is a context match?
    • If yes: how can we calculate the hash? The documentation says that the hash value is not even always the hash of the preceding segment, e.g. in cases where there is no preceding segment.
    • If yes: there should be the possibility that a match has several different contexts (several different preceding segments). How would that be reflected in the response?
3 Replies Latest Replies: 4 Jul 2018 5:38 AM by Ionut Mitrea

3 Replies

  • In order to determine if a match is a context match or not, you need to look at $.results[0].scoringResult.textContextMatch

    The possible values are:

    • NoMatch - the result is not a context match
    • SourceMatch - the source segments match in the given context
    • SourceTargetMatch - the source and target segments match in the given context
    • PrecedingAndFollowingSourceMatch - the previous and following source segments match
  • In reply to Ionut Mitrea:

    Thank you for your answer.

    As far as I can see, the request object posted to the GroupShare API does not offer any option to tell GroupShare something about the current context.

    I would assume that

    $.results[0].scoringResult.textContextMatch

    will always contain the value "NoMatch" because there is no way for GroupShare to know the context of my current segment, since I cannot tell anything about it to GroupShare.

    Is that correct? Or is there any way for GroupShare to get the context? Does it simply take the previous query from the same user as context? That would be my only and best guess, yet it does not really make sense to me.

  • In reply to Ionut Mitrea:

    I think the main problem we have, is that we don't know how to query the API so that it knows the context. When we ask for a Match, how do we tell the API what the context (e.g. the segment before this) is?

Related