npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

isidore

v1.0.0

Published

Isidore.js: A grammar utility for the internet

Downloads

3

Readme

Isidore: A grammar utility for the internet

An experimental, potentially multilingual, highly configurable part-of-speech tagger.

This is still somewhat experimental.. Verb identification, in particular, is still limited. Please monitor the issuer tracker for progress on feature development.

dev dependency status License Downloads

API

PartsOfSpeech

There is a class per part of speech. All parts of speech inherit from the word class:

Word Class

| Member | Type | Description | |-------| -----| -------------| | partOfSpeech | string | one of the eight parts of speech| | word | string | the word (token) | | type | string | a high-level classification for this partOfSpeech | | types | array | all possible types for this partOfSpeech |

Parts of Speech:

  • Noun
  • Pronoun
  • Verb
  • Adjective
  • Adverb
  • Conjunction
  • Interjection
  • Preposition

These may all have additional members.

Dictionaries

There is a dictionary class per part-of-speech. All dictionaries inherit from the Dictionary class. Any rules about how words can vary (inflections) are stored in the Dictionary for that part of speech (e.g. NounDictionary has rules about how to recognize plurals and possessives);

This is so that Isidore could have potential to scale into other languages without requiring massive rewrites.

Dictionary

| Member | Type | Description | |-------| -----| -------------| | list | array | sorted list of words | | language | string | Language for the dictionary | | findWord() | method | finds a word in the dictionary | | partOfSpeech | string | the part of speech that dictionary has | | GrammarModel | class | The type that the dictionary contains |

NounDictionary class:

| Member | Type | Description | |-------| -----| -------------| | list| array | Nouns with types and wordCategories| | language | string | two-letter abbreviation of language| | inflections | object | inflections that can be applied to all nouns | | findWord(word) | method | Searches for word in dictionary (returns Noun if successful) | | getInflections(word) | method | word (string), returns all possible inflections for the word | | guessInflection(word) | method | (string), returns a single inflection (object) | | removeInflection(word, inflection) | method | word(string), inflection (object). returns string |

Languages

All languages within the utility. Right now we just have En, which is a Language;

Language class

| Member | Type | Description | |-------| -----| -------------| |grammarDictionaries | Object | NounDictionary, PronounDictionary, VerbDictionary, AdjectiveDictionary, AdverbDictionary, ConjunctionDictionary, InterjectionDictionary, PrepositionDictionary | language | string | two-letter description of language| | findWord() | method | accepts a string, returns an array containing partOfSpeech or a word if no word is found

Sentence

The sentence is where the parsing magic starts.

Sentence Class

| Member | Type | Description | |-------| -----| -------------| | text| string | raw text of the sentence | |type | string | declarative, interrogative, imperative, exclamatory| | language | string | Language (En) is default| | rawWordList| array | only the words in the sentence | | wordList| array | each word in the sentence classified as either a or word | | types | array | the possible types that a sentence could have | | getSentenceType() | method | returns string, the type of sentence. Guesses what the sentence type is based on punctuation |

Example

const { Sentence } = isidore
const mySentence = new Sentence('He gives her a car.');
const { wordList } = mySentence;

console.log(mySentence);
/*
Sentence {
    text: 'He gives him a car.',
    language: 'En',
    rawWordList: [ 'he', 'gives', 'him', 'a', 'car' ],
    wordList:
    [
        Pronoun {
            partOfSpeech: 'pronoun',
            word: 'he',
            referent: 'animate',
            gender: 'masculine',
            type: 'subject',
            person: 3,
            quantity: 'singular'
        },
        Verb {
            partOfSpeech: 'verb',
            word: 'give',
            type: 'transitive',
            valence: 2
        },
        Pronoun {
            partOfSpeech: 'pronoun',
            word: 'him',
            referent: 'animate',
            gender: 'masculine',
            type: 'object',
            person: 3,
            quantity: 'singular',
        },
        Adjective {
            partOfSpeech: 'adjective',
            word: 'a',
            type: 'article',
            degree: undefined
        },
        Noun {
            partOfSpeech: 'noun',
            word: 'car',
            type: 'entityClass',
            subType: 'common',
            inflection: undefined
        }
    ],
    type: 'declarative'
}
    */