{"id":23924579,"url":"https://github.com/moos/wordpos-web","last_synced_at":"2025-08-10T08:09:03.305Z","repository":{"id":52130257,"uuid":"231074866","full_name":"moos/wordpos-web","owner":"moos","description":"wordpos for the web/browser","archived":false,"fork":false,"pushed_at":"2021-05-07T02:00:28.000Z","size":8443,"stargazers_count":43,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-05T01:16:42.975Z","etag":null,"topics":["adjective","adverb","grammar","language","noun","pos","verb","wordnet"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-31T10:59:57.000Z","updated_at":"2024-07-28T06:27:09.000Z","dependencies_parsed_at":"2022-08-13T01:21:27.875Z","dependency_job_id":null,"html_url":"https://github.com/moos/wordpos-web","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/moos/wordpos-web","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moos%2Fwordpos-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moos%2Fwordpos-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moos%2Fwordpos-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moos%2Fwordpos-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moos","download_url":"https://codeload.github.com/moos/wordpos-web/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moos%2Fwordpos-web/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269693593,"owners_count":24460248,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["adjective","adverb","grammar","language","noun","pos","verb","wordnet"],"created_at":"2025-01-05T19:15:39.179Z","updated_at":"2025-08-10T08:09:03.257Z","avatar_url":"https://github.com/moos.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"wordpos-web\n=======\n\n[![NPM version](https://img.shields.io/npm/v/wordpos-web.svg)](https://www.npmjs.com/package/wordpos-web)\n\n**CDNs:** [![](https://data.jsdelivr.com/v1/package/npm/wordpos-web/badge)](https://www.jsdelivr.com/package/npm/wordpos-web)\n\n\n[wordpos](https://github.com/moos/wordpos) is a set of *fast* part-of-speech (POS) utilities for Node.js **and** browser using fast lookup in the WordNet database.\n\n**wordpos-web** formats the WordNet DB files to allow running *wordpos* in the browser.\n\n📣 [Demo](https://moos.github.io/wordpos-web/docs)\n\n\n## Installation\n\n     npm install wordpos-web\n\n\n## wordpos API Docs\nSee [wordpos/README](https://github.com/moos/wordpos).\n\n## Running inside the browsers\n\nv2.0 of [wordpos](https://github.com/moos/wordpos) introduces the capability of running in the browser.  The dictionary files are optimized for fast access (lookup by lemma), but they must be fetched, parsed and loaded into browser memory.  The files are loaded on-demand (unless the option `preload: true` is given).\n\nThe dict files can be served locally or from CDN (see [samples/cdn](docs/cdn/)).  Include the following scripts in your `index.html`:\n```html\n\u003cscript src=\"wordpos/dist/wordpos.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  let wordpos = new WordPOS({\n    // preload: true,\n    dictPath: '/wordpos/dict',\n    profile: true\n  });\n\n  wordpos.getAdverbs('this is lately a likely tricky business this is')\n    .then(res =\u003e {\n      console.log(res); // [\"lately\", \"likely\"]\n    });\n\u003c/script\u003e\n```\nAbove assumes wordpos is installed to the directory `./wordpos`.  `./wordpos/dict` holds the index and data WordNet files generated for the web in a postinstall script.\n\nSee [samples/self-hosted](docs/self-hosted/).  \n\n### Using `preload` option\nWhen running inside the browse, you can request that the necessary index \u0026 data files be preloaded, rather than loaded on demand.\n\nUse this when you're **sure the files will be used** and want to minimize the on-demand wait time.\n\n```js\nlet wordpos = new WordPOS({\n  preload: 'a',       // Preload adjectives index file.\n  includeData: true,  // Also preload the adjectives data file.\n  dictPath: '/wordpos/dict'\n});\n\nwordpos.ready().then(()=\u003e {\n  // files are loaded\n});\n```\nSee [wordpos#options](https://github.com/moos/wordpos#options) for other `preload` options.\n\n## A note on file sizes\nThe original WordNet DB is around 35 MB.  The size of the \"index\" and \"data\" files formatted for the web are as follows (before any compression):\n\n\n| POS | data | index |\n| --- | --- | --- |\n| adverbs | 525 KB | 170 KB |\n| verbs | 2.7 MB | 534 KB |\n| adjectives | 3.1 MB | 851 KB |\n| nouns | 15 MB\u003csup\u003e🚩\u003c/sup\u003e | 4.8 MB |\n| All (raw) | 21.3 MB | 6.4 MB |\n| All (gzip) | ~6 MB | 1.7 MB |\n\n\n\u003csup\u003e🚩\u003c/sup\u003e Be aware this is a very large file and may take some time to fetch.\n\nResources fetched over CDN will be compressed.  For example, the compressed noun files are 4.1 MB (data) and 1.3 MB (index).  If you are self-hosting, ensure gzip compression is on for your server.\n\nSome wordpos API need just the \"index\" file, while others need both.  Here's the breakdown:\n\n| API | data | index |\n| --- | --- | --- |\n| `get?()` | ✖️ | ✔️ |\n| `is?()` | ✖️ | ✔️ |\n| `lookup?()` | ✔️ | ✔️ |\n| `seek()` | ✔️ | ✔️ |\n| `rand?()` | ✖️ | ✔️ |\n\nThe following API will access **all POS** files:\n- `getPOS()` -- all index files\n- `lookup()` -- all index files \u0026 data files for matched word\n- `rand()` -- all index files\n\n\n## Dev\nTo run samples, `npm i -g http-server`, then:\n\n```bash\n$ npm run build\n$ npm run start\nStarting up http-server, serving ./\nAvailable on:\n  http://localhost:8080\n```\nand open your browser to that url.\n\n\n## Changes\n- 1.0.2 - Build samples/ to docs/.\n- 1.0.1 - Fix self-hosted sample dict/ path\n- 1.0.0 - Initial web version\n\n\nLicense\n-------\n\nhttps://github.com/moos/wordpos-web\nCopyright (c) 2012-2020 mooster@42at.com\n(The MIT License)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoos%2Fwordpos-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoos%2Fwordpos-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoos%2Fwordpos-web/lists"}