Skip to content
This repository was archived by the owner on Dec 18, 2021. It is now read-only.

Am I using the short-profile correctly? current example outdated #63

Closed
antonsar opened this issue Apr 26, 2017 · 1 comment
Closed

Comments

@antonsar
Copy link

antonsar commented Apr 26, 2017

Hi JPrante,

Thanks for this plugin, I've been using it for a while now but I am currently stuck trying to use the short-profile.

I am trying to use the short-profile as shown in the example. However it seems that the example is outdated. Following it shows "unrecognized parameter: [profile]" error

curl -XPOST 'localhost:9200/_langdetect?profile=short-text&pretty' -d 'The Racoon ate my pie!!'
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "request [/_langdetect] contains unrecognized parameter: [profile]"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "request [/_langdetect] contains unrecognized parameter: [profile]"
  },
  "status" : 400
}

So.. I tried to go through the source, and it seems like this (below) should be correct but could you please verify that this is indeed correct?

curl -XPOST 'localhost:9200/_langdetect?pretty' -d '
{
  "text" : "インターネットで日本語を学習するのに", "profile" : "short-text"
}'
{
  "languages" : [
    {
      "language" : "ja",
      "probability" : 0.999998541689657
    }
  ]
}

The reason I am not sure if the above is correct is because, I am afraid that the

"profile":"short-text"

is considered as part of the data to be langdetect itself. How do I set the profile to short-text correctly here?

@antonsar antonsar changed the title Am I using the short-profile correctly here - current example outdated Am I using the short-profile correctly? current example outdated Apr 26, 2017
@antonsar antonsar reopened this Apr 28, 2017
@antonsar
Copy link
Author

Profile is not supported for Version 5.1.2
need to grab later version.

Actually JPrante himself told me about this, and... I forgot since it was so long ago. Whoops Sorry JPrante!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant