Skip to content

Instantly share code, notes, and snippets.

@rummelonp
Created August 31, 2010 08:17
Show Gist options
  • Save rummelonp/558716 to your computer and use it in GitHub Desktop.
Save rummelonp/558716 to your computer and use it in GitHub Desktop.
javascript:
(function() {
var url = "http://chasen.org/~taku/software/TinySegmenter/tiny_segmenter-0.1.js";
var script = document.createElement('script');
script.setAttribute('src', url);
script.setAttribute('type', 'text/javascript');
var head = document.querySelector('head');
if (head) {
head.appendChild(script);
} else {
return;
};
var text = getSelection().toString();
var segmenter = new TinySegmenter();
var segs = segmenter.segment(text);
prompt('', segs.join('|'));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment