{"id":15689602,"url":"https://github.com/rse/wordnet-lmf","last_synced_at":"2025-05-07T23:02:42.240Z","repository":{"id":57399082,"uuid":"134245391","full_name":"rse/wordnet-lmf","owner":"rse","description":"WordNet Lexical Markup Framework (LMF)","archived":false,"fork":false,"pushed_at":"2023-01-21T11:11:04.000Z","size":109,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-04T17:46:00.488Z","etag":null,"topics":["lmf","sqlite","wordnet","xml"],"latest_commit_sha":null,"homepage":"http://npmjs.com/wordnet-lmf","language":"JavaScript","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/rse.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":"2018-05-21T09:08:53.000Z","updated_at":"2024-11-02T16:53:01.000Z","dependencies_parsed_at":"2023-02-12T09:16:03.233Z","dependency_job_id":null,"html_url":"https://github.com/rse/wordnet-lmf","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fwordnet-lmf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fwordnet-lmf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fwordnet-lmf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fwordnet-lmf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rse","download_url":"https://codeload.github.com/rse/wordnet-lmf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252968102,"owners_count":21833251,"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":["lmf","sqlite","wordnet","xml"],"created_at":"2024-10-03T18:03:28.591Z","updated_at":"2025-05-07T23:02:42.212Z","avatar_url":"https://github.com/rse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nWordNet-LMF\n===========\n\nWordNet Lexical Markup Framework (LMF)\n\n\u003cp/\u003e\n\u003cimg src=\"https://nodei.co/npm/wordnet-lmf.png?downloads=true\u0026stars=true\" alt=\"\"/\u003e\n\n\u003cp/\u003e\n\u003cimg src=\"https://david-dm.org/rse/wordnet-lmf.png\" alt=\"\"/\u003e\n\nAbout\n-----\n\nThis is a [Node.js](https://nodejs.org) Command-Line Interface (CLI)\nand underlying Application Programming Interface (API) for parsing\n[WordNet-LMF XML](https://github.com/globalwordnet/schemas) format files\nand importing the data into compact SQLite database file.\n\nThe motivation for this approach is: a 100MB LMF XML consumes about\n1GB of RAM (due to the XML DOM) and is very slow on querying, while\nthe corresponding SQLite database file is just about 20% of the size\nof the LMF XML file and can be queried very fast and with harmless RAM\nconsumption.\n\nThis NPM module comes with just the LMF CLI and API for processing LMF\nXML files and does not ship with any particular LMF XML files. See the\ncompanion modules [wordnet-lmf-en](https://npmjs.com/wordnet-lmf-en)\nand [wordnet-lmf-de](https://npmjs.com/wordnet-lmf-de) for English and\nGerman WordNets in LMF XML/SQLite format.\n\nData Model\n----------\n\nBased on the [WordNet-LMF XML](https://github.com/globalwordnet/schemas) DTD,\nwe derived and documented the [LMF Data Model](wordnet-lmf-dm.pdf) we are using in\nthis NPM module.\n\nLinks\n-----\n\n- [Global WordNet](http://globalwordnet.org/)\n- [Princeton WordNet (PWN)](https://wordnet.princeton.edu/)\n- [Open Multilingual Wordnet](http://compling.hss.ntu.edu.sg/omw/)\n\nInstallation\n------------\n\n```shell\n$ npm install wordnet-lmf\n```\n\nCommand-Line Interface (CLI)\n----------------------------\n\n```sh\n$ wordnet-lmf -d wordnet-lmf-en.db import -f easysax -e 2 wordnet-lmf-en.xml\n$ wordnet-lmf -d wordnet-lmf-en.db query \"SELECT * FROM Lemma WHERE writtenForm LIKE '%speaker%';\"\n┌────────────────┬────────────────────────┬──────────────┐\n│ lexicalEntryId │ writtenForm            │ partOfSpeech │\n├────────────────┼────────────────────────┼──────────────┤\n│ w116312        │ Speaker                │ n            │\n│ w74130         │ speakerphone           │ n            │\n│ w84953         │ speaker identification │ n            │\n│ w69725         │ speaker system         │ n            │\n│ w42001         │ speakership            │ n            │\n│ w116311        │ native speaker         │ n            │\n│ w74274         │ intercom speaker       │ n            │\n│ w69721         │ loudspeaker            │ n            │\n│ w69724         │ loudspeaker system     │ n            │\n│ w69722         │ speaker                │ n            │\n│ w114606        │ public speaker         │ n            │\n│ w69723         │ speaker unit           │ n            │\n│ w115745        │ salutatory speaker     │ n            │\n│ w117119        │ valedictory speaker    │ n            │\n└────────────────┴────────────────────────┴──────────────┘\n```\n\nApplication Programming Interface (API)\n---------------------------------------\n\n```js\n(async () =\u003e {\n\n    const LMF   = require(\"wordnet-lmf\")\n    const LMFen = require(\"wordnet-lmf-en\")\n\n    console.log(LMFen.name)\n\n    let lmf = new LMF({ database: LMFen.db })\n    await lmf.open()\n\n    let results = await lmf.query(\n        \"SELECT * FROM Lemma WHERE writtenForm LIKE '%speaker%';\",\n        { format: \"table\" }\n    )\n    console.log(results)\n\n    results = await lmf.query(`\n        SELECT    l.writtenForm  AS writtenForm,\n                  l.partOfSpeech AS partOfSpeech,\n                  GROUP_CONCAT(s.synset, \";\") AS synset\n        FROM      Lemma l\n        LEFT JOIN Sense s\n        ON        s.lexicalEntryId = l.lexicalEntryId\n        WHERE     l.writtenForm LIKE '%speaker%'\n        GROUP BY  l.writtenForm\n    `, { format: \"table\" })\n    console.log(results)\n\n    await lmf.close()\n\n})().catch((err) =\u003e {\n    console.log(`ERROR: ${err}`)\n})\n```\n\n```\nOMW Princeton WordNet 3.1 (2011-05-26) [156K words, MIT-style]\n┌────────────────┬────────────────────────┬──────────────┐\n│ lexicalEntryId │ writtenForm            │ partOfSpeech │\n├────────────────┼────────────────────────┼──────────────┤\n│ w116312        │ Speaker                │ n            │\n│ w74130         │ speakerphone           │ n            │\n│ w84953         │ speaker identification │ n            │\n│ w69725         │ speaker system         │ n            │\n│ w42001         │ speakership            │ n            │\n│ w116311        │ native speaker         │ n            │\n│ w74274         │ intercom speaker       │ n            │\n│ w69721         │ loudspeaker            │ n            │\n│ w69724         │ loudspeaker system     │ n            │\n│ w69722         │ speaker                │ n            │\n│ w114606        │ public speaker         │ n            │\n│ w69723         │ speaker unit           │ n            │\n│ w115745        │ salutatory speaker     │ n            │\n│ w117119        │ valedictory speaker    │ n            │\n└────────────────┴────────────────────────┴──────────────┘\n┌────────────────────────┬──────────────┬─────────────────────────────────────┐\n│ writtenForm            │ partOfSpeech │ synset                              │\n├────────────────────────┼──────────────┼─────────────────────────────────────┤\n│ Speaker                │ n            │ eng-10-10631309-n                   │\n│ intercom speaker       │ n            │ eng-10-04292572-n                   │\n│ loudspeaker            │ n            │ eng-10-03691459-n                   │\n│ loudspeaker system     │ n            │ eng-10-03691459-n                   │\n│ native speaker         │ n            │ eng-10-10631131-n                   │\n│ public speaker         │ n            │ eng-10-10380672-n                   │\n│ salutatory speaker     │ n            │ eng-10-10549315-n                   │\n│ speaker                │ n            │ eng-10-03691459-n;eng-10-10630188-n │\n│ speaker identification │ n            │ eng-10-05763767-n                   │\n│ speaker system         │ n            │ eng-10-03691459-n                   │\n│ speaker unit           │ n            │ eng-10-03691459-n                   │\n│ speakerphone           │ n            │ eng-10-04270371-n                   │\n│ speakership            │ n            │ eng-10-00604424-n                   │\n│ valedictory speaker    │ n            │ eng-10-10745006-n                   │\n└────────────────────────┴──────────────┴─────────────────────────────────────┘\n```\n\nLicense\n-------\n\nCopyright (c) 2018-2023 Dr. Ralf S. Engelschall (http://engelschall.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frse%2Fwordnet-lmf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frse%2Fwordnet-lmf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frse%2Fwordnet-lmf/lists"}