Giter Club home page Giter Club logo

detectlanguage-java's People

Contributors

dependabot[bot] avatar laurynas avatar reedniv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

detectlanguage-java's Issues

Identify language by last word in the sentence

Hi Team,
When I try to identify language by sentence "Crea una password". DetectLanguage.detect get English.
When I try to with "Crea una" DetectLanguage.detect has 3 options. I guess it works by the last word. When I tried set text as [] array,
the result was the same: English. Expected: Italian. Could you please review it?

Exception.getMessage is null

There is not much to say. I used the simpledetect method and it returns an exception, but when I do exception.getMessage == null it returns true, so i don't know what is wrong. I am sure is caused by the API.
SSL is on.
(Just because I did not include the API initialization in this snipped, it does not mean that I don't have it)
`
try {
Toast.makeText(getApplicationContext(),DetectLanguage.simpleDetect("Hello"), Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Toast.makeText(getApplicationContext(),e.getMessage(), Toast.LENGTH_SHORT).show();

`
"Try" returns an exception, but when I try to print the exception, it tells me "e.getMessage" is null

java.net.SocketTimeoutException

java.lang.RuntimeException: java.net.SocketTimeoutException: failed to connect to ws.detectlanguage.com/109.235.67.238 (port 80) after 3000ms

APIError

Hey, I'm currently trying to make a minecraft spigot plugin using your API, and I'm running into a wall.

public static String englishOnly(String message){

        DetectLanguage.apiKey = "";

        String language = DetectLanguage.simpleDetect(message);

        if(language.equals("en"))
        {
            return "en";
        }
        return "";
    }

The "DetectLanguage.simpleDetect(message);" gives the APIError unhandled exception and I'm not entirely sure how to remedy this, I'd greatly appreciate any feedback on the issue.

Thank you for your time,

Regards,
Paddy

@laurynas

'Blank' return for unknown queries

After making a query for an entire list, I noticed some returns were completely empty, only returning a '[' in the JSON, which makes it hard to handle and check for sizing.

The examples I tested it with are these:

pwd, bccl, kinlay, lotay, dopshari, gaupay, dargay, helvetas, cdb, pangray, bijay, chojay, sanjay, td, yargay, dcd, gortab, helvatas, jurmay, kaflay, namsay, bg, chungdruk, draftman, gynecologist, mangjay, minjay, nakphay, norbooz, surjay, agrewal, allaway, apecs, bagdogra, bajay, bokray, bumdrag, changchay, chejay, chenray, chotay, dd, dhopshari, dtl, echay, emssd, fd, fsd, gajay, ganglue, gaygay, gaypay, gopay, gunjay, halvetas, hideway, hoilday, hungrap, iffch, jamgay, js, jungnay, karpay, kharl, lakshay, lingshay, lunjay, mafchan, malabasay, mso, nangsay, naphay, ninjay, pelgay, phojay, ramashray, ratney, ropeway, sarswati, sujay, sumjay, swapan, tenshay, thajay, thenpay, thsewang, tlt, tobjay, trk, tshejay, wanjay, yongdrag, aircraf, lubzor

A demo return on 'pwd' is also empty http://ws.detectlanguage.com/0.2/detect?q[]=pwd&key=demo

The JSON response for the first 2 is
{ "data": { "detections": [ [], [] ] } }

"reliable" field broken

Looks like in the Result class should look like this:

public class Result {
public String language;
public boolean isReliable;
public double confidence;
}

to work with GSON

Invalid API key error

Im getting below error
Exception in thread "main" com.detectlanguage.errors.APIError: Invalid API key
at com.detectlanguage.Client.processResponse(Client.java:72)
at com.detectlanguage.Client.execute(Client.java:54)
at com.detectlanguage.DetectLanguage.detect(DetectLanguage.java:31)
at com.sele.test.com.sele.test.App.main(App.java:57)

code i have used

	List<Result> results = DetectLanguage.detect("key");

	Result result = results.get(0);

	System.out.println("Language: " + result.language);
	// System.out.println("Is reliable: " + result.reliable);
	System.out.println("Confidence: " + result.confidence);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.