Our Adsotrans WordPress Plugin….
Feb 14th, 2008 by trevelyan
… is ready for launch. Install the plugin to let users adsotate the content on your blog for contextual pinyin/english popups. See this in action by clicking on the Chinese sentence below:
我们的新插件厉害得不得了!
Once text is annotated, click on words to edit their definitions. Highlight new words/phrases to teach them to the system. The editing tools work in real-time just like the main site, although we review all contributions over time and tag them grammatically. Here are the three steps needed to get this plugin working:
- Download the plugin and install it in your /wp-content/plugins directory. I’ve got mine installed as /wp-content/plugins/adsotrans/adsotrans.php
- Enable the plugin using the Admin->Plugins page
- Using your theme editor (Admin -> Presentation -> Theme Editor), edit the the file “header.php” and add these four lines after your opening <BODY> tag. If you’re not sure how this should work, just look at the source code for this page and you’ll see exactly what I mean, or read the readme file accompanying the plugin:
<div id=“adso_tooltip”></div>
<div id=“adso_pointer”></div>
<script language=“javascript” src=“http://adsotrans.com/wordpress/js/jquery-1.2.2.pack.js”></script>
<script language=“javascript” src=“http://adsotrans.com/wordpress/js/api.js”></script>
A couple of notes:
- We have a hard limit of 500 characters on each submission (longer texts are returned unannotated). If you want to annotate lenthy passages, add a space to the Chinese text every 500 characters or less. This will break the text into sections that can be adsotated separately, and help keep our server breathing.
- I’m only able to offer this service because of sponsorship from ChinesePod to cover our server costs. If you find this useful and want to say thanks, a great way to do so is linking back to ChinesePod in some capacity (full disclosure: I work at ChinesePod, and think it’s a great place to learn Chinese). Please also give me a ping somehow or leave a comment below so I know the service is being used.
- We review contributions regularly, but don’t monitor editing on an hourly basis. If you don’t like the idea of participating in an open service but are willing to cover your own server costs, I’d be happy to help you set up a closed version.
Otherwise enjoy, and feel good about helping out. By using this plugin you’re not only helping your users, you’re also helping us compile a major open source linguistic database that can help language students while pushing forward research in machine translation and semantic text analysis. Thanks.
[…] within a week. [UPDATE: November 14th — the plugin is now public. You can read about the full release, or download the plugin […]
Hey, thanks very much for all the work you put into adsotrans and this fantastic plugin. I’ve already installed it on my blog.
I’m wondering if, in future versions, it would be possible to give readers the option to toggle it on and off? Perhaps a little sidebar console or something? Most of the time when I’m reading sites in Chinese I use the Chinesepera-kun add-on for firefox; I notice that when your adsotrans plugin is installed it takes precedence. Some people may want to use their translator of choice or–and this is true in my case–might like to use two or more programs on difficult passages so that they can compare definitions.
I know nothing about coding these kinds of things, so I have no idea if this is a realistic possibility.
Anyway, thanks again.
Dude! This is awesome! I’ve been inputting pop-ups by hand. Installing this is definitely on my to-do list!
Is it necessary to put the text to be annotated into span tags (class=”adso”)?
[…] software for blogging. This will annotate Chinese characters with all-important word parsing. Trevelyan’s post provides a download link and […]
@Mark S - that’s exactly how it works. Once the divs and javascript includes are loaded (putting them at the top of the BODY tag can prevent formatting problems with the position of the popup), any content marked with the class “adso” will be on-click annotateable/editable.
If you install the WordPress plugin (adsotrans.php) into your plugins directory, all UTF8 content in any posts and comments will be automatically wrapped with the necessary span tags: there’s no need to manually create the surrounding span tags.
If you don’t install the WordPress plugin (adsotrans.php) you will have to manually wrap any content you want annotated in the proper span tags. If you want to change this behavior or edit the classname, download the file “api.js” and serve the modified version from your own site.
So cool - I’ve used dimsum before but had some difficulties with it. Is there any possibility that this could be turned into a general plugin for IE or firefox? I would pay for it (shareware type costs, not development!) Or does anyone know if this already exists somewhere?
@Michael,
Have you looked at Chinese Peraperakun? This is a Firefox plugin that uses the backend Adso database and offers on-mouseover popups. The version at Mozilla hasn’t been updated in a while, but we’re looking at automating a daily build.
https://addons.mozilla.org/zh-CN/firefox/addon/3349
So how do I install this plugin with Wordpress if Worpress blogs do not allow plugins?
I understand now. I actually need to host my own blog. Anyway to use this plugin without hosting your own blog?
Hi Howard,
You should be able to get the API working on any site — you don’t need to be using WordPress. Here’s how:
(1) Include the following right after your opening BODY tag:
<div id=”adso_tooltip”></div>
<div id=”adso_pointer”></div>
<script language=”javascript” src=”http://adsotrans.com/wordpress/js/jquery-1.2.2.pack.js”></script>
<script language=”javascript” src=http://adsotrans.com/wordpress/js/api.js></script>
(be careful that you include actual quotation marks not “chinese” quote marks)
(2) Mark any text that you want users to be able to annotate with the class “adso”. ie:
<span class=”adso”>甄士隐梦幻识通灵贾雨村风尘怀闺秀<span>
The Wordpress plugin parses posts/comments for Chinese text and automatically wraps them in a suitable span tag. But there’s no reason you can’t create those tags yourself, or change whatever system you ARE using so that it produces them. If you’re using another blogging platform or CMS, you might want to take a look at the code I’m distributing in the WordPress plugin (the file is “adsotrans.php”). It is a short function which takes in text, and outputs the same text with UTF8 content wrapped in the necessary span tags. Should be simply to adapt to your needs.
Also, bear in mind that the engine will only adsotate about 500 or so characters at any request. The restriction is to keep the annotation time reasonable and prevent the server from bogging down. It also makes longer passages more readable because that words people add in the first paragraph will already in the system by the time they annotate the second. This isn’t a problem with the plugin since it breaks span tags whenever it runs into a non-UTF8 character (such as ASCII, or newlines or HTML markup). If you end up manually crafting your span tags (instead of letting the system do it) you should avoid created monster span tags containing paragraphs and paragraphs of data.
Let me know if you run into any problems.
–david
Sorry, but if I may be pedantic for a second:
我们的新插件厉害的不得了! should be 我们的新插件厉害得不得了!
I only bring this up because I see the phrase 厉害的不得了 is now in the database, whereas 厉害得不得了 (for the moment) is not.
Admittedly, a good portion of native speakers might write it that way… So is the goal to have both in the database? Should Adso treat 得/的 interchangeably?
This is all made much easier with more convenient user editing, of course…
@john - both are in use so the software should support both. tagging any word as a “PHRASE” can be used to signal that the entry isn’t a proper term segmentation-wise. That’s the approach I’m taking, although suggestions are welcome.
We also have a “definition” field in the database for commentary and explication.
[…] 如我们的原英文博客所说,Adso最近开发了一个可以帮助您在自己的页面上添加和编辑中文注解的新功能。想了解这个功能有多厉害?直接点击这个页面的中文文本。马上,你就会发现在你的鼠标下神奇地出现了一个中文自然语言分析系统创造的奇迹.。 […]
It seems the Firefox addon Chinese Peraperakun does not compatible with latest version of Firefox. And it is so huge with 6.8M, is it using a local dictionary bundled with addon or an online one?
@Tangos - it’s a downloadable version using data from an older release of the Adso database. Gets updated whenever the developer feels like it. We may shift to hosting it and making a nightly database release eventually though. Pretty much depends on the original developer.
so maybe you should develop another Firefox addon, I think it would be much more useful for a foreigner than a WP plugin.
[…] also an experiment in radically simplifying web design, and a good example of the power our new Adso API provides to external web […]
It’s a great tool! If the Chinese words can also be spoken by this tool, then it would be perfect.
How does one edit the English translation of a word, instead of just the pinyin?
Also, did you know this plugin transforms any clicked character into the simplified variant?
[…] is a demonstration of David’s new Adsotrans plugin. Below is a copy of 85度C’s drink menu. Click on any Chinese words you can’t read to […]
Had a thought - it’d be nice to have an option to toggle a dotted underline under the characters so people know to actually mouseover them and click them. Otherwise they might just see the Chinese text and ignore it.
[…] even have a few goodies like passages from Honglou Meng and Lu Xun. I have tried installing the Adsotrans plugin on this site, but it doesn’t seem to be working. Maybe I have to fiddle with it some more. […]