Improvement to Language Detect in MS Translation API

One service that is used a lot in Bot development is the Microsoft Translation API. One method is especially useful; detect.

In v2 you would make a call like Detect(“Hello”) and it would return “en”. Fine, actually it’s not. If your Bot was speaking in German and the User entered “Ja” then Detect(“Ja”) would return “Finnish” – noooooh. Thankfully v3 now provides us with the alternatives, as you can see here they all have the same score – Hurray 🙂

[
    {
        "language": "fi",
        "score": 1,
        "isTranslationSupported": true,
        "isTransliterationSupported": false,
        "alternatives": [
            {
                "language": "et",
                "score": 1,
                "isTranslationSupported": true,
                "isTransliterationSupported": false
            },
            {
                "language": "de",
                "score": 1,
                "isTranslationSupported": true,
                "isTransliterationSupported": false
            }
        ]
    }
]
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s