compromise
यह क्या करती है
यह बताती है कि अंग्रेज़ी वाक्यों पर काम करने के लिए compromise के match syntax, selections और plugins कैसे इस्तेमाल करें। यह compromise कोड इस्तेमाल या ठीक करने वाले डेवलपर्स के लिए है।
कब इस्तेमाल करें
- ✓जब आप compromise लाइब्रेरी इस्तेमाल करते हैं और किसी काम के लिए सही method चाहिए।
- ✓जब आप टेक्स्ट में शब्द या वाक्यांश ढूँढने के लिए match patterns लिखते हैं।
- ✓जब आपको compromise का सही import संस्करण चुनना हो या plugin जोड़ना हो।
Skill का लिंक
https://github.com/spencermountain/compromise/blob/master/skills/compromise/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस टेक्स्ट से सभी तारीखें और संख्याएँ निकालने के लिए मुझे compromise का कौन-सा method इस्तेमाल करना चाहिए?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
AI इंस्टॉल किया गया संस्करण और build जाँचता है, फिर मेल खाता method या pattern चुनता है और समझाता है कि नतीजे में क्या होगा।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Using compromise
Compromise is a rule-based English NLP library that runs locally in Node.js and browsers. Its tagging and transformations are heuristic; it does not provide a dependency parse tree, semantic understanding, or an LLM service.
Choose the API for the installed version
Inspect the project's compromise version, import, and registered plugins before choosing APIs.
Prefer the full import nlp from 'compromise' for ordinary use:
| Import | Available features |
|---|---|
compromise or compromise/three |
Tokenization, tagging, named selections and transforms |
compromise/two |
Tokenization and tagging; no .people(), .verbs(), or .numbers() |
compromise/one or compromise/tokenize |
Tokenization; no automatic part-of-speech tagging |
Use the existing module system; CommonJS can use const nlp = require('compromise').
If a method is missing, check the build tier, version, and plugins before inventing a replacement API.
Specialized transforms belong on specialized selections: use .verbs().toPastTense(),
not .match('#Verb').toPastTense().
Read only the detailed docs needed for the task. These paths resolve inside this repository
and packages that ship this skill alongside docs/:
- API: method names, arguments, and specialized selection methods.
- Match syntax: pattern operators and capture groups.
- Tag definitions: valid tags and their hierarchy.
- Concepts: document, View, Term, and mutation semantics.
- Recipes: task-specific starting points.
- Tagging differences: conventions when comparing other taggers.
If this skill was installed separately, look for these files in the consuming project's
node_modules/compromise/docs/ or its resolved package directory. If unavailable, consult the
upstream repository at the installed version's
tag when available. Do not assume the latest docs describe an older installed version.
When docs and behavior disagree, reproduce against that version and inspect its source/types.
Keep the document and selection distinct
nlp(text) returns a View of the whole document. Selections return Views sharing that document.
Transforms mutate the shared document; reading .text() from a selection gives only that fragment.
Keep the whole-document variable when the requested output is the rewritten input:
import nlp from 'compromise'
const original = nlp('She walks home.')
const past = original.clone()
past.verbs().toPastTense()
past.text() // 'She walked home.'
original.text() // 'She walks home.'
Clone before transforming when the original must be preserved. Cloning a selection does not
turn it into a whole-document selection. .all() returns a View of the whole underlying document.
.match(pattern)extracts matching terms;.has(pattern)returns a boolean..if(pattern)filters the current phrases, retaining each whole phrase containing a match. Use.sentences().if(pattern)to retain matching sentences..foundis a boolean property, not a method. An empty View is still a truthy JavaScript object..replace(from, to)finds a pattern and replaces it;.replaceWith(to)replaces the selection..text()returns a string;.out('array')returns strings per match;.json()returns structured records. These are outputs, not chainable Views.- Text outputs can preserve case and punctuation.
.text('normal')is not a universal punctuation stripper. Choose and verify normalization for the requested output rather than stripping blindly.
Write term patterns, not character regexes
Patterns operate on tokenized terms within each sentence. Literal words match case-insensitively;
use {walk} to include inflections such as walked. Use real tag names: #Person, #Place,
#Organization, #Noun, #Verb, #Adjective, #Value, and #Date are useful starting points.
Tags form a hierarchy, so #FirstName also matches #Person and #Noun.
Unknown tags silently match nothing unless explicitly defined by an extension.
Do not invent tags such as #Name, #Location, #Subject, #Object, or #Adj.
| Pattern | Meaning |
|---|---|
#Adjective+ #Noun |
One or more adjective terms followed by a noun |
the big? cat |
Optional big term |
(cat|dog) |
Alternatives |
| `the . |
अक्सर पूछे जाने वाले सवाल
मुझे compromise का कौन-सा संस्करण चाहिए?
स्किल कहती है कि method चुनने से पहले प्रोजेक्ट का इंस्टॉल किया संस्करण और import शैली जाँचें।
अगर कोई method न मिले तो?
यह कोई और तरीका आज़माने से पहले build tier, संस्करण और plugins जाँचने की सलाह देती है।
क्या यह dependency parsing करती है?
नहीं। यह बताती है कि compromise dependency parse trees या अर्थ-समझ नहीं देती।
जानकारी
लेखक का मूल विवरण
Write and debug JavaScript or TypeScript that uses the compromise English NLP library to match text, extract entities or numbers, customize tagging, and transform sentences. Use when the user requests compromise or the project already uses it, especially for its match syntax, selection semantics, build tiers, and plugins.
लोकप्रियता
- GitHub स्टार
- 12k
- रैंकिंग में स्थान
- #11472
- लाइसेंस
- MIT
- अपडेट की गई
- 30/10/2026
कमेंट
- …
इस repository की और skills
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।