WordNet is an open-source lexical database of the English language. It structures words together into groups of cognitive synonyms, or "synsets", representing a unique concept. The neoWordNet package allows you to easily create your own WordNet instance in Neo4j, a leading graph database.
install.packages("devtools")
devtools::install_github("bloyal/neoWordNet")
library(neoWordNet)
All neoWordNet functions require you to first download, install, and start a Neo4j instance. Please refer to the Neo4j download page for more information.
Use the getAndCreateNeoWn
function to download the required database files and create a Wordnet graph all at once. The function returns a graph
object that can be used with Nicole White's RNeo4j package (included with neoWordNet) to query the database.
graph <- getAndCreateNeoWn(dest="Users/Brian/Downloads", url = "http://localhost:7474/db/data/", username="neo4j",password="password")
neoWordNet comes with a basic function for returning sense information and related terms for a given word.
getWordInfo(graph, word="hound")
## word pos sense gloss ...
## hound Noun 1 any of several breeds of dog...
## hound Noun 2 someone who is morally reprehensible...
## hound Verb 3 pursue or chase relentlessly...