Analysis API v2

From Memsource
Jump to: navigation, search

Create New Analysis

action: api/v2/analyse/create
    token                       string
    jobPart                     list(domain(JobPart))
    type                        enum(AnalyseType)        O(PreAnalyse)
    includeFuzzyRepetitions     boolean                  O(true)
    includeConfirmedSegments    boolean                  O(true)
    includeNumbers              boolean                  O(true)
    includeLockedSegments       boolean                  O(true)
    countSourceUnits            boolean                  O(true)
    includeTransMemory          boolean                  O(true)                
    name                        string                   O
    linguist                    domain(User)             O
    discountScheme              domain(DiscountScheme)   O
    useProjectAnalysisSettings  boolean                  O
    compareWorkflowLevel        integer                  O                       // required for type=Compare

response: JSON
  
{
  "parts":[
     {
        "discountedData":{
           "available":true,
           "machineTranslationMatches":{
              "match50":{
                 "percent":100,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match0":{
                 "percent":100,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match95":{
                 "percent":100,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match85":{
                 "percent":100,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match100":{
                 "percent":100,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match75":{
                 "percent":100,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              }
           },
           "all":{
              "percent":100,
              "words":1,
              "segments":1,
              "characters":6,
              "normalizedPages":0.0033333334000000005
           },
           "repetitions":{
              "percent":0,
              "words":0,
              "segments":0,
              "characters":0,
              "normalizedPages":0
           },
           "transMemoryMatches":{
              "match50":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match101":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match0":{
                 "percent":100,
                 "words":1,
                 "segments":1,
                 "characters":6,
                 "normalizedPages":0.0033333334000000005
              },
              "match95":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match85":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match100":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match75":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              }
           }
        },
        "sourceLang":"en",
        "data":{
           "available":true,
           "machineTranslationMatches":{
              "match50":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match0":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match95":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match85":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match100":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match75":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              }
           },
           "all":{
              "percent":100,
              "words":1,
              "segments":1,
              "characters":6,
              "normalizedPages":0.0033333334
           },
           "repetitions":{
              "percent":0,
              "words":0,
              "segments":0,
              "characters":0,
              "normalizedPages":0
           },
           "transMemoryMatches":{
              "match50":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match101":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match0":{
                 "percent":100,
                 "words":1,
                 "segments":1,
                 "characters":6,
                 "normalizedPages":0.0033333334
              },
              "match95":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match85":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match100":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              },
              "match75":{
                 "percent":0,
                 "words":0,
                 "segments":0,
                 "characters":0,
                 "normalizedPages":0
              }
           }
        },
        "jobParts":[
           {
              "discountedData":{
                 "available":true,
                 "machineTranslationMatches":{
                    "match50":{
                       "percent":100,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match0":{
                       "percent":100,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match95":{
                       "percent":100,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match85":{
                       "percent":100,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match100":{
                       "percent":100,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match75":{
                       "percent":100,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    }
                 },
                 "all":{
                    "percent":100,
                    "words":1,
                    "segments":1,
                    "characters":6,
                    "normalizedPages":0.0033333334000000005
                 },
                 "repetitions":{
                    "percent":0,
                    "words":0,
                    "segments":0,
                    "characters":0,
                    "normalizedPages":0
                 },
                 "transMemoryMatches":{
                    "match50":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match101":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match0":{
                       "percent":100,
                       "words":1,
                       "segments":1,
                       "characters":6,
                       "normalizedPages":0.0033333334000000005
                    },
                    "match95":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match85":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match100":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match75":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    }
                 }
              },
              "id":361538,
              "fileName":"test.txt",
              "data":{
                 "available":true,
                 "machineTranslationMatches":{
                    "match50":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match0":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match95":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match85":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match100":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match75":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    }
                 },
                 "all":{
                    "percent":100,
                    "words":1,
                    "segments":1,
                    "characters":6,
                    "normalizedPages":0.0033333334
                 },
                 "repetitions":{
                    "percent":0,
                    "words":0,
                    "segments":0,
                    "characters":0,
                    "normalizedPages":0
                 },
                 "transMemoryMatches":{
                    "match50":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match101":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match0":{
                       "percent":100,
                       "words":1,
                       "segments":1,
                       "characters":6,
                       "normalizedPages":0.0033333334
                    },
                    "match95":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match85":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match100":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    },
                    "match75":{
                       "percent":0,
                       "words":0,
                       "segments":0,
                       "characters":0,
                       "normalizedPages":0
                    }
                 }
              }
           }
        ],
        "targetLang":"cs"
     }
  ],
  "assignedTo":{
     "linguist":{
        "deleted":false,
        "active":true,
        "userName":"M_Ling",
        "firstName":"Ling",
        "id":229,
        "lastName":"Mem",
        "role":"LINGUIST",
        "email":"ling@memsource.com"
     }
  },
  "type":"PreAnalyse",
  "createdBy":{
     "deleted":false,
     "active":true,
     "userName":"P_admin2",
     "firstName":"P",
     "id":399,
     "lastName":"admin;",
     "role":"ADMIN",
     "email":"ad@memsource.com"
  },
  "discountScheme":{
     "id":34,
     "name":"net 1",
     "netRates":{
        "repetition":0,
        "transMemory":{
           "match101":0,
           "match100":10,
           "match95":33,
           "match85":66,
           "match75":100,
           "match50":100,
           "match0":100
        },
        "machineTrans":{
           "match100":30,
           "match95":40,
           "match85":70,
           "match75":100,
           "match50":100,
           "match0":100
        }
     }
  },
  "dateCreated":"2016-05-04T18:11:01+0000",
  "id":293675,
  "name":"test analysis"
}

Get Analysis

action: api/v2/analyse/get
    token                       string
    analyse                     domain(Analyse)

response: JSON
   // see analyse/create API for an example of a return value

List Analyses By Project

action: api/v2/analyse/listByProject
    token                       string
    project                     domain(Project)

response: JSON
   [
         // see analyse/create API for an example of a return value
   ]

Edit Analysis

action: api/v2/analyse/edit
    token                       string
    analyse                     list(domain(Analyse))
    name                        string           O
    linguist                    domain(User)     O

response: empty

Delete Analysis

action: api/v2/analyse/delete
    token                       string
    analyse                     domain(Analyse)
    purge                       boolean           O(false)

response: empty

Download Analysis

action: api/v2/analyse/download
    token                       string
    analyse                     domain(Analyse)
    format                      enum(AnalyseFormat)

response: depends on format
   // LOG
   File:               small.properties
   Date:               2013-07-25 07:38:22 UTC
   Project:            project
   Language direction: en > de
   
   Match Types       Segments        Words      Percent
   Translated               0            0            0
   Context Match            3            3          100
   Repetitions              0            0            0
   Format Change            0            0            0
   100%                     0            0            0
   95% - 99%                0            0            0
   85% - 94%                0            0            0
   75% - 84%                0            0            0
   50% - 74%                0            0            0
   No Match                 0            0            0
   Total                    3            3          100
   Chars/word            3.67
   
   Total:              1 files
   Date:               2013-07-25 07:38:22 UTC
   Project:            project
   Language direction: en > de
   
   Match Types       Segments        Words      Percent
   Translated               0            0            0
   Context Match            3            3          100
   Repetitions              0            0            0
   Format Change            0            0            0
   100%                     0            0            0
   95% - 99%                0            0            0
   85% - 94%                0            0            0
   75% - 84%                0            0            0
   50% - 74%                0            0            0
   No Match                 0            0            0
   Total                    3            3          100
   Chars/word            3.67
   
   
   // CSV
   ;;;Context TM;;;;Repetitions;;;;100% Matches;;;;95% - 99%;;;;85% - 94%;;;;75% - 84%;;;;50% - 74%;;;;No Match;;;;Total
   File;Tagging Errors;Chars/Word;Segments;Words;Placeables;Percent;Segments;Words;Placeables;Percent;Segments;Words;Placeables;->
      ->Percent;Segments;Words;Placeables;Percent;Segments;Words;Placeables;Percent;Segments;Words;Placeables;Percent;Segments;->
      ->Words;Placeables;Percent;Segments;Words;Placeables;Percent;Segments;Words;Placeables;Characters
   small.properties | en>de;0;3.67;3;3;0;100;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;3;3;0;11
  
  // CSV_EXTENDED
  ;;;Context TM;;;;;Repetitions;;;;;100% Matches;;;;;95% - 99%;;;;;85% - 94%;;;;;75% - 84%;;;;;50% - 74%;;;;;No Match;;;;;Total
  File;Tagging Errors;Chars/Word;Segments;Words;Characters;Placeables;Percent;Segments;Words;Characters;Placeables;Percent;Segments;Words;->
     ->Characters;Placeables;Percent;Segments;Words;Characters;Placeables;Percent;Segments;Words;Characters;Placeables;Percent;Segments;Words;->
     ->Characters;Placeables;Percent;Segments;Words;Characters;Placeables;Percent;Segments;Words;Characters;Placeables;Percent;Segments;Words;->
     ->Placeables;Characters
  a.txt | en>cs;0;5.51;92;1240;7071;0;24.24;5;10;111;0;0.2;178;176;752;0;3.44;34;60;279;0;1.17;1;3;20;0;0.06;13;49;289;0;0.96;32;122;782;->
     ->0;2.38;171;3456;18864;0;67.55;526;5116;0;28168