addWordNet | R Documentation |
Adds terms from a WordNet thesaurus to a concept database, matching on term. It is recommended to restrict the wordnet categories to ensure that words with multiple meanings are not linked to the wrong synonym.
addWordNet(CDB_TABLE, wn_categories, WN, CHECK_TABLE = NULL)
CDB_TABLE |
data.frame or data.table with columns conceptId (integer64) and term (character, with space before and after) containing existing descriptions in the CDB |
wn_categories |
WordNet categories to use |
WN |
WordNet data.table as returned by downloadWordnet |
CHECK_TABLE |
other table in the same format as CDB_TABLE to check for WordNet synonyms that link to another unrelated concept, where this synonym will be excluded because of the risk of errors |
CDB_TABLE with extra rows for Wordnet synonyms
https://wordnet.princeton.edu/
[downloadWordNet()]
WORDNET <- data.table::data.table(cat = c('noun.body', 'noun.state'),
wordnetId = bit64::as.integer64('1', '2'),
synonyms = list(c('heart', 'pump', 'ticker'),
c('infection', 'infectious')),
parents = list('cardiovascular system',
'pathologic process'),
adj = list('cardiac', 'infectious'))
# Add Wordnet synonyms to a concept database table
SNOMED <- sampleSNOMED()
CDB_TABLE <- description(c('Heart', 'Infection'),
include_synonyms = TRUE)[type == 'Synonym',
.(conceptId, term = paste0(' ', tolower(term), ' '))]
addWordNet(CDB_TABLE, 'noun.state', WORDNET)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.