Giter Club home page Giter Club logo

wordnets's People

Contributors

sudhanshuraheja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mdeora

wordnets's Issues

Search results include only one Part of Speech

Hey there, first of thanks for the library! 100x easier than scripting with the WordNet CLI, and perfect for my use-case.

I noticed that results from searchFor and searchSimpleFor queries include only those from a single pos, though you'd expect matches from all types. For example, searchFor(['smart']) results in:

Map(1) {
  'smart' => {
    lemma: 'smart',
    pos: 'noun',
    offsetCount: 1,
    pointerCount: 2,
    pointers: [
      { symbol: 'Hypernym', offset: 0, pos: 'noun' },
      { symbol: 'Derivationally related form', offset: 0, pos: 'noun' }
    ],
    senseCount: 1,
    tagSenseCount: 0,
    offsets: [ 14355278 ],
    isComment: false,
    offsetData: [
      {
        offset: 14355278,
        pos: 'noun',
        wordCount: 3,
        words: [ 'smart', 'smarting', 'smartness' ],
        pointerCnt: 5,
        pointers: [
          { symbol: 'Hypernym', offset: 14346126, pos: 'noun' },
          { symbol: '+', offset: 1517459, pos: 'adjective' },
          {
            symbol: 'Derivationally related form',
            offset: 2126629,
            pos: 'verb'
          },
          { symbol: '+', offset: 1517459, pos: 'adjective' },
          {
            symbol: 'Derivationally related form',
            offset: 2126629,
            pos: 'verb'
          }
        ],
        glossary: [
          'a kind of pain such as that caused by a wound or a burn or a sore'
        ],
        isComment: false
      }
    ]
  }
}

This represents only the noun senses of the word, though clearly by looking in the database files, there are verb and adjective senses as well. For example, searchOffsetsInDataFor([01338411]) results in:

Map(1) {
  1338411 => {
    offset: 1338411,
    pos: 'adjective satellite',
    wordCount: 2,
    words: [ 'bright', 'smart' ],
    pointerCnt: 3,
    pointers: [
      { symbol: 'Similar to', offset: 1337350, pos: 'adjective' },
      {
        symbol: 'Derivationally related form',
        offset: 5628738,
        pos: 'noun'
      },
      {
        symbol: 'Derivationally related form',
        offset: 5628738,
        pos: 'noun'
      }
    ],
    glossary: [
      'characterized by quickness and ease in learning',
      '"some children are brighter in one subject than another"',
      '"smart children talk earlier than the average"'
    ],
    isComment: false
  }
}

Which seems like it should be the most common and obvious sense of the word smart. By default, the WordNet CLI returns all senses of all parts of speech when using the -over flag -- could you replicate this behavior in this library? Or is it already a feature and I'm just using it wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.