Skip to content

lloyd/wnram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An in-memory Go Library for WordNet

This is a go language library for accessing Princeton's wordnet.

Implementation Overview

This library is a native golang parser for wordnet which stores the entire thing in RAM. This approach was taken for faster access times because the wordnet database sits in only about 80MB of ram, which is not a lot these days. Parsing the full data files takes around two seconds on a modest laptop.

Supported features

  • Lookup by term
  • Synonyms
  • All relation types (Antonyms, Hyponyms, Hypernyms, etc)
  • Iteration of the database
  • Lemmatization

Missing features

  • Morphology - specifically generating a lemma from input text

Example Usage

import (
    "log"

    "github.com/lloyd/wnram"
)

func main() {
    wn := wnram.New("./path")
    // lookup "yummy"
    if found, err := wn.Lookup(Criteria{Matching: "yummy", POS: []PartOfSpeech{Adjective}}); err != nil {
       log.Fatal("%s", err)
    } else {
       // dump details about each matching term to console
       for _, f := range found {
           f.Dump()
       }
	}
}

License

BSD 2 Clause, see LICENSE.

About

No description, website, or topics provided.

Resources

License

BSD-2-Clause, Unknown licenses found

Licenses found

BSD-2-Clause
LICENSE
Unknown
LICENSE.wordnet

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages