wordnet-verbdatamap

0.1.5 • Public • Published

wordnet-verbdatamap

NPM

Get verb data of WordNet as map.

Use wordnet-verbdatamap.nogloss, if gloss is not needed.
Use wordnet-verbdatamap.min, if minification is needed.

const verbDataMap = require('wordnet-verbdatamap');
// verbDataMap [Map]
// {synset_offset => {lex_filenum, ss_type, w_cnt, words, p_cnt, pointers, f_cnt, frames, gloss}}
// {words: {word, lex_id}}
// {pointers: {pointer_symbol, synset_offset, pos, source, target}}
// {frames: {f_num, w_num}}

verbDataMap.get(1740);
// { lex_filenum: 29,
//   ss_type: 'v',
//   w_cnt: 4,
//   words:
//    [ { word: 'breathe', lex_id: 0 },
//      { word: 'take_a_breath', lex_id: 0 },
//      { word: 'respire', lex_id: 0 },
//      { word: 'suspire', lex_id: 3 } ],
//   p_cnt: 21,
//   pointers:
//    [ { pointer_symbol: '*',
//        synset_offset: 5041,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '*',
//        synset_offset: 4227,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '+',
//        synset_offset: 3121972,
//        pos: 'a',
//        source: 3,
//        target: 1 },
//      { pointer_symbol: '+',
//        synset_offset: 832852,
//        pos: 'n',
//        source: 3,
//        target: 3 },
//      { pointer_symbol: '+',
//        synset_offset: 4087945,
//        pos: 'n',
//        source: 3,
//        target: 1 },
//      { pointer_symbol: '+',
//        synset_offset: 4257960,
//        pos: 'n',
//        source: 1,
//        target: 5 },
//      { pointer_symbol: '+',
//        synset_offset: 832852,
//        pos: 'n',
//        source: 1,
//        target: 1 },
//      { pointer_symbol: '^',
//        synset_offset: 4227,
//        pos: 'v',
//        source: 1,
//        target: 3 },
//      { pointer_symbol: '^',
//        synset_offset: 5041,
//        pos: 'v',
//        source: 1,
//        target: 3 },
//      { pointer_symbol: '$',
//        synset_offset: 2325,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '$',
//        synset_offset: 2573,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '~',
//        synset_offset: 2573,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '~',
//        synset_offset: 2724,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '~',
//        synset_offset: 2942,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '~',
//        synset_offset: 3826,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '~',
//        synset_offset: 4032,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '~',
//        synset_offset: 4227,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '~',
//        synset_offset: 5041,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '~',
//        synset_offset: 6697,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '~',
//        synset_offset: 7328,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '~',
//        synset_offset: 17024,
//        pos: 'v',
//        source: 0,
//        target: 0 } ],
//   f_cnt: 2,
//   frames: [ { f_num: 2, w_num: 0 }, { f_num: 8, w_num: 0 } ],
//   gloss: 'draw air into,  and expel out of,  the lungs; "I can breathe better when the air is clean"; "The patient is respiring"' }
verbDataMap.get(2325);
// { lex_filenum: 29,
//   ss_type: 'v',
//   w_cnt: 1,
//   words: [ { word: 'respire', lex_id: 1 } ],
//   p_cnt: 5,
//   pointers:
//    [ { pointer_symbol: '$',
//        synset_offset: 1740,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '@',
//        synset_offset: 2112831,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '+',
//        synset_offset: 3121972,
//        pos: 'a',
//        source: 1,
//        target: 1 },
//      { pointer_symbol: '+',
//        synset_offset: 832852,
//        pos: 'n',
//        source: 1,
//        target: 3 },
//      { pointer_symbol: '+',
//        synset_offset: 832472,
//        pos: 'n',
//        source: 1,
//        target: 1 } ],
//   f_cnt: 1,
//   frames: [ { f_num: 2, w_num: 0 } ],
//   gloss: 'undergo the biomedical and metabolic processes of respiration by taking up oxygen and producing carbon monoxide' }
verbDataMap.get(2778268);
// { lex_filenum: 43,
//   ss_type: 'v',
//   w_cnt: 1,
//   words: [ { word: 'deflagrate', lex_id: 0 } ],
//   p_cnt: 2,
//   pointers:
//    [ { pointer_symbol: '@',
//        synset_offset: 2768426,
//        pos: 'v',
//        source: 0,
//        target: 0 },
//      { pointer_symbol: '+',
//        synset_offset: 13471590,
//        pos: 'n',
//        source: 1,
//        target: 1 } ],
//   f_cnt: 2,
//   frames: [ { f_num: 8, w_num: 0 }, { f_num: 11, w_num: 0 } ],
//   gloss: 'cause to burn rapidly and with great intensity; "care must be exercised when this substance is to be deflagrated"' }

Readme

Keywords

Package Sidebar

Install

npm i wordnet-verbdatamap

Weekly Downloads

0

Version

0.1.5

License

MIT

Last publish

Collaborators

  • wolfram77