“tag cloud” generators?

南笙酒味 提交于 2019-12-05 20:35:59

问题


I would like to add a "tag cloud" to a project I'm working on. I see tons of them via google, but they seem to mostly be "enter an url" type.

Here's an example of what I mean:

I'm looking for one which either has either

  • a nice web-accessible api
  • a standalone local executable (linux preferred)
  • a linkable library (c,python preferred)

of course, other options and suggestions appreciated!

update: it seems what I am looking for is commonly called a tag cloud and not a text cloud, even though I am interested in using it to view blocks of text.

update 2: the Most Excellent Jonathan Feinberg and IBM have release Wordle... hooray!!!

http://www.wordle.net


回答1:


I'm not sure if you are referring to a simple (ala Flickr) tag cloud, or something a little more complicated like Wordle.

Anyway, if you are looking for a simple tag cloud, it wouldn't be too difficult to implement it yourself (as long as you already have the ability to render HTML) as it is just changing the size and/or colour of each item based on its frequency (or some other measure).

If you want to use an existing library you could look at one of the opensource php versions, like Tag Cloud, put just run them locally on your machine using php rather than through a web server. Just install php and run php filename.php similar to how you would execute a python script.

Looking at the Wordle service, there appears to be no way to automatically create one, as they use a java applet to generate the graphics, which cannot easily be scripted using curl. They do have a question in their FAQ about an API however:

Could you expose Wordle as a web service that generates images?

A scalable web service should take no more than a few tens of milliseconds to do its work. To create a Wordle requires multiple seconds in a Java runtime. (That pretty animation is not for show; it's really laying things out during the animation). Therefore, Wordle will always apportion the CPU-intensive stuff to you, the user, and your CPU.

As of this writing, Wordle is sustaining 10 hits per second. There's no way on Earth to render Wordles at that speed. Well there is a way, but it involves way more money than I've got.

Also, this previous question may help.




回答2:


This question is old and already answered, but I would like to say that Wordcram seems to be very nice. And it's open source.




回答3:


Here are two Python-Versions of a tag cloud:

  • https://github.com/atizo/PyTagCloud
  • http://peekaboo-vision.blogspot.de/2012/11/a-wordcloud-in-python.html

I search a lot these days and it seems that those two are some of the few "stand-alone" tag cloud generators, which run in Linux (in particular those run in python) on the command line.



来源:https://stackoverflow.com/questions/574173/tag-cloud-generators

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!