Is there a way to get "word alignment" from the API (v2 or v3)? - google-translate

Does anyone know if this is possible? When I send a translation request, is there a parameter setting I can use to get word alignment information, apart from the translation, in the response?
Thanks,
Albert

Related

JSON RouteLinks response to identify traffic light

I am sending an RME request to obtain speed limit and traffic light information and get back a JSON response. As Here-API provides a lot of different traffic sign types I dont care for (e.g. overtaking etc.) I cannot figure out how those types I am interested in are numerically encoded.
Browsing through the online docs provided by Here I could did not find the information I'm looking for, i.e. enumeration codes assigned to traffic lights
The request I send out looks something like
https://rme.api.here.com/2/matchroute.json?
app_id=<my-app_id>
&app_code=<my-app-code>
&routemode=car
&file=<zip and base64 encoded route info>
&attributes=BASIC_HEIGHT_FCn(*),ROAD_GEOM_FCn(*),ADAS_ATTRIB_FCn(*)
&attributes=ADAS_ATTRIB_FCn(*),SPEED_LIMITS_FCn(*),TRAFFIC_SIGN_FCn(*)
Please see below documents page and go to layers section and check the currently supported layers with the resource Layers.
https://developer.here.com/documentation/fleet-telematics/dev_guide/topics/here-map-content.html
For examples, this link will show about the layer of TRAFFIC_SIGN_FC1 in detail.
https://fleet.api.here.com/1/doc/layer.html?region=WEU&layer=TRAFFIC_SIGN_FC1&app_id={{app_id}}&app_code={{app_code}}

What is the purpose of X-Cloud-Trace-Context?

I was practicing some HTTP Post requests with a post-test server (ptsv2.com).
After a successful post, I can see the request body and headers etc. on the site.
There is one value that I am unsure about:
X-Cloud-Trace-Context
What is this for?? I understand the rest of header data, but I can't seem to find a good explanation on that one part.
Thank you.
X-Cloud-Trace-Context is a header from Google Cloud Platform to identify the current request.
It is particularly useful for correlating logs. As per documentation (https://cloud.google.com/appengine/docs/standard/python3/writing-application-logs), correlation has to be done manually. This post explains in detail how to do it: https://code.luasoftware.com/tutorials/google-app-engine/app-engine-standard-python37-correlate-application-log-with-request-log/

Cognitive Services Translation and Profanity Filtering

Issue Description
I use cognitive services TranslateArray to translate my users comments. One of the advantages of this service is that we can use ProfanityAction to mark every profane words in the destination language. I also make use of the automatic language detection, so that I do not have to identify the content before sending it in.
When I get my translation back for a destination language which match the source language, the profanity is not marked. Is there another endpoint I could/should hit, or a parameter I do not know about, or is there a possible improvement of the service ?
Corresponding Documentation
Follow the cognitive service protocol to hit the TranslateArray endpoint, with an english sentence containing profanities, with the ProfanityAction: Marked behavior: http://docs.microsofttranslator.com/text-translate.html#!/default/post_TranslateArray
Reproduction Steps
Send an English sentence with profanities
Translate to fr, notice correctly marked profanities
Translate to en, notice the missing profanities tag
Expected Behavior
Profanities should be marked even if no translation occured.
Actual Results
I obtained the unmodified sentence back.
There is nothing in the documentation that specifies what happens if the source and target language are the same. My guess is that if it sees that they match it will do nothing.
However, there is a specific API that detects profanity for any given language: Content Moderation for Text. The API docs are here.
The Text - Screen function does it all – scans the incoming text (maximum 1024 characters) for profanity, autocorrects text, and extracts Personally Identifiable Information (PII), all while matching against custom lists of terms.
Your observation that Translator API does nothing if source and target languages are the same, is correct. Not an answer, just clarification.

(Why) 'dont my credentials authorize access' to any descriptive meta resources from the HERE-api?

Yesterday I registered with HERE to experiment on Traffic/Flow data.
I registered with both the 'Public Basic plan' as well as the '90-day evaluation'. I managed to perform some basic query's and also got results but the next step was to understand the output.
The official way to get descriptions on the output data is described here:
https://developer.here.com/rest-apis/documentation/traffic/topics/additional-parameters.html.
I simply substituted my credentials in the the https://traffic.cit.api.here.com/traffic/6.0/xsd/flow.xsd?app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE} URL and pasted in my browser. But the only result I get for every xsd is:
"error:These credentials do not authorize access. Please contact your customer representative or submit a request here developer.here.com/contact-us to upgrade your account. You can also get valid credentials by registering for a free trial license on developer.here.com.,error_description:NA" . So apparently I am authorized to use the api but not authorized to get information on how to interpret the results...?
I already found out the many abbreviation are explained on Interpreting HERE Maps real-time traffic tags but I found a few that weren't described, like <SSS> and <SS>.
Thanks in advance.
UPDATE: Apparently I was already voted down on the question. What am I doing wrong?
The Description of SS/SSS tag is here:
The SS (SUB_SEGMENT) will be provided if the current traffic data is
more precise than the road defined. When there are SS elements, the
elements will be ordered by driving direction. If there are SS
elements, the lengths (LE) of all SS elements will add up to the
length of the roadway represented from the corresponding CF section.

When I use Live HTTP Headers for Firefox, why do I get a piece of random gibberish after the word "callback"?

When I loaded a web page after submitting something into a javascript-type "form" I looked at the HTTP headers with the Firefox add-on. Everything in the headers make sense except for 16 random characters in the middle that always came after the word "callback". I don't know what they mean or where they come from.
These are all from SEPERATE "form submissions" if you will.
"http://www.locationary.com/access/proxy.jsp?ACTION_TOKEN=proxy_jsp$JspView$SaveAction&callback=callback8FDRUTrnQgGI2iuZ&inPlaceID=1003168722&xxx_c_1_f_987=http%3A%2F%2Fwww.yellowpages.com%2Fdallas-tx%2Fmip%2Fdallas-womens-foundation-13224281%3Flid%3D13224281"
"http://www.locationary.com/access/proxy.jsp?ACTION_TOKEN=proxy_jsp$JspView$SaveAction&callback=callbackPAgvDXBbZuLXbAHw&inPlaceID=1014875244&xxx_c_1_f_987=http%3A%2F%2Fwww.yellowpages.com%2Fmorrill-me%2Fmip%2Fshear-talent-country-style-14741614%3Flid%3D14741614"
"http://www.locationary.com/access/proxy.jsp?ACTION_TOKEN=proxy_jsp$JspView$SaveAction&callback=callback5GgVkaOind0ySooX&inPlaceID=1015406723&xxx_c_1_f_987=http%3A%2F%2Fwww.yellowpages.com%2Fgalesburg-mi%2Fmip%2Fmichigan-grower-products-8776287%3Flid%3D8776287"
As you can see, they all start out with the same thing:
"http://www.locationary.com/access/proxy.jsp?ACTION_TOKEN=proxy_jsp$JspView$SaveAction&callback=callback"
But after that, there is always a set of 16 seemingly random characters. I understand the rest of this "url" but these 16 characters don't make sense to me. Is there any way to generate them or get them before the request is sent?
Thanks!
These are almost certainly "AJAX" requests, being used as JSONP. The callback... value is the name of a dynamically-created JavaScript function to handle the results of the data returned by the HTTP request.
I'd recommend using Firebug to view all of this - it may help shed a little more light on things.

Resources