In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how Java invokes Google API spelling check spell checking. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
Google is really a treasure trove. You want to call API for spell checking.
This is a Java call lib library and example, it is very simple to call
Http://code.google.com/p/google-api-spelling-java/
You can check out the source code http://google-api-spelling-java.googlecode.com/svn/trunk/ using SVN
It seems to be managed by maven, because it disconnects the svn connection after not contacting maven,checkout, manually changes the directory and adds the dependent jar package to the path before it can be run. Despise yourself for a moment.
For the test code in the following source code, I added a blank
Java code
Package org.xeustechnologies.googleapi.spelling; public class Test {@ org.junit.Test public void check () {SpellChecker checker = new SpellChecker (); checker.setOverHttps (true); / / Now default is true checker.setLanguage (Language.ENGLISH); / / Default is English SpellRequest request = new SpellRequest () Request.setText ("google baidu twitter facebook yahoo microsoft ibm"); request.setIgnoreDuplicates (true); SpellResponse spellResponse = checker.check (request); if (spellResponse.getCorrections ()! = null) {for (SpellCorrection sc: spellResponse.getCorrections ()) System.out.println (sc.getValue ()) } else {System.out.println ("It's OK!");}
The principle of background implementation is also discussed on the project page.
Should be to send a xml file to the www.google.com/tbproxy/spell interface
Xml code
Google baidu facebook yahoo microsoft ibmtext > spellrequest >
Receive a xml
Xml code
Baud Baird bad bid bawdyc > face book face-book casebook passbook forsook c > Microsoft micro soft micro-soft micros oft micros-oft c > IBM ICBM BM ABM I'mc > spellresult >
Haha, only google is the correct spelling ^ _ ^
I talked about the significance of these parameters in this 2005 article, when you had to use reverse engineering to get the calling interface:
A few questions: does s mean the credibility of the proposal? how many levels are unclear; text he said to be separated by tab? It should be separated by spaces.
At the end of this article, it is said that we are going to build a calling interface for ajax. I wonder if it will be completed later.
PS: this article mentions the limitations of the Google interface
Write
There are some limitations to be mentioned as well. The Google web API allows 10 words to be sent at a time and a limit of 1000 connections per key per day.
I tested that more than 10 words can also be used, and it is not clear whether google has unrestricted access to api or whether the number of words has increased. Well, take a test and try it thousands of times.
PS2: why can't you find the corresponding API for spell check in Google Code? is it hidden under some big API?
PS3: it's a depressing thing to search for "spell" in http://plugins.jquery.com/, but there is obviously this plug-in (see Resources). Why can't you find it? However, this plug-in still needs to be configured on the server side of the background, so it seems that it is not possible to call google's api directly in the foreground. Well, I give up, just use that java's lib to call.
1. The attachment is the api call jar package on google code and the dependency lib
two。 There is a website that has done a spell check based on ajax. Here is his free web version. Put it here as a memo.
Http://orangoo.com/spellcheck/
3. There is a plug-in for spell checking jquery. I just saw the URL here. The plug-in needs to be configured on the http://plugins.jquery.com/project/spellcheck side, but it needs to be configured on the server side. An example of php is provided.
On how Java calls Google API spelling check spell check to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.