# spencermountain/compromise

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/spencermountain-compromise).**

12,122 stars · 667 forks · JavaScript · MIT

## Links

- GitHub: https://github.com/spencermountain/compromise
- Homepage: http://compromise.cool
- awesome-repositories: https://awesome-repositories.com/repository/spencermountain-compromise.md

## Topics

`named-entity-recognition` `nlp` `part-of-speech`

## Description

Compromise is a natural language processing library and rule-based text parser designed to analyze unstructured text. It functions as a toolkit for identifying parts of speech, linguistic patterns, and semantic meaning, while providing specialized engines for named entity recognition and the parsing of temporal and numeric data.

The project is distinguished by its linguistic morphological engine, which can conjugate verbs across different tenses and inflect nouns and adjectives. It further allows for linguistic model customization through a plugin system that enables the extension of lexicons and the modification of baseline grammar rules.

The library covers a broad range of computational linguistics capabilities, including part-of-speech tagging, phonetic analysis, and sentence structure detection. It provides utilities for text normalization and formatting standardization, as well as tools for pattern matching, text statistics analysis, and the conversion of written numbers and currencies into structured values.

Processing performance is managed through parallel text parsing across worker threads and the use of partial parse caching for document segments.

## Tags

### Artificial Intelligence & ML

- [Natural Language Processing](https://awesome-repositories.com/f/artificial-intelligence-ml/natural-language-processing.md) — Analyzes raw text to identify linguistic patterns, parts of speech, and semantic meaning.
- [Rule-Based Text Parsers](https://awesome-repositories.com/f/artificial-intelligence-ml/rule-based-ai-systems/rule-based-text-parsers.md) — Provides a rule-based text parser that tokenizes strings and tags words using customizable grammars.
- [Textual Entity Extractors](https://awesome-repositories.com/f/artificial-intelligence-ml/entity-extraction-pipelines/textual-entity-extractors.md) — Identifies and extracts specific categories of information such as people, places, and organizations from text.
- [Grammatical Inflection Engines](https://awesome-repositories.com/f/artificial-intelligence-ml/grammatical-inflection-engines.md) — Provides a system to programmatically transform words into different grammatical forms, such as tenses and plurals.
- [Linguistic Pattern Analysis](https://awesome-repositories.com/f/artificial-intelligence-ml/linguistic-pattern-analysis.md) — Analyzes raw text to identify linguistic patterns, parts of speech, and semantic meaning. ([source](https://github.com/spencermountain/compromise/blob/master/package.json))
- [Morphological Transformations](https://awesome-repositories.com/f/artificial-intelligence-ml/morphological-transformations.md) — Transforms words by changing verb tenses, adjusting noun plurality, or converting adjectives to adverbs. ([source](https://github.com/spencermountain/compromise/blob/master/README.md))
- [Named Entity Recognition](https://awesome-repositories.com/f/artificial-intelligence-ml/named-entity-recognition.md) — Identifies and extracts specific categories of information like people, organizations, and dates from unstructured text. ([source](https://github.com/spencermountain/compromise#readme))
- [Natural Language Processing Libraries](https://awesome-repositories.com/f/artificial-intelligence-ml/natural-language-processing-libraries.md) — Functions as a comprehensive toolkit for parsing unstructured text to identify parts of speech and semantic meaning.
- [Part-of-Speech Taggers](https://awesome-repositories.com/f/artificial-intelligence-ml/part-of-speech-taggers.md) — Assigns grammatical tags to words to identify nouns, verbs, and adjectives. ([source](https://github.com/spencermountain/compromise#readme))
- [Pattern Matching Engines](https://awesome-repositories.com/f/artificial-intelligence-ml/pattern-matching-engines.md) — Features an engine that identifies linguistic entities by matching specific tag sequences and regular expressions.
- [Programmatic Grammar Manipulation](https://awesome-repositories.com/f/artificial-intelligence-ml/programmatic-grammar-manipulation.md) — Transforms word forms by adjusting verb tenses, noun plurality, and adjective degrees.
- [Text Tokenizers](https://awesome-repositories.com/f/artificial-intelligence-ml/text-tokenizers.md) — Splits raw text into individual words and punctuation marks using predefined linguistic patterns.
- [Computational Linguistics Toolkits](https://awesome-repositories.com/f/artificial-intelligence-ml/computational-linguistics-toolkits.md) — Provides tools for building custom dictionaries and rules to specialize text analysis for technical domains.
- [Domain Specializations](https://awesome-repositories.com/f/artificial-intelligence-ml/linguistic-pattern-analysis/domain-specializations.md) — Allows specializing linguistic analysis for specific domains by adding custom words and defining new tags. ([source](https://github.com/spencermountain/compromise/blob/master/README.md))
- [Sentence Structure Analysis](https://awesome-repositories.com/f/artificial-intelligence-ml/sentence-structure-analysis.md) — Detects whether a sentence is a question and identifies imperative moods or phrasal verbs. ([source](https://github.com/spencermountain/compromise/blob/master/changelog.md))

### Part of an Awesome List

- [Verb Tense Transformers](https://awesome-repositories.com/f/awesome-lists/devtools/text-manipulation/verb-tense-transformers.md) — Changes verb tenses including past participle, gerund, and future forms. ([source](https://github.com/spencermountain/compromise/blob/master/changelog.md))
- [Natural Language Processing](https://awesome-repositories.com/f/awesome-lists/ai/natural-language-processing.md) — Lightweight natural language processing.
- [JavaScript NLP Libraries](https://awesome-repositories.com/f/awesome-lists/devtools/javascript-nlp-libraries.md) — Lightweight natural language processing for the browser.

### Data & Databases

- [Natural Language Temporal Parsers](https://awesome-repositories.com/f/data-databases/temporal-data-converters/natural-language-temporal-parsers.md) — Converts human-readable date, time, and number strings into structured temporal and numeric data.
- [Partial Parse Caching](https://awesome-repositories.com/f/data-databases/performance-caching-systems/partial-parse-caching.md) — Stores previously parsed sentences and processes only modified segments to maintain performance. ([source](https://github.com/spencermountain/compromise/tree/master/plugins/speed))
- [Text Cleaning Pipelines](https://awesome-repositories.com/f/data-databases/text-normalization/text-cleaning-pipelines.md) — Cleans and standardizes unstructured text by handling contractions and inconsistent formatting.
- [Text Pattern Matching](https://awesome-repositories.com/f/data-databases/text-pattern-matching.md) — Searches for specific phrases, tags, or regex patterns within a linguistic context. ([source](https://github.com/spencermountain/compromise/blob/master/changelog.md))
- [Linguistic Pattern Searching](https://awesome-repositories.com/f/data-databases/text-pattern-matching/linguistic-pattern-searching.md) — Locates specific phrases or patterns using match syntax and filtering based on linguistic proximity. ([source](https://github.com/spencermountain/compromise#readme))

### Content Management & Publishing

- [Linguistic Content Modifications](https://awesome-repositories.com/f/content-management-publishing/content-management-systems/content-architecture-modeling/document-models/document-sectioning/document-content-structuring/linguistic-content-modifications.md) — Implements capabilities to insert, replace, or remove phrases while maintaining linguistic consistency. ([source](https://github.com/spencermountain/compromise/blob/master/README.md))

### Development Tools & Productivity

- [Natural Language Manipulators](https://awesome-repositories.com/f/development-tools-productivity/developer-utilities-libraries/programming-logic-libraries/text-string-manipulation-utilities/natural-language-manipulators.md) — Wraps, swaps, or replaces terms and phrases while preserving possessives and linguistic tags. ([source](https://github.com/spencermountain/compromise/blob/master/changelog.md))
- [Lexicon Extensions](https://awesome-repositories.com/f/development-tools-productivity/dictionary-and-translation-tools/lexicon-datasets/lexicon-extensions.md) — Allows the programmatic expansion of the internal linguistic dictionary with custom words and grammatical tags.

### Scientific & Mathematical Computing

- [Written Number Parsers](https://awesome-repositories.com/f/scientific-mathematical-computing/written-number-parsers.md) — Transforms written numbers, currencies, fractions, and percentages into standardized numeric values. ([source](https://github.com/spencermountain/compromise#readme))

### Software Engineering & Architecture

- [Document State Engines](https://awesome-repositories.com/f/software-engineering-architecture/architectural-design-patterns/state-management/centralized-state-containers/state-containers/document-state-engines.md) — Maintains a structured object model of text that tracks offsets and metadata across transformations.
- [Grammar Extensions](https://awesome-repositories.com/f/software-engineering-architecture/extensible-plugin-architectures/grammar-extensions.md) — Provides mechanisms to modify baseline grammar and lexicons to adjust linguistic analysis behavior. ([source](https://github.com/spencermountain/compromise#readme))
- [Parallel Text Processing](https://awesome-repositories.com/f/software-engineering-architecture/parallel-text-processing.md) — Distributes sentence parsing across multiple worker threads to process large volumes of text efficiently. ([source](https://github.com/spencermountain/compromise/tree/master/plugins/speed))
