{"id":16971004,"url":"https://github.com/timdream/wordfreq","last_synced_at":"2025-03-21T19:45:43.429Z","repository":{"id":5114991,"uuid":"6279222","full_name":"timdream/wordfreq","owner":"timdream","description":"Text corpus calculation in Javascript. Supports Chinese, English.","archived":false,"fork":false,"pushed_at":"2021-01-31T03:38:05.000Z","size":125,"stargazers_count":80,"open_issues_count":4,"forks_count":22,"subscribers_count":8,"default_branch":"gh-pages","last_synced_at":"2025-02-27T06:03:12.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://wordfreq.timdream.org/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mongo-express/mongo-express","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timdream.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-18T13:46:48.000Z","updated_at":"2024-06-05T08:13:21.000Z","dependencies_parsed_at":"2022-09-13T21:21:34.268Z","dependency_job_id":null,"html_url":"https://github.com/timdream/wordfreq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timdream%2Fwordfreq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timdream%2Fwordfreq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timdream%2Fwordfreq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timdream%2Fwordfreq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timdream","download_url":"https://codeload.github.com/timdream/wordfreq/tar.gz/refs/heads/gh-pages","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244858807,"owners_count":20522284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T00:48:14.880Z","updated_at":"2025-03-21T19:45:43.395Z","avatar_url":"https://github.com/timdream.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wordfreq [![Build Status](https://secure.travis-ci.org/timdream/wordfreq.png)](http://travis-ci.org/timdream/wordfreq)\n\n[Text corpus](https://en.wikipedia.org/wiki/Text_corpus) calculation in Javascript. \nSupports Chinese, English.\nSee [demo](http://timdream.org/wordfreq/).\n\nThis library is a spin-off project from [HTML5 Word Cloud](https://github.com/timdream/wordcloud).\n\n## Simple usage\n\nLoad `wordfreq.js` script to the web page, and run:\n\n    // Create an options object for initialization\n    var options = {\n      workerUrl: 'path/to/wordfreq.worker.js' };\n    // Initialize and run process() function\n    var wordfreq = WordFreq(options).process(text, function (list) {\n      // console.log the list returned in this callback.\n      console.log(list);\n    });\n\n`WordFreq()` methods are chainable, for example,\n\n    // Process 3 strings and get corpus of all the texts.\n    WordFreq(options)\n      .process(text).process(text2).process(text3)\n      .getList(function (list) {\n        console.log(list);\n      });\n\nTo use this library synchronously, load `wordfreq.worker.js` and use the `WordFreqSync` interface. Check `API.md` for available options and methods.\n\n### Command-line interface\n\nCommand-line interface is available, powered by [Node.js](http://nodejs.org/). To install globally, run\n\n    npm install -g wordfreq\n\nExample usage:\n\n    wordfreq ~/mypost.txt | less\n    cat ~/mypost.txt | wordfreq - | less\n\n## Algorithm \n\nCorpus is calculated with a simple N-gram algorithm and sub-string filter. \nHere is [an article](http://www.openfoundry.org/tw/foss-forum/8339--open-web-html5-) in Traditional Chinese on how HTML5 Word Cloud is being done.\n\n[Porter Stemming Algorithm](http://tartarus.org/~martin/PorterStemmer/) is included for processing English.\n\n## Testing\n\nTo run tests, first you would need to pull the required QUnit library by running\n\n    git submodule init\n    git submodule update\n\nThen, start a localhost HTTP server, for example,\n\n    python -m SimpleHTTPServer 8009\n\nPoint your browser to [http://localhost:8009/test/](http://localhost:8009/test/) to start testing.\n\nYou may also run the tests with PhantomJS by running\n\n    phantomjs test/qunit/addons/phantomjs/runner.js http://localhost:8009/test/\n\nYou will find all the information you need to write testcases on the [QUnit](http://qunitjs.com) website.\nAll non-trivial code submission are expected to accompany with testcases.\n\n**Known IE10 issue**: Looks like IE10 suffers from [the same issue](https://bugzilla.mozilla.org/show_bug.cgi?id=785248) with Firefox \u003c= 17, where Web Worker will choke and couldn't finish the entire test suite.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimdream%2Fwordfreq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimdream%2Fwordfreq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimdream%2Fwordfreq/lists"}