This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************ | |
*WordCloud methods below are modifications of wordcloud by yoah.bardavid@gmail.com and razbarvaz@gmail.com | |
*wordcloud is part of the following project: http://visapi-gadgets.googlecode.com | |
*The visapi-gadgets project is licensed under Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | |
*Modifications include: | |
* inclusion of a some sort of a log scale | |
* exclusion of single letter words | |
* exclusion of excludedTerms | |
* exclusion of numbers | |
* attempt to merge plural and singular |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
makeSearchCommand({ | |
//to subscribe to the command ,go to: <http://gist.github.com/13700> | |
//project: <http://code.google.com/p/tl-ubiquity-commands/> | |
author: {name: "Thomas Lemberger", email: "thomas.lemberger@gmail.com"}, | |
license: "GPL", | |
name: "pubmed", | |
help: "Search selected terms or directly typed in the input line. The number of records to be displayed can be specified by adding '#number' somewhere in the query (eg. #3 will show only 3 records, default is 5, maximum is 15).", | |
url: "http://www.ncbi.nlm.nih.gov/pubmed?term={QUERY}", | |
icon: "http://www.ncbi.nlm.nih.gov/favicon.ico", | |
description: "Searches <a href='http://www.ncbi.nlm.nih.gov/pubmed'>PubMed</a>.", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
names: ["rewrap"], | |
arguments: [{role: "object", | |
nountype: noun_arb_text, | |
label: "input"}], | |
help: "removes unnecessary carriage returns and strings of spaces", | |
execute: function(arguments) { | |
var selectedText=arguments.text; | |
selectedText=selectedText.replace(/[\r\n]{2}/g,"§#!"); | |
selectedText=selectedText.replace(/[\r\n]+/g," "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function HTMLescape(string) { | |
var LT = new RegExp("<", "g"); | |
var GT = new RegExp(">", "g"); | |
var AMP = new RegExp("&", "g"); | |
var TAB = new RegExp("\t", "g"); | |
return string.replace(AMP,"&").replace(LT, "<").replace(GT, ">").replace(TAB, "..."); | |
} | |
CmdUtils.CreateCommand({ | |
name: "whatizit", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
//to subscribe to the command, go to http://gist.github.com/15544 | |
//code maintained at http://code.google.com/p/tl-ubiquity-commands/ | |
author: {name: "thomas lemberger", email: "thomas.lemberger@embo.org"}, | |
license: "GPL", | |
name: "more-like-this", | |
takes: {"selected text": noun_arb_text}, | |
help: "The command is based on Jane (http://www.biosemantics.org/jane/, Schuemie & Kors (2008) Bioinformatics.24:727). It lists PubMed records related to the selected text (typically an abstract).", | |
execute: function(directObj) { | |
var selectedText=directObj.text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
//to install this command, visit http://gist.github.com/21865 | |
//code is part of http://code.google.com/p/tl-ubiquity-commands/ | |
name: "open-doi", | |
takes: {"selected text": noun_arb_text}, | |
preview: function(pblock, directObject){ | |
if (directObject.text){ | |
var m = directObject.text.match(/(doi:)?.*?\b(10\.\d{4}\/\S+)/i); | |
if (!m){pblock.innerHTML="The selection <pre>"+directObject.text+"</pre> does not include a recognized doi !";} | |
else {pblock.innerHTML="press Return to go to the document associated with <i>"+m[2]+"</i>.";} |