Skip to content
This repository was archived by the owner on Dec 18, 2021. It is now read-only.
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

Description

@antonsar

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions