<commit_before># lexrank.js

LexRank (Text summarization) in JavaScript

- requires [pagerank.js](https://github.com/iinm/pagerank.js)

## Usage

Define sentence splitter and word segmenter.

```javascript
// example (Japanese)

var sent_splitter_ja = function(text) {
  return text.replace(/([。．？！]+)/g, '$1|').split('|');
};

// http://chasen.org/~taku/software/TinySegmenter/
var _segmenter = new TinySegmenter();

var word_segmenter_ja = function(sent) {
  return _segmenter.segment(sent)
           .map(function(w) { return w.trim(); })<commit_msg>create demo application<commit_after># lexrank.js

LexRank (Text summarization / テキスト要約) in JavaScript

- requires [pagerank.js](https://github.com/iinm/pagerank.js)

## Demo

- <a href="http://iinm.github.io/lexrank.js/" target="_blank">Japanese / 日本語</a>
- English / 英語 (preparing)

## Usage

Define sentence splitter and word segmenter.

```javascript
// example (Japanese)

var sent_splitter_ja = function(text) {
  return text.replace(/([。．？！]+)/g, '$1|').split('|');
};

// http://chasen.org/~taku/software/TinySegmenter/
var _segmenter = new TinySegmenter();

var word_segmenter_ja = function(sent) {
  return _segmenter.segment(sent)
           .map(function(w) { return w.trim(); })
{'fraction_non_alphanumeric': 0.1751004016064257, 'fraction_numerical': 0.001606425702811245, 'mean_word_length': 4.347639484978541, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5572809', 'n_tokens_mistral': 467, 'n_tokens_neox': 449, 'n_words': 87}