{"id":20238505,"url":"https://github.com/cadmiumcr/wordnet","last_synced_at":"2025-04-10T19:35:30.285Z","repository":{"id":91428149,"uuid":"204194629","full_name":"cadmiumcr/wordnet","owner":"cadmiumcr","description":"Pure crystal implementation of Stanford NLPs WordNet","archived":false,"fork":false,"pushed_at":"2023-12-19T22:01:19.000Z","size":8364,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T17:13:38.474Z","etag":null,"topics":["cadmium","crystal","crystal-lang","machine-learning","ml","natural-language-processing","nlp","stanford-nlp","wordnet"],"latest_commit_sha":null,"homepage":null,"language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cadmiumcr.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-24T18:08:51.000Z","updated_at":"2023-12-19T22:01:24.000Z","dependencies_parsed_at":"2024-02-21T23:32:24.415Z","dependency_job_id":null,"html_url":"https://github.com/cadmiumcr/wordnet","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/cadmiumcr%2Fwordnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cadmiumcr%2Fwordnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cadmiumcr%2Fwordnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cadmiumcr%2Fwordnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cadmiumcr","download_url":"https://codeload.github.com/cadmiumcr/wordnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281423,"owners_count":21077423,"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":["cadmium","crystal","crystal-lang","machine-learning","ml","natural-language-processing","nlp","stanford-nlp","wordnet"],"created_at":"2024-11-14T08:34:32.739Z","updated_at":"2025-04-10T19:35:30.276Z","avatar_url":"https://github.com/cadmiumcr.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cadmium::Wordnet\n\n\u003e\u003e WordNet® is a large lexical database of English. Nouns, verbs, adjectives and adverbs are grouped into sets of cognitive synonyms (synsets), each expressing a distinct concept. Synsets are interlinked by means of conceptual-semantic and lexical relations. - [https://wordnet.princeton.edu/](https://wordnet.princeton.edu/)\n\nThis WordNet implimentation is based almost completely on [doches](https://github.com/doches) ruby library [rwordnet](https://github.com/doches/rwordnet) with some extras thrown in and, of course, backed by the speed and type safety of Crystal. This is experimental and the API may change, but WordNet brings the power of the English (and hopefully other languages in the future) dictionary to your programs.\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     cadmium_wordnet:\n       github: cadmiumcr/wordnet\n   ```\n\n2. Run `shards install`\n\n## Usage\n\nUsing it is easy with Cadmium's API.\n\n```crystal\nrequire \"cadmium_wordnet\"\n\n# Lookup a single word with a specific part of speech\nlemma = Cadmium.wordnet.lookup(\"horse\", :n)\nputs lemma.word.capitalize + \" - \" + lemma.pos\nlemma.synsets.each_with_index do |synset, i|\n  puts \"#{i + 1}. #{synset.gloss}\"\nend\n\n# Lookup a single word accross all parts of speech\nlemmas = Cadmium.wordnet.lookup(\"horse\")\nlemmas = lemmas.map { |l| {word: l.word, pos: l.pos, synsets: l.synsets} }\nlemmas.each do |l|\n  word = l[:word].capitalize\n  pos = l[:pos]\n  l[:synsets].each do |s|\n    puts \"#{word} (#{pos}) - #{s.gloss}\"\n  end\nend\n\n\n# Lookup a definition by offset and part of speech\nsynset = Cadmium.wordnet.get(4424418, :n)\nputs \"---------------------------------------------\"\nputs synset.synset_offset\nputs synset.pos\nputs synset.gloss\nputs synset.word_counts\n```\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/cadmiumcr/wordnet/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Chris Watson](https://github.com/cadmiumcr) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcadmiumcr%2Fwordnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcadmiumcr%2Fwordnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcadmiumcr%2Fwordnet/lists"}